Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimized Surfaces
#2
A great tutorial. I can't act on it because my trusty computer died on me, but reading was good enough right now.

So, basically, you divide all output onto three divisions if you will. The bottom one is for ground (and mask) layers of the map, the middle is for players, items, NPCs, etc, and the top one is for fringe stuff, right? That way we only need to clear and blit the middle layer whenever something happens (player moves) instead of clearing and rebliting the stuff that doesn't change too.

If what I've said is true, the idea is great in itself. I had tried a method in which I only reblitted the few tiles with changes occurring, but this way is much better because you can ignore the map stuff and just blit the changes in the other stuff.

Yeah, I have scrolling in my game/engine/thingy, but this will still help when the player isn't moving or nothing is happening at all. The only thing I'm wondering about is the possibility of a check to see if any change is occurring on the middle buffer and only then blitting it to save FPS when nothing is happening at all. That'd be amazing if there was some way to compare the contents of two buffers to see if they are the same (middle buffer with the last frame's image and tempmiddle buffer with the current frame's ones). So long as you do save speed by not displaying the graphic at all (I'd assume so).

Oh, and I've already done that last little option for scrolling maps. I've programmed in seamless scrolling maps and it's vital that I don't print the 8 surrounding maps worth of data when I don't need to. It'll open some other people's eyes, though.


Actually, as a last thought, don't you think it would be better to give items and even animations their own layers? NPCs and players would be on the same layer of course, but items don't exactly move around that much and we wouldn't need to reblit them all the time. Animations need their own layer too because they would effectively require you to reblit stuff all the time even when it hasn't changed.

Anyway, great tutorial!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)