O Ilusionista
Captain 100K
Scrubbed by DC: My statement here was not correct, see below....
Damon Caskey oh thanks for the info.
Scrubbed by DC: My statement here was not correct, see below....
It's very good to know, thanks for the info.All that untrimmed transparent area is very CPU intensive
Very good, I'm trying to reduce memory/cpu consumption and your suggestion will help me a lot, I have a ton of non-trimmed images and I will revise all them. Thanks buddyDamon Caskey said:Kratus,
Pretty much any time an engine (not just OpenBOR) has to handle transparent pixels, it's more CPU intensive than opaque. This is why sprites are always trimmed so close. It's not something you should design your entire level around, but when there's an opportunity to shave something for free, then always do it.
Incorrect portion scrubbed by DC: See correction in discussion below.
That said, if I were really trying to wring every last drop of performance out, I'd probably break everything down like this:
![]()
![]()
![]()
![]()
![]()
Then put them all back as independent layers. You lose some CPU for the layers, but get it right back and a little extra by taking out all that transparent area. Bonus, the memory footprint drops from ~65KB to ~7KB. Double bonus, now you can tinker with the scroll rates to give your level much more depth. I was going to suggest you at least made the parked cars a layer before you asked your question.
DC
Yeah, it's true. A trick that 's helping me to reduce the impact on the performance is by breaking the script in small parts and running only the necessary at each step.More wasteful things are updatescripts that check too many things at once
Thanks, it's a good idea. It's possible to mix yours and DC suggestion, separating the level objects in different layers but using the total level size (or a bit smaller) for all, and let the engine auto trimm all of them instead of doing it manually (once he confirmed that the engine will auto trimm layers on load).In OpenBOR terms, it would be something like having all fglayers at the same position - with each part on a different image - and let the engine trim it.
So you won't need to care about the axis position, just the Z.