Page 1 of 1

Unit Movement

Posted: 14 Apr 2011, 09:46
by Von66341
Hey!
I have been looking through the avaliable gadget and widget on unit movement and stuff.

However I not quite if it is possible to the following:

1. Say I have 5 soliders
2. When I give a move command on 1 solider, the rest of the solider will follow. Same with all the other commands, attack, guard etc etc.

Have anyone done or know any ways that this can be possible?

Another question:
If we have textured road in the map, will we be able to set units to move only on those roads?

Thanks!

Re: Unit Movement

Posted: 14 Apr 2011, 12:36
by Google_Frog
1. Say I have 5 soliders
2. When I give a move command on 1 solider, the rest of the solider will follow. Same with all the other commands, attack, guard etc etc.
Very possible. This can be done a few ways depending on exactly what you want.
If we have textured road in the map, will we be able to set units to move only on those roads?
Set where? Do you want the players to be able to tell units to stick to the roads or do you want to prevent all off road movement?

Preventing all movement is simple, use typemaps.

Toggling road using is harder, you could replace long move orders with ones that are going to follow the road. Maybe there is some solution to do with unit swapping and typemaps as well.

Re: Unit Movement

Posted: 14 Apr 2011, 15:17
by Pxtl
Simply by using a typemap to make road use substantially faster makes the pathfinder *heavily* encourage road use. See Beherith's older FFA maps to watch units swarm along the roadways.

Re: Unit Movement

Posted: 14 Apr 2011, 15:46
by smoth
*sighs* if it was only that simple "use typemaps"

Unit gets pushed into typemap: stuck
Unit slows down too slowly, goes into typemap: stuck

Typemaps are filled with all sorts of issues like this when you explore them

Re: Unit Movement

Posted: 14 Apr 2011, 17:45
by Von66341
Google_Frog mind sharing some ways I could explore on squad commands?

I am currently able to spawn my units in squad.
So for e.g. if I have 5 solider, the 5 solider will spawn together at game start.
Do I need to script a widget or gadget so they will move together and support each other in the battle.

It seem typemaps have it own set of problems.
Smoth care to elaborate more about the units into type map and gettting stuck?

Thanks!

Re: Unit Movement

Posted: 14 Apr 2011, 17:47
by Pxtl
smoth wrote:*sighs* if it was only that simple "use typemaps"

Unit gets pushed into typemap: stuck
Unit slows down too slowly, goes into typemap: stuck

Typemaps are filled with all sorts of issues like this when you explore them
Which is why a hard "can't move on terrain X" typemap is a bad idea without some Lua to force the unit back onto the road if they end up off it.

Really, most games suffer from this problem of units getting stuck on terrain they can't navigate, it's just a rare occaision without the typemap making the issue more common.

But either way, a soft limit of "unit moves really slow on typemap X" is a good solution.

Re: Unit Movement

Posted: 14 Apr 2011, 17:47
by SinbadEV
Von66341 wrote:Google_Frog mind sharing some ways I could explore on squad commands?

I am currently able to spawn my units in squad.
So for e.g. if I have 5 solider, the 5 solider will spawn together at game start.
Do I need to script a widget or gadget so they will move together and support each other in the battle.
Try out "GundamRTS" as it has squads that work as you've described them. I'm pretty sure all of the behaviour is in Lua scripts so you could poke at them and figure out how smoth accomplished it.

Re: Unit Movement

Posted: 14 Apr 2011, 18:21
by smoth
Kdr coded the thing btw I don't even remember what/if I did any time on it

Re: Unit Movement

Posted: 16 Apr 2011, 16:21
by Von66341
Thanks lots for the guidance! The scripts from gundam works well with slight modification. Thanks! =D

Re: Unit Movement

Posted: 16 Apr 2011, 18:40
by bobthedinosaur
Cuberor uses this.

Re: Unit Movement

Posted: 20 Apr 2011, 12:39
by Echo419
This squad thing, is it like AoE2 formations? or just a "move as group" sort of thing?

Re: Unit Movement

Posted: 27 Apr 2011, 02:43
by Von66341
Links to the orignal gadget that was used in gundam.
http://springrts.com/phpbb/viewtopic.ph ... &view=next