Performance optimization

Get help using Construct 2

Post » Sat Mar 17, 2012 6:06 pm


In my project I want my sprites to collide (never overlap) against others and for this I simply added the 8-dir behavior + solid to them, which works nice. Note that I don't use the steering feature of 8-dir just the built-in collision detection. The problem is that performance drops when +50 units are on the screen. So the question is, how could this be optimized.
I did a litte benchmark and it seems that when only using the "sprite collides with" event performance is stable (>30fps) up to at least 100 units (not perfect but better). However I don't really know how to use this sole event to implement a similar behavior as with 8-dir:
Objects collide and stop, if the other object gets out of the way they continue (this is easy to do),however with 8-dir there is a physics effect that the colliding objects seem to slide a bit when colliding which makes them eventually pass each other (this is the hard part).

Just to get a better picture: I want to create a topdown strategy game where units can be selected and moved, can collide but finally continue going to the desired place.

The "benchmark" project is here:

Posts: 34
Reputation: 4,954

Return to How do I....?

Who is online

Users browsing this forum: zenox98 and 3 guests