As a beginner to java, I was wondering if I should start with using libraries such as Slick 2D and LWJGL, or if I should start without libraries, and learn the inner workings of the code? Will it be any harder for me in the future as a programmer if I start with libraries? And do games with library have better performance than games without? I.E. LWJGL enabled 3D game vs library-less 3D game.
Most of the libraries out there are out there so that you don’t have to write what tends to amount to very specialized code to perform certain tasks. LWJGL is there to provide access to OpenGL commands through native libraries. Slick2d is there to provide a mapping like Java2D to the LWJGL operations.
As for whether they’d be faster? It depends. Many of the libraries available attempt to cover the most cases (Correct me if I’m wrong!) rather than specific cases and are therefore not as ‘good’ as specialized code may be. However, they tend to be Good Enough and it prevents you from having to write a large chunk of code that is probably several orders of magnitude more complex than your game itself.
If you want to learn to write games, use the tools available to you. If you want to learn to do graphics, then try to write the code that the library uses.
Allright, thanks for the tips!
Basically if you want OpenGL in Java, then writing your own bindings from scratch would be ludicrous. LWJGL/JOGL does it very well, and both have been maturing over many years.
Regarding higher level libraries, like LibGDX, Slick2D, jME, etc. that depends on your game’s needs, your goals, etc.
Here’s how I view things:
LibGDX - for 2D/3D games on desktop/android/WebGL
jME/Ardor3D - for 3D games on desktop; more mature than LibGDX with 3D capabilities (i.e. model loading, terrain, etc)
Slick2D - for small 2D games and fast prototyping; especially nice for beginners coming from a Java2D background
TextureLoader + SoundSystem - if you want to just use OpenGL but don’t want to write your own decoders for audio/image, you can use these utilities
Slick-Util - like above, contains audio/image decoders, as well as other utilities (Color, font rendering).
LWJGL/JOGL - this would be as “library-less” as you get with OpenGL. It will be a lot lower-level concepts, but great if you want to learn OpenGL from the ground up or if you want maximum flexibility/efficiency for your game engine.
I’d suggest starting with a simple 2D game, using LibGDX or Slick2D.
You should skip even the libraries and go straight to the top shelf if you can.
Meaning use UDK, Unity, or similar if you can.
If you must go outside of the box then you can roll your own.
If you roll your own for too long and create distinctive features like I have then you will make less as tools tend to have less value than the end consumer products you could have made.
So just make games with the highest level tools you can find, unless your really see something missing like I did.
This decision could determine decades of poverty or profit over the short and long term. Balancing the short term and long term is important.