I just created an account at java-gaming, and just need confirmation on something. While I am new to Java, I do have experience as an ActionScript 3.0 programmer, so creating game logic is not the issue.

I am making a platformer using java2D with my own engine for displaying the content. I have a fairly decent game loop that keeps the game logic consistent while preventing tearing. The game runs at 60fps, but occasionally hiccups on some machines. I am using a bufferStrategy to do the rendering while allowing the openGL pipeline to do it's job.

I'm here to ask if someone could check to see if my game runs at a good fps on their machine. While I can get the game to run perfectly smooth on my laptop, the framerate is a bit sluggish on other machines. I don't know if I'm simply being paranoid about the framerate, or if there is a problem that I need to address. I want to see how the game performs on other machines, so that is why I am asking for your opinion.

If this is not the right place to be asking this question, I do apologize. I'm new here, so I may not know the correct way to go about asking this question. The link to download game is below. It's only about 2mb now, as I haven't gotten too far. Still building the game logic! I do appreciate any potential help!

P.S. I created a configuration file in the stuff folder that can be opened in notepad or wordpad which allows the user to set properties such as sun.java2d.opengl. If ya wanna fiddle around with the graphicsConfig.figgy file, be my guest!

It seems I was already using a game loop with concepts introduced by variable timestep game loops. As I said before, I am able to have the game logic remain consistent with the desired framerate. I am really just asking if someone could test my demo to see how the performance is on their machine. If it's too much trouble, then I understand.

After disabling the OpenGL switch, it runs fine on my machine (that switch never works for me).Q6600 and GTX460.Seems quite smooth. Would probably run at a much higher rate that 60 fps.But to find bad hotspots, leaks and the like you would probably need a profiler anyway.

Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.

Your original post sounds like typical Java2D. You can never get good constant behavior. I suggest you finally ditch AWT completely and go for raw OpenGL through LWJGL. If you don't want to learn OpenGL, you can use Slick2D, which has a Java2D-like API yet uses LWJGL underneath. You can also use LibGDX, which is an excellent library on top of LWJGL or JOGL, while allowing you to compile to Android and HTML5 too.

Would it be in any way possible to keep the current engine I've built? I've spent months on building it, and would really be peeved to have to start all over. I guess my question is would it be possible to, lets say, replace every item that uses a BufferedImage with whatever image class LWJGL uses? That way, I could retain the functionality of the classes I've created that encapsulate the the image data.

Yikes! That's really upsetting! Well, apparently I've gotten decent results on another user's computer, so for this one game I'm building I'll stick with Java2D. It's just occasionally a tad jittery. When I start another project, I'll definitely investigate LWJGL.

Let me rephrase. I have a couple of classes that make displaying things easy. I borrowed a couple of names from ActionScript, so there is some overlap in functionality. The DisplayObject class I created contains a user specified BufferedImage, and getters and setters for width, height, scaleX, scaleY, and rotation. The DisplayObject container can contain multiple DisplayObjects or even other containers. It is useful for nesting images.

Could I make make my objects essentially function in the same way, but rewrite a large portion of my engine to accommodate for the change from a BufferedImage to a LWJGL texture? Slick2D sounds nice, but I don't always know what's going on under the hood.

Although Slick's API is similar to Java2D in some ways, trying to port from one engine to another is definitely not going to be easy. I'm seeing JMF, JavaSound, and some other things that will not really flow well in an engine like Slick.

My advice is to shelf whatever Java2D project you've got now and start again from the ground up, this time learning Slick2D, LibGDX or another library.

Honestly, every time I see a thread like this I cringe. Java2D is simply not a good starting point for a beginner game developer.

I attempted to run your game, and unless I do it from Command Line, I get a WSOD (White Screen of Death?).

Slick's pretty easy to run with and it comes with a lot of stuff that can be helpful to you, like the various stuff for controlling the frame rate, etc. And it has an extension for the lovely TWL GUI system, which can make a lot of things easier.

LibGDX is a personal favorite right now, mainly because I recently got myself an Android phone and it makes writing/testing things for the Android easier than trying to dig through LogCat. However, learning its built in UI system can lead to some fun do to the dearth instructions and the like (Though, just reading the sparse Javadocs and the actual code can teach you a lot about it).

I started with Java2D as well and added/switched to OpenGL with LibGdx at some point. That was relatively easy and worth it.

But before doing so, it would make very much sense to identify your problems first, otherwise you could end up with the same problems after porting.I never encountered hiccups with Java2d.Could be that suspicious OpenGl-switch, wrong usage of sleep() calls, using unmanaged images, creating too much garbage, bad algorithms, testing on ancient machines, anything...

Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.

After running your game for about 1 minute there was a huge amount of garbage created:~ 500MB for double[]~ 100MB for java.awt.Dimension

That is way too much for a ball and a background. I didnt' even move the ball. I would first check that. Even the best garbage collectors reaches its limits at some point. And that's not Java's fault or that of the GC principle.

Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.

Alright, I'm gonna just shelf what I have currently even tough it pains me to do so to no end... For the time being, I'll pick up slick. I'm used to developing games without focusing too much on what's going on under the hood, so I guess it's in my best interest to pick that up. When I become more experienced with the topic, I definitely WILL invest more time into rendering graphics on my own. Thanks again for the quick responses! I was just looking for an opinion, but I got an entire diagnosis!

Your original post sounds like typical Java2D. You can never get good constant behavior. I suggest you finally ditch AWT completely and go for raw OpenGL through LWJGL. If you don't want to learn OpenGL, you can use Slick2D, which has a Java2D-like API yet uses LWJGL underneath. You can also use LibGDX, which is an excellent library on top of LWJGL or JOGL, while allowing you to compile to Android and HTML5 too.

Your original post sounds like typical Java2D. You can never get good constant behavior. I suggest you finally ditch AWT completely and go for raw OpenGL through LWJGL. If you don't want to learn OpenGL, you can use Slick2D, which has a Java2D-like API yet uses LWJGL underneath. You can also use LibGDX, which is an excellent library on top of LWJGL or JOGL, while allowing you to compile to Android and HTML5 too.

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