Overlays - How much is too much and how do we get around that? [Solved]

Started by ShiverMeSideways, Sun 23/10/2011 12:18:57

Previous topic - Next topic

ShiverMeSideways

Hello!

So, I've started working on something, and I'm displaying everything via Overlays, because they allow me to draw as well as remove sprites from the screen (while from what I gather, the "DrawSurface" functions do not).

However, I'm frequently running into the "too many overlays" error.

I have two questions:
* What is the max value of displayable overlays - what's the limit?
* Is there any way to make this limit bigger?

This is a major issue, because I want to base the entire game on the Overlays, to display monsters, power-ups, and bullets. If 15's the limit, then I might have a serious problem.

Thanks in advance! :)

Khris

Not sure about the max number of Overlays, but you need to ditch them right now anyway.

Games like these always use raw drawing; and while you can't remove a single object (not even move it), what you do instead is redraw the entire screen every frame.
(That's the same technique AGS uses to display the game screen, btw. And every other game out there.)

According to this: http://www.adventuregamestudio.co.uk/manual/System%20limits.htm the limit is 20 overlays.
IIRC, lucasarts speech and similar stuff is included in that number and will further decrease the limit at a given time.

Ghost

I remember bicilotti running into similar problems during Colourwise- maybe he's got a few tips into the right direction, too.

Wyz

Oh come on Dan, I've explained all this to you once. :P
Do what Khris says. :P
I usually take the background drawing surface, and for every frame  first draw the backdrop on it and then whatever sprite needs to be on it. If your drawing functions are fast enough it will look just fine.
Life is like an adventure without the pixel hunts.

ShiverMeSideways

Quote from: LeKhris on Sun 23/10/2011 12:37:58Not sure about the max number of Overlays, but you need to ditch them right now anyway.

Games like these always use raw drawing; and while you can't remove a single object (not even move it), what you do instead is redraw the entire screen every frame.
(That's the same technique AGS uses to display the game screen, btw. And every other game out there.)

According to this: http://www.adventuregamestudio.co.uk/manual/System%20limits.htm the limit is 20 overlays.
IIRC, lucasarts speech and similar stuff is included in that number and will further decrease the limit at a given time.

Yes, you're right!

Quote from: Wyz on Sun 23/10/2011 14:49:33Oh come on Dan, I've explained all this to you once. :P

I'm a thick-skulled poo-poo head, but you know this already :D

QuoteDo what Khris says. :P
I usually take the background drawing surface, and for every frame  first draw the backdrop on it and then whatever sprite needs to be on it. If your drawing functions are fast enough it will look just fine.

Ok, you're both right!

Indeed, I tried it this way and it worked. Why did I lose so many hours today trying to work with overlays when I can just do this? Well, the answer is written above...

Quote from: Ghost on Sun 23/10/2011 14:40:30I remember bicilotti running into similar problems during Colourwise- maybe he's got a few tips into the right direction, too.

I'll pester him if I need his help, thanks. :D


So, a huge thank you to you guys, you really helped me out, now it works, and, surprisingly, there's no lag, at least for now, when I have 50 billion things on the screen, we'll see ;D The problem is solved for now!

SMF spam blocked by CleanTalk