Jump to content
  • Advertisement
Sign in to follow this  
Zaxx

[java] Limits of AWT/Java2D for graphics

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So far I've been using Java2D (Java 1.5) for the graphics of this game I've been working on. Before I continue along, I just want to check what my limits possibly are. Could AWT/Java2D to do this? Feedback would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
the rotating dials for the score counter will be difficult, but doable.

the background is difficult to tell what is going on. If those squares are dynamic and moving, that will be a major slowdown. I don't think Java2D could handle that overhead. It can do alpha blending, but it's not accelerated in anyway, it'll be slow. If it's a static background, OTOH, it will be fine.

Other than those concerns, Java2D should handle it fine.

Share this post


Link to post
Share on other sites
Woot, Gunroar.

I started with AWT/Java2D back in 1.4.2 and I came to the conclution that it was too slow to do anything like that. Things have changed since then- with 1.5's OpenGL pipeline and other optimizations. However, I've yet to see anything in Java2D come close to the level of speed shown in something like Gunroar. Not to say it isn't possible, just that you'll be pioneering new territory if it is.

Gunroar was done in D using SDL. So I'd imagine you'd need to use LWJGL or JOGL to achieve anything comparable.

Something you might find interesting: Gunroar and a lot of other indie-Japanese shooters use a markup language called BulletML to generate their bullet effects. BulletML and Gunroar were actually written by the same person/people!

BulletML is here:
http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html

I've got BulletML running in LWJGL using the XML reader Kenta Cho has in his demo applet. I can fill the whole screen with bullets and other quads like your screenshot with no slowdown. So, it's possible with Java, but not necessarily with Java2D.

Share this post


Link to post
Share on other sites
I'm not too worried about the rotating dial or the BulletML; mostly about the flashy vector graphics in general. Something along the lines of anything by Kenta Cho, Area 2048, or Gate 88.

I would certainly like a dynamic background. Thanks for the heads up capn_midnight on Java2D's possible performance.

I get the impression from the two posts above that the major issue with Java2D is speed, it can possibly draw those graphics but there'll be major slowdown. It might not be that much of a problem for me though since my game isn't as fast paced as Gunroar; my game will be a bit more like Area 2048 and probably won't have tons of bullets in the air (well, maybe except for bosses).

I'll probably want to pick up JOGL or LWJGL anyway, so I'll look into those.

If it helps, this is what my game actually looks like right now, though it's not really a game yet but more of an engine test.

Share this post


Link to post
Share on other sites
Gunroar relies heavily on the kind of hardware acceleration that isn't readily available in Java2D. Certain bits work fast, on certain configurations, but the API is largely designed for ease-of-use, robustness and correct output, and if any one of a number of tiny things deviates from the general use case, it reverts to software rendering (and indeed, on the Mac, that's all you'll get at ALL). So no, Java2D can't do this - or it can do it, but probably at 5fps.

Cas :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Zaxx
I'm not too worried about the rotating dial or the BulletML; mostly about the flashy vector graphics in general. Something along the lines of anything by Kenta Cho, Area 2048, or Gate 88.

I would certainly like a dynamic background. Thanks for the heads up capn_midnight on Java2D's possible performance.

I get the impression from the two posts above that the major issue with Java2D is speed, it can possibly draw those graphics but there'll be major slowdown. It might not be that much of a problem for me though since my game isn't as fast paced as Gunroar; my game will be a bit more like Area 2048 and probably won't have tons of bullets in the air (well, maybe except for bosses).

I'll probably want to pick up JOGL or LWJGL anyway, so I'll look into those.

If it helps, this is what my game actually looks like right now, though it's not really a game yet but more of an engine test.

I just checked out gunroar. The background IS dyanamic, the squares do appear to be rendered individually, but this isn't necessarilly a problem. The effect is so subtle that you could use two or three large PNG files as layers of multiple rectangles, with some paralax scrolling between them. It should be able to pull this off pretty well.

Java2D is pretty light when it comes to rendering power, but don't underestimate it. Sometimes you just have to give it a try and see what happens. This stuff in my screenshots is pretty heavy stuff. The first image is a few dozen line segments, the second is a few hundred, each requiring a change in stroke value in between.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!