Chunk Snapshot

Hey guys, not sure if this is the right place for this but here it goes:
I’m working on a tile engine, like 2d minecraft or whatever. I am organizing the blocks in chunks and draw a whole chunk if any of it is on-screen. If I am drawing like 20 chunks or something like that then its no problem (default zoom and screen size only 12 chunks MAX are drawn anyway). BUT, when the user zooms out and a few hundred chunks need being drawn with 256 blocks in each of them, it obviously drops the FPS quite significantly.

I was wondering if it would make any sense at all to take some sort of “chunk snapshot” where it does a one time thing and draws all the blocks in the chunk onto an image and every draw sequence after that just draws that image. I THINK this is a good idea, and I think I picked it up from somewhere else (I’m not that clever :P) but just in case I need some validation xD

IF this makes sense and would boost performance, how exactly could I go about doing this? (I’m using Slick2d BTW)
Thanks

EDIT: Also if It’s unclear what I’m asking just tell me :slight_smile:

Have you tested the performance or are you assuming something about the computer’s ability to draw pixelated blocks quickly?

You could use an image and draw that scaled depending on how much you’ve zoomed. You could also opt to draw only half or a quarter of the blocks when you’ve zoomed out.

Cheers :slight_smile:

Accidental medal, though somewhat deserved… xd

If you’re using Slick you should be able to set up a batch once and reuse it until the chunk changes. No idea exactly how to do that with slick though…

Probably because you aren’t using drawEmbedded:
http://slick.cokeandcode.com/wiki/doku.php?id=performance_memory_tips

Hey guys, sorry I haven’t replied, computer was brokededed… :o
Anyway thanks davedes, that helped alot :).