Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Is Slick2D still recommended or is libgdx the way to go?  (Read 8552 times)
0 Members and 1 Guest are viewing this topic.
Offline Runcible

Senior Newbie





« Posted 2013-03-16 10:44:44 »

Hi all,

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?

Thanks!
Offline ReBirth
« Reply #1 - Posted 2013-03-16 10:50:24 »

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!".

Offline Axeman

Senior Duke


Medals: 7



« Reply #2 - Posted 2013-03-16 11:33:12 »

[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. Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Runcible

Senior Newbie





« Reply #3 - Posted 2013-03-16 12:02:37 »

Perhaps it's me not giving it enough of a chance Smiley 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.
Offline matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #4 - Posted 2013-03-16 12:13:46 »

Using OrthographicCamera is incredibly simple:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
// Initialization:
OrthographicCamera cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
SpriteBatch batch = new SpriteBatch();
// Update loop:
cam.position.set(player.x, player.y);
cam.update();
// Rendering loop:
batch.setProjectionMatrix(cam.projection);
batch.setTransformMatrix(cam.view);
batch.begin();
player.sprite.draw(batch);
batch.end();
// That's it!


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!

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Runcible

Senior Newbie





« Reply #5 - Posted 2013-03-16 12:20:12 »

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 Smiley
Offline matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #6 - Posted 2013-03-16 12:24:16 »

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 Smiley

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

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

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Cero
« Reply #7 - Posted 2013-03-16 13:21:05 »

Using OrthographicCamera is incredibly simple:
1  
snippet

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

Offline Runcible

Senior Newbie





« Reply #8 - Posted 2013-03-16 14:32:41 »

Thanks everyone for the replies, I'm convinced - libgdx it is Smiley
Offline badlogicgames
« Reply #9 - Posted 2013-03-16 15:05:14 »

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?

http://www.badlogicgames.com - musings on Android and Java game development
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #10 - Posted 2013-03-16 15:17:23 »

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?

The hardest part for me was the very strange TiledMapPacker. But we all know, it's getting rewritten now...

I should have written it down... I think there was something else, but I don't remember :/

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Runcible

Senior Newbie





« Reply #11 - Posted 2013-03-16 15:53:25 »

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.

Another thing that I couldn't find anything about was the use of the Screen class. The SimpleApp and AppLifecycle pages make no mention of Screen, or how to use it. Until I found https://code.google.com/p/libgdx-users/wiki/ScreenAndGameClasses via Google I didn't even know the feature existed.
Offline davedes
« Reply #12 - Posted 2013-03-16 16:54:30 »

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).
  • The set-up is actually more difficult than LibGDX since you need to pull from the development branch if you want the most stable source.
  • The tools (texture packer, particle editor, Hiero) are buggy and not nearly as powerful as LibGDX equivalents.

Offline Cero
« Reply #13 - Posted 2013-03-16 20:11:06 »

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?

Well first of all. Is "libgdx-users" considered "official" and up-to-date tutorial stuff ?
Because if not, we cannot use any of that stuff as examples... however they show up of course in google.

Since libgdx decides to break earlier code in order to improve the overall lib, which I support, many example wont work anymore using copy&paste.

here is just one example off the top of my head which I searched a year ago, which is just empty: http://code.google.com/p/libgdx-users/wiki/CameraRoll

Offline badlogicgames
« Reply #14 - Posted 2013-03-16 21:18:56 »

Awesome! That's actually feedback that's constructive and will help us improve. "It's a mess" doesn't.

A few thoughts and links in the mean-time:

We do not break APIs lightly. The tilemap API has been in its old state for about 2 years. We announced the change 2 weeks before we pushed things to master. We wrote an extensive wiki article and provided a total of 5 different examples, including a platformer in 300 LOC. All of those are linked to from the announcement on the blog as well as the wiki.

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.

http://www.badlogicgames.com - musings on Android and Java game development
Offline matheus23

JGO Kernel


Medals: 110
Projects: 3


You think about my Avatar right now!


« Reply #15 - Posted 2013-03-16 21:24:27 »

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>

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline badlogicgames
« Reply #16 - Posted 2013-03-16 21:34:49 »

Hm, what was the "old" scene2d tutorial? I'm not sure there was one. About 8 months ago, Nate published his last API changes to scene2d and put up the two articles that are currently on the wiki.

I agree, i myself have to lookup scene2d things every time. The examples at the bottom of the scene2d.ui wiki page help me get back into the flow.

http://www.badlogicgames.com - musings on Android and Java game development
Offline Cero
« Reply #17 - Posted 2013-03-16 21:37:48 »

We do not break APIs lightly.

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.

Offline Nate

JGO Kernel


Medals: 150
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #18 - Posted 2013-03-16 22:20:03 »

@Cero, that was a looong time ago, but I think it was me and I forgot to blog about it. Oopsie. Smiley 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

Offline badlogicgames
« Reply #19 - Posted 2013-03-17 00:51:15 »


You should, otherwise your complaint rights will get revoked Cheesy

http://www.badlogicgames.com - musings on Android and Java game development
Offline JESTERRRRRR
« Reply #20 - Posted 2013-03-17 01:23:22 »

- ... if you can find them in the semi-complete docs. It's hard to find how to do even basic things at times

+1. Still I do like libgdx though, would recommend
Offline Grunnt

JGO Kernel


Medals: 89
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #21 - Posted 2013-03-17 11:33:58 »

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.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

theagentd (20 views)
2014-10-25 15:46:29

Longarmx (53 views)
2014-10-17 03:59:02

Norakomi (47 views)
2014-10-16 15:22:06

Norakomi (35 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (69 views)
2014-10-14 00:39:48

TehJavaDev (69 views)
2014-10-14 00:35:47

TehJavaDev (61 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (47 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!