How do I pin stuff

Get help using Construct 2

Post » Thu Apr 09, 2015 6:46 pm

this is not really a "how do i", more like "is it better if"..

so i have a boat, and boatFoam particles. these particles are created under boat and they have some time to expire, pretty short, but when boat moves it looks like foam behind it.

now i've done this in this particular way - create a particle on 0,0 + event that does this: each 0.2 sec (way less then each tick (around 12 times)) - particles set position to
enemies (family) on imagepointx (0) imagepointy (0), and set angle to some angle.

now my question is - is this more performance friendly then pining the item by position only to the boat ? also there is no loss in visual quality when i tried pinning / this method but i think i've gained some performance (though the game runs stable 75fps on my machine all the time in browser). am i correct?
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
39
S
14
G
12
Posts: 617
Reputation: 9,297

Post » Thu Apr 09, 2015 7:07 pm

My advice would be to test the 2 ways and check the debug view for any performance changes.

But it sounds like it would be more cpu consuming to create a new object all the time than having the same particle object pinned.
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Thu Apr 09, 2015 7:22 pm

tested it - seems like pin vs set position every 0.2 makes no difference. i even got it to the point where pin works actually better then
pure setting xy.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
39
S
14
G
12
Posts: 617
Reputation: 9,297

Post » Thu Apr 09, 2015 7:26 pm

here's the link - http://www.filedropper.com/test_14

tested with 2x sprite and sprite + particle. 1000 10000 and 5000 objects.

if someone wants to test - use current test vs this one: - add every 0.2 sec - set ps position to tes1.x and test1.y and remove pin behav from ps
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
39
S
14
G
12
Posts: 617
Reputation: 9,297


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, drexegar, LaroTaio, Phacanu and 7 guests