Sunday, May 27, 2007

Formations!

The last few days I’ve been working on unit formations. When a group of soldiers is ordered to move, only the path of one leader is calculated. The other soldiers paths are derived from the leader’s path. This is much more efficient than having each soldier do pathfinding individually. This also allows soldiers to move in formation relative to the leader. For now I’ve implemented two kinds of formations, box and line. I’ve also added dynamic soldier speed. If some soldiers are far behind the group, they will move faster. The group will move a bit slower until the soldiers have caught up. Check out the video…