Sign in to follow this  
Firestorm ZERO

[java] Need help making a 2D game

Recommended Posts

A group of my friends and I want to make a 2D shooting game with network capabilities. (like those top-down shooters or like Gradius with network abilities). We are all beginners in the gaming area. The only language common to us is Java. So far we are looking at LWJGL. I was wondering if this is a good package to work on on our game. Additionally if there are any good tutorials to help us get started.

Share this post


Link to post
Share on other sites
LWJGL is great by virtue of providing a good interface to OpenGL. LWJGL also wraps around DevIL (but this is to be removed soon), DirectInput (replaced with some other input library in the latest release, I think), and OpenAL, so you have quite a low-level but game-centric library there which does many useful things apart from pretty graphics.

You will benefit from 3D acceleration even if your game is only 2D, but you will need to juggle with 3D concepts a bit in order to get it set up for orthographic projection. Normally I'd recommend you look at something like jMonkeyEngine, but it may not be necessary for you if most of your game will be in 2D.

There is some example code over at lwjgl.org and in the forums, but for your particular needs, you should start with KevGlass' Space Invaders tutorial which does LWJGL and 2D.

The networking part is trickier. Using the Sun Game Server is probably overkill, but you should browse the networking forums over at javagaming.org, as many Java networking questions naturally end up there.

Share this post


Link to post
Share on other sites
Quote:
Original post by Firestorm ZERO
A group of my friends and I want to make a 2D shooting game with network capabilities. (like those top-down shooters or like Gradius with network abilities).


If you're just starting then a networked shooter is probably not a good idea. Scrolling shooters like R-Type and Gradius require *exact* movement and collision detection, and typically are one-hit-kills. This makes them *very* hard to make work over the internet. It'd be harder than a typical FPS or racing game (which tend to do all sorts of fudges and faking), and most of the information on the 'net doesn't apply.

You'd be much better off making a scrolling shooter with only local multiplayer (ie. two people on one keyboard). You're more likely to finish something playable that way.

LWJGL (or Slick) is a good choice though.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
If you're just starting then a networked shooter is probably not a good idea. Scrolling shooters like R-Type and Gradius require *exact* movement and collision detection, and typically are one-hit-kills. This makes them *very* hard to make work over the internet. It'd be harder than a typical FPS or racing game (which tend to do all sorts of fudges and faking), and most of the information on the 'net doesn't apply.

You'd be much better off making a scrolling shooter with only local multiplayer (ie. two people on one keyboard). You're more likely to finish something playable that way.

LWJGL (or Slick) is a good choice though.


I agree that a networked game for first timers is quiet a large challange but I will disagree that an FPS or Racing Game would be easier as those tend to be 3D and since you are suggesting they use LWJGL then I would highly advise against a 3D game. Mainly because you will have to make an engine on top of LWJGL that handles, rendering, device states, meshes, resource loading and caching, projections, tranformations, culling (most likely implementing an octree), animations, special effects and shaders (still have to do this with 2D), scene graph, and of course on top of all of this you will have to worry about the game play and gui interface. Then you also probably want networking for your FPS not so much for racing game. Though the racing game you'll probably have to fudge things to get the car physics to be just right. The wheels to turn just right, flipping if you go to fast over a bump, wheel and tire traction to make it appear as if the car is skidding. Definitely not something I would start out with as my first game especially on top of LWJGL. You might be able to do it with jMonkeyEngine but even then you need to know all the features a 3D engine provides in order to properly utilize them.

@Firestorm ZERO
My advice if you want to get something done and in a reasonable amount of time. Lets say a 2D Shooter. So you have a bunch of design options and some easily reachable requirements:

Requirements:
- 2D graphics
- PNG images w/transparency
- 16x16 image size
- 32x32 image size
- Sprite Sheets (for animation)
- Backgrounds ?x480 (if side scrolling) 640x? (if vertical scroller)
- Parallax Scrolling

Design Choices:
- Number of choosable ships
- Number of enemy ships
- Timed levels (or not)
- Scoring (points per kill/points per mission completed)
- Controls (movement, fire, switch weapons, special weapons)
- Multiple Weapons (or not)
- Gold per missions
- Warehouse if desired.

These I believe are reasonable for a first time project. Just remember that programming something you have never programmed before expect to add an additional hour for every hour you estimate it will take.

Technologies I suggest:

