I've been playing around with both Slick2D and libgdx for a while now, trying to decide which to use for my game. What's the general consensus these days on which one to use?

My thoughts:

Slick2D

+ Easier to start using, more familiar to people who've used java 2d etc.+ Does the basics and doesn't have a whole lot of extra stuff I don't need + The recent Mojang 'Mojam' seems to have made the forums busier again- Not really being maintained any more, the maintainer himself has suggested libgdx to people

libgdx

+ Newer, maintained and still being developed+ Seems to have plenty of featres...- ... if you can find them in the semi-complete docs. It's hard to find how to do even basic things at times- Almost seems to do 'too much' for my needs - I'm just creating a desktop game

So I guess my questions are, if I feel more comfortable using Slick2D, should I? Or should I put the time in to learn the 'libgdx way' of doing things?

If your programming skills are pretty decent, no problem in using libgdx. You can use common sense or try-error when something not well documented.

But there's one big rule! Pick what you feel comfortable with. This is your only chance (indie) to pick what you like rather hear what people said, because that'll happen for sure on real/business/work project until you scream "OMG why I have to use this!".

[quote author=Runcible link=topic=29009.msg265142#msg265142 + Seems to have plenty of featres...- ... if you can find them in the semi-complete docs. It's hard to find how to do even basic things at times- Almost seems to do 'too much' for my needs - I'm just creating a desktop game[/quote]

Do you really think so? I know some things are missing, but I found it easy to get the basics up and running, like a game screen, to load textures, animation. The only thing that had me pull my hair was the tilemap loader, but that´s rewritten now (haven´t tried the new one though). And if you´re not satesfied with the wiki, there are at least a couple of LibGDX tutorials on youtube.

I have never tried Slick 2D so I can´t say you should pick one over the other, but I felt at home with LibGDX right from the start.

Regarding the features: You just use what you want and leave the rest alone or write your own.

Perhaps it's me not giving it enough of a chance So as an example, one thing I've found difficult to find some basic examples of is how to use the cameras.

In java2d / Slick2D, I'd just create a camera class which follows the player, and when things are drawn to the screen, they're offset by the camera position. It's pretty simple and not much code. However, the wiki page for the OrthographicCamera in libgdx is just plain confusing and has so much stuff that's just not relevant to me, I'm not even sure where to begin.

OrthographicCamera is nothing else, but a class holding information about how big your screen is n' other stuff, like projections - being more complicated, but not important to you.It's purely information, nothing else.

Then you have your SpriteBatch, which wants to get the information about the position and rotation of your view (cam.view) but also about your screen (cam.projection). These are matrices, btw. They are set via

batch.set[Projection / Transform]Matrix(cam.[projection / view]);

.

Finally you have to draw your sprite.

If you want your camera to follow your player around, you have to change it's information: The position. So what you do is, you set it's position to the player position:

cam.position.set(player.x, player.y);

.You also need to call

cam.update();

, so that these changes have an effect. This is very important! Otherwise the matrices (cam.projection, cam.view, cam.combined) won't be updated!

Thank you, that's a massive help. I wish that was on the wiki page for the camera!

One small question, does it have any built in support for draw order / depth? I realise there's a PerspectiveCamera class as well, but I'm not sure if that's what I want (My view will be something similar to any old top-down RPG, Zelda, Chrono Trigger, etc.) In Slick2D I would just sort my entities list by their 'y' position (faked depth) first before they're drawn, but I'd rather do things the 'correct libgdx' way if I'm going to be using it

Thank you, that's a massive help. I wish that was on the wiki page for the camera!

One small question, does it have any built in support for draw order / depth? I realise there's a PerspectiveCamera class as well, but I'm not sure if that's what I want (My view will be something similar to any old top-down RPG, Zelda, Chrono Trigger, etc.) In Slick2D I would just sort my entities list by their 'y' position (faked depth) first before they're drawn, but I'd rather do things the 'correct libgdx' way if I'm going to be using it

I'm just sorting them by y value as well in my game RuinsOfRevenge...

<edit>PerspectiveCamera is for 3D. You could use it together with the Depth-Buffer from OpenGL, but usually you'd just sort your entities. </edit>

That misses a cam.setToOrtho(true);What that does is setting Y axis down, like in Slick2D and Java2D, and most people perfer it.You will have to flip textures and fonts then, but its always just one line to do it.

Also I just do: spriteBatch.setProjectionMatrix(camera.combined);

Ah btw, the camera you mentioned using just an offset... I did that back in Java2D and Slick2D too. But once you use Libgdx camera, its juts a couple of lines and you can even rotate it and zoom and everything, just like that... because its an actual opengl camera

To answer your first question: yes, use Libgdx. Yes the docs are a mess most times. Just ask here or the libgdx forum for help - no matter how simple the stuff is you wanna do

for ordering, yeah just do it yourself, have a internal ordering or order by Y value... depending on how you game looks like

I'd really like to get more input on "the docs are a mess most of the times". Can you point out a few examples and make suggestions on how to correct them?

For me at least, one thing was what I mentioned above about how to use the camera. I would have got much more out of a basic example that matheus23 gave me over the longer current page. I think many of the code samples on the wiki introduce concepts from other parts of the framework that confuse them, e.g. the camera sample includes creating a mesh, binding a texture etc.

I'm sure LibGDX's documentation and tutorials will improve over time. There are plenty of docs already, but most of them assume the reader understands certain concepts like matrices/vectors/GL states/etc. This can be a little intimidating for somebody who's never worked with graphics before.

Hopefully I can help with this front; I've already started writing some tutorials aimed specifically at LibGDX beginners:LibGDX Textures & Pixmaps

Here are the main problems with Slick2D:

It is dead and no longer maintained.

It is buggy and will likely never be "properly" fixed. There are crippling bugs and design problems with almost every aspect of the library, including GUI, texture loading, font rendering, particle systems, polygon triangulation, geoemtry hit-testing, render-to-texture abstractions, sound API, etc.

It relies on old-school OpenGL techniques and doesn't utilize any of the modern pipeline, like batching or shaders. You are way more limited with Slick2D, and will have a hard time doing things like this.

It only ports to desktop. Slick-AE should not even be considered; it is basically just a hackish and extremely buggy Slick layer on top of LibGDX.

The vast majority of posters in the forums have no understanding of OpenGL, and therefore can't help you with more advanced rendering techniques (like lighting or efficient sprite rendering). Most forum members are still struggling with basic programming concepts (methods, loops, etc).

API changes are always handled like this. We first announce upcoming changes on the blog, we link to the discussion about the API change in the forum, and once live, we post another blog post with the details, and usually a link to the Wiki.

The user-wiki hasn't been maintained in a year. It was never official, and the core team never had any involvement in it. I should contact the original maintainer and ask him to link to the official wiki. I'm afraid i can't solve the Google ranking issue.

All available documentation (wiki, javadocs, example code in the repo, external tutorials) are linked to from the documenation page. That is kept up to date, authors of 3rd party tutorials are generally asked to update their tutorials if necessary (we don't always get a reply). Your first check should be the official wiki, then the javadocs, then the forums and/or IRC.

I try extremely hard to make all development as transparent and traceable as possible. Eventually it's up to the user to read the available information, especially the one specifying where updates are posted.

All that being said, nothing is perfect, and our docs are far from being perfect. We keep improving things, but please realize that we do this in our sparetime, and if folks fail to read, there's not a lot we can do.

One thing, which is also very, very, very hard to use is: scene2D. I gave up on it twice. Now it's working for me, but it seems like an impossible task to me to use scene2d without a standard skin, or at least an example skin. I then found the "example skin" in the tests on github, after somebody gave me a link to them. Only then it was possible for me to create something using libgdx's scene2d...

Probably something where somebody should do a complete tutorial with files.Also there are outdated scene2d tutorials telling about outdated json formats.

<edit>Did the old scene2d tutorial change since then? It seems like there is an up-to-date tutorial in the wiki now :/ ... my bad probably</edit>

I dont check the news so to speak, so I dont know if this was ever adressed: But at one point you fixed and broke the following "small thing": when you had flipped textureregions the height, or width whichever was flipped had a minus value for the size... so getRegionWidth() or height would return a negative value. Since some version it was "fixed" and only returned positive values in all cases... which is good, but it broke some code for me which I iterated by using the negative value as a stepsize and such.

@Cero, that was a looong time ago, but I think it was me and I forgot to blog about it. Oopsie. This shouldn't ever happen again now that we have a new system in place where we document API changes in a CHANGES file, which makes for a central place for people to check for this sort of thing if all hell breaks loose after updating your app to the latest libgdx:http://www.badlogicgames.com/forum/viewtopic.php?f=23&t=8159

I've switched from my current project (a space strategy thingy) from Slick2D to LibGDX, for the reasons mentioned in this thread. Slick2D is a bit easier to get started with, but will eventually make your life a bit more difficult because some things are a bit buggy or incomplete.

I think LibGDX is a bit harder to get into, mostly because you need just a little more understanding of OpenGL. Once you get the basics, however, it's pretty much a breeze to use, and the documentation / help that is available was pretty OK for me. It's clear that a lot of love has gone into this library, it's being well maintained, and it has a lot of potential indeed. It's pretty awesome to write a little game and see it work on android, pc and other platforms with the press of a button.

Setting up the library for use was really easy, there's plenty of guidance and the setup tool was wonderful, it Just Works. The thing I've been struggling with the most was the camera, and the coordinate system. Not because these things are bad, but rather because documentation and usage of the camera and coordinate system presupposes some understanding of OpenGL which I didn't have. The OpenGL Super Bible helped in that respect, however.

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