Differences between Pick by Evaluate and Conditions

0 favourites
  • 3 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello, just a simple question :

    What is the difference between Pick by Evaluate and conditions, in terms of picking, system handling picking and performance ?

    Between something like this (in one event block) :

    - Object.var1=?

    - Object.var2=?

    - Object.var3=?

    - Object.var4=?

    And this :

    - Pick Object by evaluating (Object.var=?, Object.var2=?, Object.var3=?, Object.var4=?)

    Does the first iterates through all objects, check them for first condition, narrow the SOL to selected ones, start again and do the same for every conditions ? So it's multiple SOL and one condition check by object ?

    Does the second loop through all objects and check for every conditions and the return a final SOL ? So it's one SOL and multiple checks on every objects ?

    Second would be better in terms of performance ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes, doing a pick by evalue doing all the checks in condition using operators (Object.var=? | Object.var2=? | Object.var3=?| Object.var4=?)can be faster as the loop through the instances is only done once.

    But it only matters in extreme cases and can hurt readability imo.

    But yes I have used this optimization in my projects!

  • Thank you for your reply. Same about readability. After some tests it appears to be slightly faster than conditions, but as you said it only concerns extreme cases, like really intensive loops.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)