Java 2D (Golden-T Game Engine is ok) - yes I know you want something cool and spiffy and you want to add all those shader effects, but for a first project start simple.
java.net For the networking I suggest ironing out exactly what data absolutely needs to be sent across the connection, send only what is neccessary to those clients that need to know about it. There is a lot to making a game work across a network, latency, unexpected interruptions, security (encryption), packet loss, synchronization, message passing methods (pushing, polling), message queues, etc... So planning things out is key.

Thats really all you need and you won't have to work around compiling and running with added libraries and runtime-libraries which can be a pain if you've never used them before. That and you probably won't have to learn too much to get started on the programming since you said that you all have Java experience btw use swing.

Hope you take my advise, and good luck to you all!

Share this post


Link to post
Share on other sites
Quote:
Original post by 5MinuteGaming
Quote:
Original post by OrangyTang
If you're just starting then a networked shooter is probably not a good idea. Scrolling shooters like R-Type and Gradius require *exact* movement and collision detection, and typically are one-hit-kills. This makes them *very* hard to make work over the internet. It'd be harder than a typical FPS or racing game (which tend to do all sorts of fudges and faking), and most of the information on the 'net doesn't apply.

You'd be much better off making a scrolling shooter with only local multiplayer (ie. two people on one keyboard). You're more likely to finish something playable that way.

LWJGL (or Slick) is a good choice though.


I agree that a networked game for first timers is quiet a large challange but I will disagree that an FPS or Racing Game would be easier as those tend to be 3D and since you are suggesting they use LWJGL then I would highly advise against a 3D game. Mainly because you will have to make an engine on top of LWJGL that handles, rendering, device states, meshes, resource loading and caching, projections, tranformations, culling (most likely implementing an octree), animations, special effects and shaders (still have to do this with 2D), scene graph, and of course on top of all of this you will have to worry about the game play and gui interface. Then you also probably want networking for your FPS not so much for racing game. Though the racing game you'll probably have to fudge things to get the car physics to be just right. The wheels to turn just right, flipping if you go to fast over a bump, wheel and tire traction to make it appear as if the car is skidding. Definitely not something I would start out with as my first game especially on top of LWJGL. You might be able to do it with jMonkeyEngine but even then you need to know all the features a 3D engine provides in order to properly utilize them.

I'm not refering to the 3d aspect - obviously 3d is somewhat more tricky than 2d - I'm talking about the networking aspect. Networking in a fps is basically a solved problem - basic client-server architecture, with server doing all the authentication and client-side prediction methods. It might not be easy to program but theres *loads* of information about this on the internet.

Try using this approach for a scrolling shooter like Graidus and it'll fail miserably. The sheer number of bullets and enemies to dodge and the accuracy required means that regular prediction methods won't be accurate enough and you'll get lots of frustrating and unfair deaths. You'd need a hybrid system taking the best bits of client/server and distributed simulation to make it play well.

Share this post


Link to post
Share on other sites
Thank you for all the replies.

I have looked at Slick and seems it is better choice as the game is pretty much all 2D. Since it is built on LWJGL, I assume we can add in 3D if needed (but I don't think we will have time for that, and as well I am the only one with 3D experience).

5minuteGaming the specs you provided are pretty much exactly what we were initially planning.

As for the network, the teacher actually said our "game" would be too easy and told us to add networking to make it more of a "challenge". Even though we all thought making a complete game from start to finish (levels, ships, designs, etc) is already a lot of work. Well, it will currently be only played within a LAN (not through internet) so maybe we can get it to work.

Share this post


Link to post
Share on other sites
Hey,

@OrangyTang
Quote:
Original post by OrangyTang
I'm not refering to the 3d aspect - obviously 3d is somewhat more tricky than 2d - I'm talking about the networking aspect. Networking in a fps is basically a solved problem - basic client-server architecture, with server doing all the authentication and client-side prediction methods. It might not be easy to program but theres *loads* of information about this on the internet.

Try using this approach for a scrolling shooter like Graidus and it'll fail miserably. The sheer number of bullets and enemies to dodge and the accuracy required means that regular prediction methods won't be accurate enough and you'll get lots of frustrating and unfair deaths. You'd need a hybrid system taking the best bits of client/server and distributed simulation to make it play well.
Sorry for any little misinterpretation on my part! Just real quick, I'd like to say that I agree with you that there are many resources about FPS games and networking. And that integrating networking within a 2D shooter will be a challenge for FirestormZERO and team.

@FirestormZERO
Very cool! I'd be interested in knowing how things go with Slick as I haven't had the opportunity to use it. I'd like to know specifically how easy/hard integrating networking with Slick is since I've tried it for Golden-T and it was a nightmare.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this