How do I optimize events ?

Get help using Construct 2

Post » Tue May 03, 2016 6:04 pm

If you have 3 events like this :
|Condition A
|Condition B
.........|Condition C : do this
...............................................
.........|Condition D : do that

Is it lighter than 2 events like this ?

|Condition A
|Condition B
|Condition C : do this

|Condition A
|Condition B
|Condition D : do that

or is it strictly the same ?
B
9
S
1
Posts: 60
Reputation: 611

Post » Tue May 03, 2016 6:11 pm

I would think it'd depend on how computationally heavy Condition A and B are.. in the second example, you're calculating it twice, whereas in the first example it is calculated once. I think the first example would be better.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Tue May 03, 2016 6:36 pm

Thank for your answer @Prominent,
So can I conclude from that point that it is genuinely better for optimization to have as much as possible conditions separated into their own events in order to compute them more logically ? It doesn't matter to have 50 events instead of 20 if it is to actually prevent calculating same things multiple times right
B
9
S
1
Posts: 60
Reputation: 611

Post » Tue May 03, 2016 8:13 pm

If I understand correctly, yes. Shouldn't matter the number of events. More importantly is how process-intensive those conditions are. If you can do something once instead of X number of times, it's better to do it once- unless you have a reason that it must do it multiple times.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Tue May 03, 2016 9:36 pm

ok thank you very much !
B
9
S
1
Posts: 60
Reputation: 611


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 33 guests