RTS like units formations movement/path behavior

Get help using Construct 2

Post » Mon Sep 29, 2014 3:00 pm

Hello,

do you know any approaches how to implement classical RTS unit movement/evading behavior? Without using A*star path finding, because it is slow as hell. Basically the unit should check his nearest surroundings and try to evade static objects, another units, moving enemies in the vicinity and constantly move to the target position.

Unfortunatelly push out solid is glitchy and units get stuck all the time and jump back and forth.

It's sort of flocking with evading behavior. I tried this plugin by rexrainbow https://www.scirra.com/forum/behavior-rex-ljpotential-attracting-or-rejecting-objects_t112786, but can't achieve it 100%.
B
45
S
11
G
4
Posts: 517
Reputation: 7,398

Post » Mon Sep 29, 2014 4:10 pm

B
45
S
11
G
4
Posts: 517
Reputation: 7,398

Post » Mon Sep 29, 2014 4:40 pm

I think ideally you should use 1 pathfinder, and use sin, cos to offset the other units.
I also think avoiding instances within the same unit would be taxing enough that avoiding instances in other units would probably get bogged down in javascript.
Image ImageImage
B
170
S
50
G
178
Posts: 8,378
Reputation: 112,925

Post » Mon Sep 29, 2014 7:47 pm

I think it could be described as crowd behavior. And I found this paper, it goes much into depth, but there's a section called collision avoidance, "math" part seems not to be so complex. In general, interesting read: http://www.math.u-psud.fr/~maury/paps/foules/a_model_of_human_crowd_behavior__group_i_378448.pdf
B
45
S
11
G
4
Posts: 517
Reputation: 7,398


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests