[gameprogrammer] Re: Java Advice - 2D RTS Graphics

Mike Gillissie wrote:

> Because my background map is currently a single continuous image, I am
> currently redrawing the entire thing, then overlaying the VISIBLE units -
> I'm not sure how to move a unit from one position to the next without
> redrawing the background iamge, which overwrites the non-moving units as
> well as the moved units...

Are you doing any analysis of your memory usage, the impact of garbage
collection, or the rate at which you're creating new objects and letting
them fall out of scope?  Java makes it very easy to generate a lot of
memory churn, which taxes GC and in turn sucks CPU cycles away from
everything you're doing.  Performant Java requires about as much knowledge
of memory management in C, in my opinion.

Also, you are definitely using a slow, naive graphics strategy.  Using
OpenGL should net you serious gains, even with 2D, by letting you play
with the Z-buffer so that redrawing your map graphic doesn't draw over
your units.
-- 
 Matthew Weigel
 hacker
 unique@xxxxxxxxxxx


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: