Sign in to follow this  
WiseTree

Java and graphics APIs

Recommended Posts

WiseTree    115

Hello,


In recent past I've been working on a game engine for actionscript 3. I was doing it in as3 because it's portable, I quite liked the graphics APIs and everything seemed quite natural for me there. Recently I lost all of my work and I'm thinking about rebooting my project in Java.

Now the reasons are:

 

1. I'm a uni student and I just had a year-long project, which was written in java. So I think I'm reasonably good with the language (especially since I was taught of things about it in the uni, so I'm aware of some subtleties, etc.). 

2. It fits my game design slightly better than as3 (since I'm thinking of possible controller support).
3. It's more efficient. The more I looked into graphics performance in as3 the more I realised that if I want to have good performance with a lot of particles, as3 might not be a good choice.

I had a graphics and vision course lately and I want to play around with direct pixel manipulation as well (for prettyness!). Since as3 doesn't support GPU acceleration (I think ohmy.png), it would slow down my engine even more.

So finally to the question: how good are java APIs when it comes to graphics? (e.g. AS3 had a built-in method for hit testing for bitmaps, does java have anything of the sorts?)

How good is java when it comes to 3D?
Share your experiences with java and graphics.



Thanks in advance!

 

Share this post


Link to post
Share on other sites
Glass_Knife    8636

Java 2D out of the box is a good API, but will not have the things you need for game programming.  It is lacking input and sound.  As for 3D, you can use JOGL with OpenGL, but I would suggest using a 3d party library.

 

http://www.slick2d.org/

http://www.lwjgl.org/

http://libgdx.badlogicgames.com/

 

Depending on your requirements, one of the above libraries should suit you just fine.

Share this post


Link to post
Share on other sites
WiseTree    115

What exactly does the default lack in terms of game programming? Is it just input and sound? Since essentially for me this is just learning experience - I don't want to just make a game, I want to make it learning as much as I can, so maybe I can try to program it myself and see how that would work.

Share this post


Link to post
Share on other sites
3Ddreamer    3826

Hi,

 

Java APIs have been used to create world-class games and simulations.   The graphics area where you have a question is one of the strong areas of this development.  In my opinion it often results in a perfect match of performance and quality graphics.   The shadows, anti-aliasing, shading, bump-mapping, sounds, collision detection, damage model, and input configuration are all strong areas.  It tends to lend itself well to realism and departing from fantasy environments, but I have seen some fabulous fantasy games made in this genre.  Cross-platform, OS and hardware, is built into them which is another consideration for some developers.

 

About image file formats, bitmaps are a good choice when performance is not an issue, but otherwise with performance critical games then JPEG would be a better choice.  Lossless images add to a big demand in performance in scenes where there are many of them.  For performance demands, then also include shading and in particular bump-mapping. 

 

A good Java API will make all of these choices available to you.  Third party libraries with well designed editors are another matter for choosing an API, such as terrain editors.

Edited by 3Ddreamer

Share this post


Link to post
Share on other sites
Aldacron    4544

Java2D has a number of issues for game development that you can read more about in the javagaming.org forums if you really want ot. Slick2D was the go-to library for a while in the world of 2D Java game dev, but it isn't anymore. libgdx is where all the action is. It's a brilliant library that allows you to get your game on a number of platforms that pure Java doesn't. Plus, it uses the modern programmable pipeline of OpenGL under the hood. The guy who developed Slick2D is making his newest game with libgdx.

If I were starting from scratch right now with a 2D Java game, libgdx would be a no-brainer.

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