Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

At first i want to mention that i already searched much on the web, also in this forum, but i couldn´t find accurate answers to my questions or only outdated answers.

My goal is to write a 2D game in Java. I think the performance shouldn´t be a great issue, because i know similar(even better) games that run in a browser and have no (or not big) performance issues. So if i would develop a similar game as a Java desktop application the performance shouldn´t be a problem i think.

  1. What would be a good game development engine to develop a 2D game in java? I know Slick2D, but as far as i know even the developers say that it doesn´t get maintained anymore and/or has some serious bugs. I also know jmonkeyengine, but i think it is only used for 3D games. So i would be really happy if anyone could suggest a good engine.

  2. Would it be an advantage or even necessary to use a library like LWJGL - to acces OpenGL/AL?

  3. What is it all about with this Garbage Collection issue. I know little about the GC, but i think the problem could be that it sometimes pauses your application for some time to do the garbage collection and while this is happening your game "freezes". Any information on this would also be highly appreciated.

I hope you understand my questions and i am allowed to ask them here.

Thanks for all help!

share|improve this question
1  
"What technology to use" questions are unfortunately off topic. Anyway, you can try libGDX/AndEngine. They're generally quite good, and should be "good enough" for your first game. – ashes999 Mar 2 at 12:16
@ashes999 I do not want to write a game for android. Or are these engines also used to write normal desktop application games? – user26923 Mar 2 at 13:06
1  
I've been using libgdx for a while and second that. go try it, you won't regreet. – petervaz Mar 2 at 13:33
@user26923 libGDX works equally well for desktop. Not sure how easy it is to redistribute though. – ashes999 Mar 2 at 15:52

closed as not constructive by ashes999, bummzack, Byte56, Tetrad Mar 2 at 15:51

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

1) If it's you first game, OpenGL might be a bit much to tackle to start off with. However, I have had a great time using libGDX which allows you to write code that will be used for both an Android, Desktop and web version of your game (of-course you can just target one). LibGDX has classes for allowing simplified 2d OpenGL drawing such as (SpriteBatch and Texture), meaning you don't need to delve into actual openGL programming(if you don't won't to).

2) You could make a simple 2D game without OpenGL and still expect great performance (on desktop).

3) As for garbage collection; It doesn't seem to be too much of a problem so long as you know what you are doing. If you are allocating a lot of objects every frame of your game; then you can expect garbage collection to kick in at some stage and spend time releasing memory from the objects no longer being used. On desktop this should rarely be a problem but on Android devices the GC can delay your app for up to half a second!. To combat this you just need to stop ease up on the allocation of new objects and reuse existing objects.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.