Question about array path-finding
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
God create us-We create game
You can find an article on gamasutra about this written by the AI programmer for Age of Kings. It might be useful.
TerranFury, you actually understand what that post is about?
Could you explain it to me?
Could you explain it to me?
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)
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)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
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)
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)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
i wonder if array formation is cheating or non-cheating ai, i wonder what the academics would have to say about this..
--bart
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."
-Maarten Leeuwrik
"Some people when faced with the end of a journey simply decide to begin anew I guess."
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.
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.
Trying is the first step towards failure.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement