Question on timers and the timers are for chumps method.

owen_dennisowen_dennis Just a guy, you know.Member, PRO Posts: 236

I've enjoyed a much speedier game with the alternate method but I have a question about it:

When I see it set up normally, there's an attribute that says something like time.attribute=0.05. Then the rule is set up like as a rule that looks at attributes:
When time.attribute > self.time%2
blah blah blah

When it seems like it would be faster to just have the rule set up as a numerical rule:
When 0.05 > self.time%2
blah blah blah

Is there a reason people are using the attribute version instead of just making it a numerical rule? Does an attribute rule work faster than a numerical rule or is all just down to personal preference?

Comments

  • supafly129supafly129 Member Posts: 454

    i forget but maybe numeric expressions weren't available when these optimizations tips were first created? im assuming thats why but i could be totally wrong

  • owen_dennisowen_dennis Just a guy, you know. Member, PRO Posts: 236

    @supafly129 said:
    i forget but maybe numeric expressions weren't available when these optimizations tips were first created? im assuming thats why but i could be totally wrong

    I thought I'd read something along those lines somewhere, but I wasn't entirely sure. I'd assumed I was wrong as numerical expressions seemed like something that had been around since the beginning.

  • tintrantintran Member Posts: 453

    my only thought is that by using time attribute it can be changed to another number and you wouldn't have to write another hardcoded expression.
    But there's nothing stopping you from using numerical expression and comparing attributes either.

  • SocksSocks London, UK.Member Posts: 12,822

    You are free to use numbers instead of attributes ( I often do just that ), but it can be easier to track and edit complex code if each value has a name.

  • ArmellineArmelline Member, PRO Posts: 5,421

    @supafly129 said:
    i forget but maybe numeric expressions weren't available when these optimizations tips were first created? im assuming thats why but i could be totally wrong

    This is exactly the reason. These tips pre-date numeric expressions, which are actually fairly recent.

Sign In or Register to comment.