PDA

View Full Version : Efficient chunks



illspirit
07-06-2008, 02:53 PM
When working with big background tiles and such, is it better to fit them in a single map chunk where possible? Or does it really matter?

For example:

Right now, my background layers consist of a detailed 1024x512 set of trees up front, then two 512x256 images scaled by 2 for parallax behind them. These are "sitting" on 64px tall ground, which in turn makes them poke 64px up into the next chunk (see attached picture).

As such, would it be more efficient if everything was moved down so that the trees fit in a single "row" of chunks? Or would adding a third "row" for the ground tiles alone be worse? Bear in mind the empty space above the trees will probably have astronomical tiles at some point (along with an invisible ceiling), so they're not entirely wasted).

Seth
07-07-2008, 02:28 AM
It's true there is a very tiny performance hit when an object straddles multiple chunks but it's so insignificant that I think you can safely not worry about it.

Are you having any speed problems? Try disabling Video->Lock at refresh" and zooming out + cut and pasting a bunch to get a handle on how many objects on-screen are going to run smoothly.

illspirit
07-07-2008, 05:00 AM
Righto, thanks. I'm not having any framerate problems just yet. But it's probably a good idea to know these things before getting into some more complex map designs. After working with the GTA3 Trilogy engine for so long, my brain is stuck on thinking of its limitations.

But, yea, with the frame limiter turned off, it runs under normal conditions at 400-650 FPS in a 1280x720 window. Even with two dozen zombies moving around on screen it still only dips down into the 200 range. This is on the old Radeon 9800 Pro card, so it should probably be okay for most people.

Cobra
07-07-2008, 05:49 AM
Looks like you're making a really awesome game there, best of luck with it :)