Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
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  
  Need advice mapping out a plan/roadmap to follow for building a 2D platform game  (Read 1360 times)
0 Members and 1 Guest are viewing this topic.
Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Posted 2013-04-29 06:56:26 »

I've start out learning how to develop video games using Java recently, and I've already put together something very basic, but I wanted input from you more experienced folk on how you think is the best way I should continue.

Things I think you should know:

(1) I studied Java in college, so I have a background in Java fundamentals. However, I have only used it sporadically since I started working.

(2) I've already come up with something very basic: a 150-line piece of code that makes a red circle move across a windowed display using a gamepad. It's totally pointless, but it's a start.

(3) I used LWGJL, JInput for handling controls, and Slick-Util for openGL loading/rendering.

(4) I read this article: The guide to implementing 2D platformers and found it very fascinating. I was thinking of making my game based on the "Type #2: Tile Based (Smooth)" implementation.

Off the top of my head, I was thinking of learning how to manage a tiled map and then go on to read up on 2D Physics... collision detection... axis-aligned bounding box... that sort of stuff.

But I'm creating this thread since I want advice on what my plan of action should be. Should creating tile-based maps and 2D physics really be next on my agenda? Or should I be looking at something else first?

Any sort of insight is appreciated.

Thanks!

Offline matheus23

JGO Wizard


Medals: 96
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2013-04-29 16:26:17 »

If you've never finished a 'game' (or something like it), then you shouldn't that much studying.

The red circle in your windowed canvas was a very good start. Go on from there, do simple image loading / drawing, then start doing some AABB-collision checks with collision response afterwards, and finally create some simple platformer without ladders, without slopes, without anything like that.
You would then move on to loading maps from simple text files, where each character represents a tile type, then you'd go with creating a menu GUI for your game.
[...]

Your choice of LWJGL and JInput was very good. You should probably take a look at LibGDX, but you could write plain LWJGL too, of course.


TL;Dr: Don't do so much planning, just start to write. And of course: Have fun!

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline davedes
« Reply #2 - Posted 2013-04-29 18:04:22 »

This is my opinion on LWJGL:
http://www.java-gaming.org/topics/how-to-check-collision-between-object-from-the-same-arraylist/29423/msg/270106/view.html#msg270106

If you want to stick to LWJGL, your focus should not be to make a game, but instead to learn how graphics programming works. Things like shaders, matrix math, meshes, etc. If you want to learn game programming like physics, collision, tiled maps, etc. you should use a library that handles all the boilerplate for you, like LibGDX.

If you plan to stick with LWJGL, you might like some of my tutorials here:
https://github.com/mattdesl/lwjgl-basics/wiki

Cheers. Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #3 - Posted 2013-04-30 03:35:05 »

If you've never finished a 'game' (or something like it), then you shouldn't that much studying.

Sorry, but what does this mean? Finished developing a game; or, finished playing a game? And why does it mean that I shouldn't do that much studying? Huh

The red circle in your windowed canvas was a very good start. Go on from there, do simple image loading / drawing, then start doing some AABB-collision checks with collision response afterwards, and finally create some simple platformer without ladders, without slopes, without anything like that.
You would then move on to loading maps from simple text files, where each character represents a tile type, then you'd go with creating a menu GUI for your game.
[...]

Great, this is just what I had in mind: maps from tiles and AABB-collision checks. Exactly that. Good to see someone giving it a nod, thanks.

TL;Dr: Don't do so much planning, just start to write. And of course: Have fun!

What an intriguing piece of advice! In almost most things, experts would say that planning ahead and having some sort of outline/plan/guide is most beneficial.  It's both odd yet refreshing to hear this Tongue

Your choice of LWJGL and JInput was very good. You should probably take a look at LibGDX, but you could write plain LWJGL too, of course.
If you want to stick to LWJGL, your focus should not be to make a game, but instead to learn how graphics programming works. Things like shaders, matrix math, meshes, etc. If you want to learn game programming like physics, collision, tiled maps, etc. you should use a library that handles all the boilerplate for you, like LibGDX.

