- There are only a few select cases where the game logic takes longer than rendering and determines the framerate. These cases are usually obvious and easy to optimise as well:
- Checking for collisions between too many objects. If you test for overlap between instances of an object with 100 instances, there are thousands of combinations of pairs of instances that Construct 2 has to check every tick, which can total over half a million collision checks per second. You can either check on a timer, e.g. every second instead of every tick, or simply reduce the object count again.
What are some faster alternatives to collision detection? Let's say I have an RTS type game where the player and dozens of NPCS can harvest from hundreds of nodes (trees and mines). Right now I use collision detection to determine when to initiate the harvesting function. I'm worried this will bog down the game when there are a lot more instances around. Checking for overlap every second seems like it might cause the objects to miss being detected. Maybe a smaller increment, like 0.5. That might not be enough to speed it up. Does the collision detection for the Solid behavior also have this limitation?
If the overlap timer doesn't work out, the only solution I can think of would be to break it up into smaller zones. Any other ideas out there?