#### Archived

This topic is now archived and is closed to further replies.

This topic is 6188 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am working on a RTS project. In this game,what you can control is array, not a single unit like other RTS. Each array have a leader(general) and some members. First, I use the leader to find a probable path. But because array's size is larger than leader, if the array barely walk along this path, some members may collide the obstacle£¬and the array's formation will be corrupt. So the path should be adjusted to avoid the obstacle. Who can give me some suggestion about it? Thanks! Edited by - fonix on December 29, 2001 6:58:50 AM

##### Share on other sites
You can find an article on gamasutra about this written by the AI programmer for Age of Kings. It might be useful.

##### Share on other sites
TerranFury, you actually understand what that post is about?

Could you explain it to me?

##### Share on other sites
yah, he wants to have groups of units in formation...
you might be able to allow the formation to "smoosh" (for lack of a better word) together to fit through tight spots, then regroup afterwards.
if this is unacceptable, you''ll just have to take the size of the group into account when pathfinding.

--- krez (krezisback@aol.com)

##### Share on other sites
So,

array == formation ?

##### Share on other sites
Main Entry: array (noun)
1 a : a regular and imposing grouping or arrangement : ORDER (lined up ... in soldierly array -- Donald Barthelme)
2 a : CLOTHING, ATTIRE b : rich or beautiful apparel : FINERY
3 : a body of soldiers : MILITIA (the baron and his feudal array)
4 : an imposing group : large number (faced a whole array of problems)
5 a (1) : a number of mathematical elements arranged in rows and columns (2) : a data structure in which similar elements of data are arranged in a table b : a series of statistical data arranged in classes in order of magnitude
6 : a group of elements forming a complete unit (an antenna array)

--- krez (krezisback@aol.com)

##### Share on other sites
OMG, I have been programming waaaaaaayyyyy too long....

##### Share on other sites
Cheating off course. It looks ahead

-Maarten Leeuwrik
"Some people when faced with the end of a journey simply decide to begin anew I guess."

##### Share on other sites
There are 2 articles at Gamasutra, and they are very good (the second one is the sequel to the first).

For my RTS, I don''t actually need formations, and I don''t have huge maps either. So when doing group movement, after doing a few experiments with A*, I realised that it was a simpler method which could give the best results. I wrote a function which would make an influence map, which just told me the true distance from each tile on the map to a fixed point. This meant, that if I just continued to move to a square which was closer, I would get to the destination. All of this takes very little processing time once the influence map is formed, and surprisingly, the map only takes about 2 frames to produce (running at 60hz).

For areas where holding formation will not be possible, you might consider using this approach - the advantage is that all the units can use the same influence map since they are all going to the same point.

Trying is the first step towards failure.

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013378
×