[CLOSED] Make Sprites move to nearest imagepoint.

Get help using Construct 2

Post » Sun Jul 05, 2015 12:02 pm

lennaert wrote:
mindfaQ wrote:That depends really ... as the loop would merely consist of 1 for each going through the node sprites,

No idea how that pans out in performance with nested loops verses the pin node images ... would have to try.

But the approach ... is many times more easily to apply, with more variation options.

The way I see it with the nested loop you would only do the calculations of distance, while with the pinning, you would do the pinning (one time effort), but more importantly carry around those invisible objects for no (computational) reason.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sun Jul 05, 2015 4:20 pm

mindfaQ wrote:
lennaert wrote:
mindfaQ wrote:That depends really ... as the loop would merely consist of 1 for each going through the node sprites,

No idea how that pans out in performance with nested loops verses the pin node images ... would have to try.

But the approach ... is many times more easily to apply, with more variation options.

The way I see it with the nested loop you would only do the calculations of distance, while with the pinning, you would do the pinning (one time effort), but more importantly carry around those invisible objects for no (computational) reason.


Very true.

Implementation wise, I would guess the differ comes to how often it needed to be executed.

Every tick ... I'm thinking the pin wins if there are more then a hand full of swarms.
'
Every 0.5 sec, most likely the nested loop with more then a handfull of swarms. With drawback of jank like behavior. Which can be lerped out I guess ...
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 4:24 pm

Well for statements sake, i where hoping to do this swarming with roughly 100 units, but with even a low number as low as 20-30 it kinda chokes the lifeforce out of the game ^^ im thinking i gotta find a more effectiv way, preformance wise.
B
16
S
8
G
1
Posts: 154
Reputation: 2,556

Post » Sun Jul 05, 2015 4:31 pm

CrudeWall wrote:Well for statements sake, i where hoping to do this swarming with roughly 100 units, but with even a low number as low as 20-30 it kinda chokes the lifeforce out of the game ^^ im thinking i gotta find a more effectiv way, preformance wise.



For starters, I wouldnt want to have all 100 trying the same at the same time :)

give them some delays when they want to check, preferably randomly
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 4:36 pm

Oh ye learning curve :D but yeah that sounds like a logic conclusion. But guessing there is a bigger challenge, and that is to make them move as a unit, when connected. ^^
B
16
S
8
G
1
Posts: 154
Reputation: 2,556

Post » Sun Jul 05, 2015 4:52 pm

Just pin them to the swarmer your moving ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 5:19 pm

Well the problem is, that this is gonna be a race for themself, and will be "AI" controlled. I only set it up so i could move them myself for testing purpose.

But to cover some of the earlier statements from @mindfaQ - im not really well versed in programming. But im trying to learn ^^ good thing there is people willing to help out.

But i need to learn more before proceeding with this - I am gonna set the topic to "closed" for now.

Thank you for you time @lennaert @tunepunk @mindfaQ
B
16
S
8
G
1
Posts: 154
Reputation: 2,556

Previous

Return to How do I....?

Who is online

Users browsing this forum: boybacteria, dop2000, Google [Bot], Microbex, richcoz81 and 35 guests