I'm working on a platformer style game where a lot of the tiles that the player and enemies walk on are Active Objects (Blocks).
The blocks are of a certain size so that about 250 to 450 can be on screen at once. When there are many of these "Active Blocks" on screen the game lags severely (minus 20 FPS!) when scrolling.
If I open the block's properties and set "Inactive if far from Window" to "YES" the frame rate is restored to its maximum of about 58-60 FPS (set at 60). Everything looks good.
But, now the enemies that are off screen fall through the blocks, but NOT the background obstacles. Its as if "Inactive" state just disables object collisions, but continues through its normal event loops.
To clarify, my game uses an event-based platform movement, not the built in movement. But when an object goes off screen and becomes "Inactive" it continues to fall through other Active objects that it should register a collision.
If the object becomes "Inactive" shouldn't it NOT move at all? If it disables collisions, why would it still run through its events that check for collisions? What exactly does "Inactive" mean if the object still calculates all its alterable values and movement events? Does it JUST disable collisions and animations?
Also, is there a way to set the distance that the objects become "Inactive" at? I want some object interaction to occur outside the window, but only to about a screen's width away. The default property seems to "Inactivate" objects about 20 pixels away from the screen edge, which is a very short distance.
Any event based work around to the above wouldn't fix the Frame Rate issue, and would only further strain the game's speed. I've ticked "Load on Call" and set "Maximum objects" to "20000" and can't think of what else I could do to increase frame rate.










Reply With Quote
It totally censors them out of the event loop like a cuss word.

