🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

FT #10: Force-Based Unit Movement

Started by
-1 comments, last by _Teran_ 21 years, 6 months ago
[ Force-Based Unit Movement ] No subject in AI has been explored more deeply than pathfinding. Yet, no aspect of game AI draws more complaints than pathfinding problems. AIex is constantly being stuck behind doors, stuck in lines, not to mention all other disasters that happen to those AIexes that are driven by pathfinder navigation code. Flies are another extreme, they don''t collide, they aren''t stuck, and they generally don''t look stupid (unless you face them with a window, unanticipated by their genes), but their perspective is excessively local: that''s why they cannot find an efficient way around the window. One solution lies in using the pathfinder merely as a guide, while a flocking-like collision avoidance model takes care of local movement and behavior. The pathfinder provides waypoints so that AIex can arrive to them in a mostly straight line. When the second waypoint becomes visible, AIex will check off the first one. In addition to the attraction force of the waypoint, other forces too attract AIex''s attention: safety of a ditch, desire to look backwards, desire to observe look dangerous areas, maintain proximity to his mates, and yes: an aggressive urge to approach his enemies and kill them. Higher layers of AI control the direction and strength of these forces. We will explain the concept on the example of formations. * Understanding Formations A commonly-bred AIex has eleven states in his high tech fuzzy finite state machine: `death-animation-1'', …, `death-animation-10'', and `kill''. Moreover, programmers worldwide think that formations are little pretty triangles. Right, triangles are pretty, and AIexes should always try to look pretty, but wedge formations aren''t used because wedges are pretty. Soldiers in a wedge formation are all able to fire at an enemy in front of them without having to fire through fellows, while half of them can fire in case of an attack from the side. When a flanking attack is expected, a column or step formations are used, which enables all the soldiers to fire in case of a flanking enemy attack. A diamond formation provides good coverage with half of the soldiers immediately effective regardless of the direction of enemy attack. Finally, a line formation is used during frontal assaults. The fundamentals of troop movement lie in assuring 360-degree visibility, ideally with some redundancy, maximizing the effectiveness upon an attack, and maintaining the cohesion and communication throughout the team. This is best achieved with a soft flocking-like model, locally maximizing effectiveness and visibility, while minimizing exposure. The states are not obsolete with this approach. The weights upon individual requirements are different in defense, attack, reconnaissance, retreat and maneuver.

This topic is closed to new replies.

Advertisement