Posts: 3822
Joined: 16 Sep 2007, 22:00
KaM Skill Level: Skilled
ICQ: 269127056
Website: http://lewin.hodgman.id.au
Yahoo Messenger: lewinlewinhodgman
Location: Australia
Dynamic group reordering
Thankfully there are mathematical solutions to solve this problem, the most notable of which is called The Hungarian Solution. It involves assigning a cost for each soldier to walk to each available position (the distance he has to walk), then trying to match the soldiers to the positions in such a way that the total cost is minimal.
I found a nice open source Hungarian algorithm written in C# and translated it to Pascal then made groups use it to reorder themselves before walking/rearranging. The results are quite impressive. It's hard to explain or show with images so I made a quick video:
http://www.youtube.com/watch?v=LqG5Tr2kz1c
What do you think?
Lewin.