Very interesting. Thanks to both of you, I'll definitely check out LibGDX before continuing on.

Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #4 - Posted 2013-04-30 03:57:55 »

Good lord, the libgdx wiki/documentation looks awesome. It's incredibly comprehensive.

So if I use libgdx, I can likely do away with LWJGL and Slick-Util (which I get the sense that I didn't even need to use in the first place), right?

And if I don't want to handle gamepad controllers, I don't even need JInput anymore, right?

Offline davedes
« Reply #5 - Posted 2013-04-30 06:01:09 »

LibGDX has its own set of input bindings for different platforms (iOS, desktop, Ouya, etc).

Slick-Util is old news, and uses deprecated OpenGL. A more modern alternative would use shaders, and may look like this. It's very easy to write your own texture loaders. (But, of course, even easier to work with textures in LibGDX.)

LWJGL isn't necessary unless you want to go "low level" for some reason, and spend many months basically re-writing what LibGDX already provides for you.

Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #6 - Posted 2013-04-30 06:06:36 »

Thanks dave. I'm not sure I can fully appreciate that info now, but I'll keep that in mind.

BTW, I took a look at your tutorials and they look awesome. I'll definitely use those for reference over the next week or so.

Offline cylab

JGO Knight


Medals: 34



« Reply #7 - Posted 2013-04-30 10:56:07 »

If you've never finished a 'game' (or something like it), then you shouldn't that much studying.

Sorry, but what does this mean?

TL;Dr: Don't do so much planning, just start to write. And of course: Have fun!

What an intriguing piece of advice! In almost most things, experts would say that planning ahead and having some sort of outline/plan/guide is most beneficial.  It's both odd yet refreshing to hear this Tongue

They just mean, you need to finish a game or something similar on each level of your abilities on your learning curve.

The biggest problem for people creating games here is that they either think too big (ala "My first project will be a MMORPG with Crysis like graphics") or they get lost in details (ala "I want to do a top-down scroller... but with 3D background... so need procedual generated terrain... but with dynamic lighting ...so need Shaders... but want Caves... so need Voxels... etc.)

So it is most important, that you finish something with your current abilities before you go on.

Otherwise you either spend all your time on some highly complicated and sophisticated part of your (never-existing) game or you loose interest alltogether, because you never reach your goals.

(...) experts would say that planning ahead and having some sort of outline/plan/guide is most beneficial.

Yeah, experts would plan ahead based on their expertise, but if you are just in the beginning of building it up, you can only plan ahead to your horizon - you can't see any further. But the nice thing is, once you reach your that limit, it will have moved (by approx. 4.8km Wink) revealing a completely new world to explore...

So leave a mark (finish something), and move on!  Pointing

Mathias - I Know What [you] Did Last Summer!
Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #8 - Posted 2013-04-30 11:41:35 »

^ What do you think is a feasible starter project?

Would a very basic 2D Platformer be apt; or, is there something simpler that a beginner in game dev (but with sound programming background) should begin with?

Offline cylab

JGO Knight


Medals: 34



« Reply #9 - Posted 2013-04-30 14:25:53 »

common starting points are arcade classics like space invaders, pac man or breakout, but you are not limited to them. the important bit is too choose something you can turn into a finished - and hopefully fun - game without learning too much new stuff.

so ideally only once you created a finished (mini-)game for every feature or aspect of your planned game, you should start working on it seriously.

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Wizard


Medals: 96
Projects: 3


You think about my Avatar right now!


« Reply #10 - Posted 2013-04-30 15:48:04 »

^ What do you think is a feasible starter project?

Would a very basic 2D Platformer be apt; or, is there something simpler that a beginner in game dev (but with sound programming background) should begin with?

2D Platformer is what I'd definitely recommend, it's what I started with, too Smiley

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

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #11 - Posted 2013-05-02 04:43:44 »

This is what I have so far, but I'm still at a loss at where to take it, hehe Tongue

<a href="http://www.youtube.com/v/zoGczUAoDGI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/zoGczUAoDGI?version=3&amp;hl=en_US&amp;start=</a>

This is made with libgdx and jinput (for gamepad handling, which I was using to control the ball).

Hardest concept I had to grasp up to this point was translating and converting between the physics World and the game screen... you know, the pixels-to-meters/meters-to-pixels conversion that Box2D requires for it to simulate properly... that made my head hurt a bit.

Another question regarding libgdx: Do I have to develop for the different platforms (android,html5)? Because I just set out to make a gamepad/keyboard/mouse controlled 2D platformer, and apparently libgdx requires you to setup projects for the other platforms as well... or at least Android, I think.

My biggest qualm about this is that I don't know how my game will translate to mobile devices and how to implement that and how to handle the differences in coding due to the different gaming platforms/mediums.


Offline davedes
« Reply #12 - Posted 2013-05-02 05:44:38 »

Nope, you don't need to develop for android/ios/etc if you just want to target desktop, and vice versa. Here is a thread discussing how to develop for desktop in Eclipse:
http://www.java-gaming.org/topics/libgdx-how-do-i-load-local-assets-without-an-android-project/29148/msg/266799/view.html#msg266799

Offline Lamargo

Junior Newbie





« Reply #13 - Posted 2013-05-02 15:13:06 »

If you want to stick to LWJGL, your focus should not be to make a game, but instead to learn how graphics programming works. Things like shaders, matrix math, meshes, etc. If you want to learn game programming like physics, collision, tiled maps, etc. you should use a library that handles all the boilerplate for you, like LibGDX.

I don't think I've seen this written quite as definitively before, there is usually lengthy discussions and debating making it difficult, for a newbie, to see where the focus is in each API. As a result, I decided months ago to pick up LWJGL and slick for making 2D games (I saw libgdx as the API for android...), even though I've barely touched anything in LWJGL to date! I'm now thinking that I should be making the switch to libgdx, as I could be saving myself a lot of time.

Great thread! Smiley
Offline davedes
« Reply #14 - Posted 2013-05-02 15:37:42 »

LWJGL and LibGDX can both provide you with a framework to make games. The difference is that LWJGL is "low level" -- i.e. giving you only a wrapper around desktop OpenGL, some input, and a window. LibGDX is "high level" in that it integrates with game development tools like Tiled map editor, Spine 2D skeletal animator, Particle Editors, TexturePacker, Box2D physics, dynamic lighting, etc. It also includes image/audio decoding, a 2D scene graph, themable GUI toolkit, advanced vector/matrix utilities, shader and vertex format utilities, etc.

In short: if you want to make a game, LibGDX will save you a lot of time and probably give you better tools than anything you'd be able to write yourself.

Keep in mind, since LibGDX can also be used as a "low level" OpenGL ES wrapper, it is often a wiser framework to use than LWJGL even if you want to build your own OpenGL engine from the ground up. That way, your game distributes to Android, iOS, and WebGL.

Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #15 - Posted 2013-05-09 01:56:31 »

I've got temporary textures for the walls and platforms already. Temporary because it's just something I found on the internet and I kind of want to make my own textures... but for the purpose of seeing how the game looks like, it'll do for now.

<a href="http://www.youtube.com/v/8aAPZ-MpEes?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/8aAPZ-MpEes?version=3&amp;hl=en_US&amp;start=</a>

There are few kinks I have to work out such as:

- Keeping the ball in the center vicinity of the frame as opposed to to the left

- That sudden jump the ball did when it hit the top-left corner of the highest platform... don't think that's supposed to happen.

Aside from that, the focus now is learning how to do better art and better level/game design.

Also, someone pointed out that the direction where I'm headed in looks awfully similar to this game called NightSky:

<a href="http://www.youtube.com/v/fjJnk2jgnzs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/fjJnk2jgnzs?version=3&amp;hl=en_US&amp;start=</a>

Looks like a cool game. Only heard about it now Smiley

Offline heisenbergman

JGO Coder


Medals: 14
Projects: 1


L___ o_ G___ a__ P___


« Reply #16 - Posted 2013-05-09 03:41:23 »

^ Hm... can/should I put this on the WIP subforum?

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.

xsi3rr4x (11 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (23 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!