0 Favourites

Compare age?

This forum is currently in read-only mode.
  • Comparing the age of a sprite would be a useful feature, and i know mmf keeps age stored, so i assume construct does this 2?, it would be usefull to have a compare age feature so we could lets say make a for each ordered by their ages, if you needed something along that lines it would be nice 2 have. all its doing is storing and comparing the order they were created, not how long theyve existed btw.

  • Create private Variable to "Sprite.UID" and then use event "Pick with lowest Variable". Remember to use "For each" event to set up the UID.

    If you want to pick the younger use "highest".

  • Managing object's age can be done by one event (PV "age" -> add to value -> timedelta). ActionsConditionsExpressions shouldn't be filled with unnecessary entries.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Managing object's age can be done by one event (PV "age" -> add to value -> timedelta). ActionsConditionsExpressions shouldn't be filled with unnecessary entries.

    Ummmm timedelta is not changing untill the FPS are changed. Soo you meant "TickCount" or "Timer"?

  • > Managing object's age can be done by one event (PV "age" -> add to value -> timedelta). ActionsConditionsExpressions shouldn't be filled with unnecessary entries.

    >

    Ummmm timedelta is not changing untill the FPS are changed. Soo you meant "TickCount" or "Timer"?

    Not if you're adding timedelta

    But yeah, there are lots of ways you can measure the age of objects, and it's relatively easy to do. I'm not sure there would be any need for a built-in age timer.

  • Not if you're adding timedelta

    But yeah, there are lots of ways you can measure the age of objects, and it's relatively easy to do. I'm not sure there would be any need for a built-in age timer.

    Oooooooooh adding... But why the hell add? Too many actions... it will be not good to add to every object time delta... why not just Timer (once) so when you have 500 objects CPU wont have to add 500 times per tick!

  • Addition is hardly an expensive CPU operation... I wouldn't worry about that! Storing the creation time is another perfectly good way of doing it - whichever is easiest, really.

  • I've made an performance tests for intensive Private Variable modifying.

    http://www.scirra.com/phpBB3/viewtopic.php?f=16&t=1768

    I'll research "onCreate -> set to timer" method to compare which one is faster and under what circumstances.

    Edit:

    Added (in thread above).

  • Addition is hardly an expensive CPU operation... I wouldn't worry about that! Storing the creation time is another perfectly good way of doing it - whichever is easiest, really.

    But nonstop adding to value is likely not needed... dont be like guys that made Crysis .

    Ps. I saw that .cap in other Topic (handlingPV) and i have ~35fps. And the other is at constant ~75 (max).

  • i knew i could do it with UID, thats what i thought could work, and i dont need to know its true age, thats why an everytick adder wouldnt be good, and it seems like a waste. i use those when i need to time how long a missile can stay alive and stuff like that

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