Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Performance Tuning / Re: Slick2D StateBasedGame taking 20% cpu? on: 2013-10-14 16:34:52
Turns out it's vsync causing the trouble. It never used to do that (or at least I don't remember that happening). What do you suggest... Leave it or keep it?
2  Game Development / Performance Tuning / Slick2D StateBasedGame taking 20% cpu? on: 2013-10-14 15:15:27
I've been using Slick2D for over a year now and decided to dive into StateBasedGame. Oddly enough, even after setting the maximum update interval and framerate, it still takes up 20% of my GPU.

Image of the issue: http://i.imgur.com/gEScQNR.png
Here's all the code: http://pastebin.java-gaming.org/0ab4d513777

Seriously I don't see what's wrong. It can't be my PC as my CPU is an Intel i7 3770 and my GPU is a GTX 660. I also have 8gb of ram so it can't be memory issues...
To make things short, is there anything I can do about it? Is it an error in slick2d's end of the code or am I doing something wrong? Any help is strongly appreciated.
Thank you for your time,
3  Game Development / Newbie & Debugging Questions / Slick2D applet, signing jars? on: 2013-06-23 05:31:36
Okay so I figured out how to make Slick2D applets, but when I come to add images or sounds to it, it stops working... From looking around and opening up other slick2d applets, I've noticed that they have 3 files in their meta-inf.

.MF
.DSA
.SF

My meta-inf only has the .MF file, which looks like this:

"Manifest-Version: 1.0"

That's it.

With more research, I found out that there are programs to sign jars. The thing is, they cost money.

SOO here's my final question,
is there a free way to sign my jars..? What programs can be used (or is it just an option) ?
4  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-15 22:39:47
Thank you! Smiley Dude, this worked! I was expecting to have to do some ridiculous stuff xD
Thanks Smiley
5  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-10 22:58:24
Hum, ok I did get an error.

Unable to create game container
java.lang.RuntimeException: Unable to create game container
   at org.newdawn.slick.AppletGameContainer.init(AppletGameContainer.java:147)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1330)
   at org.lwjgl.util.applet.AppletLoader$2.run(AppletLoader.java:909)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$200(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


And yes, I tried switching the game class to the game rather than the main and still got this error. Do I need to initialize the AppletGameContainer somewhere in my code? Set some settings (fps, window size etc...)?
6  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-10 22:48:00
Quote
Note that this is the Game class, the main is a separate class.
Also, do You have java console running ? And You get no error there ?

Java console? It compiled on Eclipse and ran perfectly fine. Java didn't give a little red x on the top left of the screen so I suppose there is no errors. Anyway, I'll check out that example you gave me. Maybe it's just me being retarded. XD Thanks Smiley
7  Game Development / Newbie & Debugging Questions / Re: Slick2D applet blank screen + no errors. on: 2013-05-09 05:58:51
I changed the engine a little and the game class is also the main now but it still doesn't work... Could you actually give me a working example?
8  Game Development / Newbie & Debugging Questions / Slick2D applet blank screen + no errors. on: 2013-05-08 04:54:49
I've been trying to figure out how to make an applet with Slick2D and I just can't seem to get it to work. I made a Main class and a Game class which extends BasicGame. The "game" runs perfectly on Eclipse, but when I compile it and launch it on a browser, it loads the content and shows a blank page after.

I posted the applet on my site as well as the FULL src to the project. Any help would be appreciated!

Applet: http://ghostid.net/games/applet_test/
Source: http://ghostid.net/external/downloads/Applet_TEST.zip

Here's all my code...

Main Class:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public class Main {
   public static void main(String[] args) {
      try {
         AppGameContainer game = new AppGameContainer(new Game("Test"));
         game.setDisplayMode(350, 250, false);
         game.start();
      } catch (SlickException e) {
         // TODO Auto-generated catch block
        e.printStackTrace();
      }
   }
}


Game Class:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
public class Game extends BasicGame {
   public Game(String title) {
      super(title);
      // TODO Auto-generated constructor stub
  }
   @Override
   public void render(GameContainer gc, Graphics g) throws SlickException {
      g.setColor(Color.red);
      g.fillRect(45, 45, 125, 100);
      g.setColor(Color.black);
      g.drawString("Hello. .__.", 60, 75);
   }
   @Override
   public void init(GameContainer gc) throws SlickException {   }
   @Override
   public void update(GameContainer gc, int ticks) throws SlickException { }
}


Here's my code for my HTML file.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
<applet code="org.lwjgl.util.applet.AppletLoader"
   archive="lwjgl_util_applet.jar, lzma.jar"
   codebase="." width="350" height="250">
   <param name="al_title" value="test">
   <param name="al_main" value="org.newdawn.slick.AppletGameContainer">
   <param name="game" value="net.ghostid.Main">
   <param name="al_jars" value="game.jar, slick.jar, lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma">
   <param name="al_windows" value="natives/windows_natives.jar.lzma">
   <param name="al_linux" value="natives/linux_natives.jar.lzma">
   <param name="al_mac" value="natives/macosx_natives.jar.lzma">
   <param name="al_solaris" value="natives/solaris_natives.jar.lzma">
   <param name="al_debug" value="true">
   <param name="separate_jvm" value="true">
   </applet>


Sorry for the sloppy code, tried making it as small as possible so this post wouldn't be insanely long.
So what's wrong? Why is my Applet just giving a white screen?

Thanks an advanced,
Once I get this working, I'll make a CLEAR tutorial on how to make a slick2d applet.. ._. I can't seem to find a full one with source code.
9  Game Development / Newbie & Debugging Questions / Re: Slick2D making AppletGameContainer on: 2013-03-19 16:32:20
Alright, I'll give it a try. Smiley I'll give news if I get it working!
10  Game Development / Newbie & Debugging Questions / Re: Slick2D making AppletGameContainer on: 2013-03-18 03:43:55
Well I do have a working game, this was just my main class. Tongue I'm just very unsure of how to make it work on a browser. Don't I need to change my AppGameContainer to an AppletGameContainer..?
11  Game Development / Newbie & Debugging Questions / Slick2D making AppletGameContainer on: 2013-03-15 05:11:37
Alright, so I have this game that I made a while back and now I want to put it on my website BUT the problem is I made it using AppGameContainer. I'm not quite sure how to change the AppGameContainer to an AppletGameContainer. Here's what my main class looks like.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
public class Main {

   public static void main(String[] args) {
     
      AppGameContainer game;
     
      try {
         game = new AppGameContainer(new Engine("Galactic Warrior"));
         game.setIcon("resources/images/ico3.png");
         game.setDisplayMode(640, 480, false);
         game.setMaximumLogicUpdateInterval(60);
         game.setTargetFrameRate(60);
         game.setAlwaysRender(true);
         game.setVSync(true);
         game.setShowFPS(false);
         game.start();
      } catch (SlickException e) {
         e.printStackTrace();
      }
   }

}


So how exactly would this be done? Hope you can help me, would strongly be appreciated! I've been stuck on this for a good while now,
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (16 views)
2014-04-15 18:08:23

BurntPizza (14 views)
2014-04-15 03:46:01

UprightPath (27 views)
2014-04-14 17:39:50

UprightPath (12 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (51 views)
2014-04-10 04:04:31

BurntPizza (110 views)
2014-04-08 23:06:04

tom_mai78101 (211 views)
2014-04-05 13:34:39

trollwarrior1 (180 views)
2014-04-04 12:06:45

CJLetsGame (185 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!