[gameprogrammer] Re: Java Approach - Real-time or Turn-based strategy games...
- From: "Mike Gillissie" <Niyoto@xxxxxxxxxx>
- To: <gameprogrammer@xxxxxxxxxxxxx>
- Date: Sat, 3 Sep 2005 13:01:35 -0400
Nick Howes wrote,
Hi. Rendering onto buffers could give some speed benefit, for instance if
you render the background first to a separate screen-sized (or slightly
larger) buffer, it would speed up scrolling if you simply moved the buffer
a few pixels and only redrew the tiles that the scroll reveals. This ought
to be a bit quicker as a large blit is faster than doing many small blits
each time so the more you can pre-render the better.
I'm beefing up on my buffers right now - I'm learning all of this fun stuff
as I go along, so I think it takes me a bit longer than I was originally
expecting... ;)
I really like the idea of the larger buffer, though - I've already got the
thing rendering only the units that are within the current VisibleRect,
which saves time too...
Who knows, I may even be stressing myself out too much - the only time I'll
have to draw ALL units is if you were zoomed out all the way, in which case
I should be replacing the images with simple colour splotches - you're not
going to see any detail anyway, so I think something like an influence map
could avoid the problem altogether... :)
Also, as I was testing, I gave myself the worst-case scenario, just filling
a 20 x 20 section of the map with one unit per tile, which may not be a
common occurance once the game is actually working... :)
It does seem like you have a lot of objects on screen so it could be that
Java graphics isn't coping very well. In fact it might struggle even using
SDL, so perhaps LWJGL or JOGL would be useful especially as you then get
the hardware acceleration. I'd give the buffers a quick go first though,
see if that gives much improvement.
I've been reading up on hardware accelaration, and it sounds like something
I want to figure out, but I haven't gotten the knack for it yet - have to
read about it more...
Thanks for the VERY quick feedback, Nick! :)
-Mike
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
Other related posts: