[gameprogrammer] Re: Java Approach - Real-time or Turn-based strategy games...

  • From: Nick Howes <nickhowes@xxxxxxxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sat, 03 Sep 2005 17:44:49 +0100

Mike Gillissie wrote:

Hi guys,
So far it's going well, but as a test I've loaded about 200 or so units onto the screen, and the process of scrolling the map becomes painful with that many units being drawn. I was playing around with a few other ideas, mostly with off-screen buffering, and I think I'm missing something fundamental.

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've been looking at examples from OpenGL and LWJGL, but I'm not sure if I'm just not getting something that would make my life easier... :)

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.



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


Other related posts: