Newbie questions on game states and game libraries

Hello everyone!

For around 2 weeks now I’ve been making progress in learning Java which so far works great (I have experience with C++ already so it’s quite easy) however I still haven’t made an actual game project so far. I’ve seen already few tutorials on developing 2D Java games and i’m not completely ignorant to this topic, but id be really grateful for some advice from experience game programmers. I want to start with a very simple RPG game and slowly “upgrade” it step by step just for fun and the knowledge ill gain from doing this (im a huge fantasy fan). The questions i have so far are:

  1. i know there are several libraries that game developers can use. I already know of LWJGL, Slick/Slick2D and libGDX. Im tempted to use slick, but i know there are various reasons not to do so and most people advice to try libGDX. My question would be: which one should i actually choose for a simple RPG game? I think slick is quite easy still, but if some of you have libGDX tutorial links (on youtube preferably or a document with methods available and what they do) i’d be REALLY grateful for it.

  2. I found a fork when it comes to creating Game States, like the PLAY, MENU, OPTIONS states etc. Which way in creating them would be most adviced for starters and which is most efficient in the long run? I know of Slick having a StateBasedGame class and it adds states each as a separate class which sounds quite good to me. Also there is the method where you simply create ur own GameStateManager from scratch and use enums for the game states. Which one is advised?

ADDITIONAL INFO: this is a tutorial showing slick stateBasedGame class usage https://www.youtube.com/watch?v=C_h1M8JKFEc&list=PL210C2267A8922854&index=5 and this one is for a self coded game state manager https://www.youtube.com/watch?v=ZV2zvcx9Y0A.

Thank you very much in advance! :slight_smile: Can’t wait to finish my very own epic RPG game!!!

I’m in a similar position to you, I had learned c++ some years ago, but because it was right after the .com crash, I was not experienced enough to keep the job I had, and while I had an interest in game programming I had to give it up to focus on other things… I regained interest after completing engineering and wanted to teach myself how to make games in my own time.

Anyway, I looked over the options, and I found libgdx to be quite well documented, makes porting apps from laptop, to android or tablets very simply… I can’t speak to slick, but it seems that its comparable.

I would advise to try to avoid the issue that I did, and try not to take on more than you can handle, I’ve come to realize that because I had started a project that was still beyond my skills, that I wind up wasting more time than I would like trying to solve relatively simple problems.

In terms of game states, I wouldn’t necessarily worry about that initially. Things like pausing, menus, etc, that can be added in later. Now, Im far from the most experienced around here, but it seems to me that if you start with planning, like with pen and paper, to figure out how you will build things.

Then, when it comes to building it, start with one task and get it working, then move on to the next thing.

With your example of an rpg, are you going to make it an action rpg? a final fantasy type of rpg where there are fight scenes? Or a tactical rpg where you move each character like chess pieces? a platform rpg?

Oh, and it would be better for you long term to start with small projects, while you learn various techniques and methods, the nice thing is that as you make small projects you will find ways to tackle problems, and will give you some code that can be modified for other purposes…

When i started, I remade a tetris clone, a pacman clone… but then, I’ve come to realize I made the mistake of starting on a platform game, which is turning out to be still far beyond my skill set, and have wound up putting weeks more time lost trying to figure out smaller problems than I’ve been able to spend in actually progressing things further.

however, if you know what you want to make, I’m not here to say you cant do it, but keep in mind by starting small, you will get the skills and knowledge so that when you do get that epic rpg underway, you will know more about everything that is needed to make it good.

LibGDX + Overlap2D and / or Spine is a good place to start as the latter two have LibGDX backends.

  1. library doesn’t matter, start with one, if you out-grow it, move to the next one. One tip: there is no “simple rpg” better try your hands at something a lot more simple

  2. also doesn’t matter… anything that works is good. If you out-grow it, or learn better ways to do it, you can start using those methods. But what ever works is a great solution.

my tip, find some free game source-code, start tweaking it and learn as you go from that.

I used Slick extensively for around four years before I outgrew it and moved onto LibGDX. Slick is really good for beginners because there’s a lot less to set up in order to render your sprite or whatnot. LibGDX on the other hand is a bit more advanced but offers many more things that what Slick can do (3D, better shader support, lower-level GL stuff and whatnot). It can also easily port to Android, iOS, and Javascript.

As for game states, Slick uses integers for each state when you initialize. You could use constants or have a map that could map String (names) to integers if you so wanted. In order to change states you would set the state to whatever ID you registered it to.

LibGDX has states as well, and they’re a lot more robust. This time you have a Screen object that is your state and you would pass it into setScreen to change the state. Handling the states for yourself is your own problem however, but how I do it is with a map of String and Screen.

In short: Slick is good for beginners, LibGDX is more advanced but offers more features as a result. Try Slick first and build a little game and improve as you go. Good luck!

Thanks alot everyone for the answers really appreciate it and it did help! Sorry for the late response but had internet issues :confused:

@bmanmcfly
I already have plans and small steps. Basically its a very small project at the beginning and i simply add more and more features, in short, im just upgrading the game slowly based on what new i learn. For now i already have a simple world map and a tile manager that renders different kind of blocks etc and a movable player so im doing progress. Also the game is going to be something similair to Pokemon system if you ever played it. There will eventually be zones that have enemy encounters and the party will have 4 different members (like a tank, wizard, healer etc etc).

I will try using slick for now then. I did create everything in my code from scratch including spriteSheet loader, map/world loader and game state manager and 2 states, i was just a bit afraid if i did it all myself there might be errors later on since i dont know ALL of the upgrades that i will make (tho i have the next 1-2 months planned) so dont feel like risking making a wrong design gamestatemanager.

Again thanks everyone! You are awesome!

Topic can be closed