Java and graphics APIs

Started by
8 comments, last by 3Ddreamer 10 years, 11 months ago

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!

Advertisement

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.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

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.

If you want to do the input and sound yourself, check out

http://jogamp.org/jogl/www/ - OpenGL for graphics

http://jogamp.org/joal/www/ - OpenAL for Sound

https://java.net/projects/jinput - JInput for Input

This is what LWJGL is doing behind the scenes if you wanted to learn it all yourself.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

That's very helpful, thanks!

Slick2d/LWJGL is a good option.

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.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

By the way, take a look at jMonkey:

http://jmonkeyengine.com/

http://jmonkeyengine.com/showcase/

If you look at all the variety of games being made, then you see that almost anything is possible.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

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.

Community support for the beginner may be more important than the game engine itself.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

This topic is closed to new replies.

Advertisement