Does amount of Events impact speed?

Post » Wed Apr 19, 2017 10:33 pm

Depending on the particular event, it can, or it might not. There is no solid answer. A single event running physics or pathfinding on a ton of objects may cause more impact than a thousand empty events.

That is why the best answer is to test it and see. If you can't benchmark/measure any significant difference, then it isn't worth worrying about.

If you want a straight answer, I'll give you an unofficial one - No, number of events or sub events does not impact speed. You're welcome to show me a specific case where it does, and I will say you're right, but most likely it is a case already covered in ... -your-time.

And if you don't trust Scirra for some reason here are other articles to read. It is common advice across all platforms.

Basically it comes down to this: If you can't tell for certain yourself if it makes a difference, and you are unable to create a situation where you are able to tell it does make a difference, and end up having to ask someone else if it does or not... then the information is of absolutely no practical use.

Edit: As for what really does matter, in terms of deciding how to organize your events, is readability and how the events fit together logically (your own logic). I might be able to combine 10 events down to 1, but it will take a lot of effort and if I need to change anything later it might be a pain. It might also be harder to remember what I was going for in the first place.
Mistakes were made.
Posts: 1,970
Reputation: 75,442

Post » Wed Apr 19, 2017 11:31 pm

Yes it does matter, if you're doing something like using the same conditions over and over.


Event 1 - Bullet is overlapping wall, turn on particle effect

Event 2 - Bullet is overlapping wall, play sound

Event 3 - Bullet is overlapping wall, destroy.

Doing something stupid as that is going to be 3 times heavier than just putting all the actions under the same condition. Above example will check overlap 3 times. Every time you use the same condition again it has to check for it again. So it's generally better to use less conditions like:

Event 1 Bullet is overlapping wall, turn on particle effect, play sound, destroy.

Much better than checking same conditions over and over, like above example.
Follow my progress on Twitter
or in this thread Archer Devlog
Posts: 1,140
Reputation: 14,822


Return to General Discussion

Who is online

Users browsing this forum: camboriu, MPPlantOfficial and 1 guest