Posts

Showing posts with the label CrowdBehavior

UnityLearn - AI For Beginners - Crowd Simulations - Flocking

May 22, 2020 AI For Beginners Crowd Simulations Part 3 Beginner Programming: Unity Game Dev Courses Unity Learn Course - AI For Beginners Intro This was by far the most interesting crowd simulation tutorial covered in the basic AI tutorials. This one really got into an actual rule based logic system for pathing of agents within a large group to move them in an interesting way with emergent behavior that is still controlled and possible to direct. Flocking Part 1 Flocking: simple rules to generate movement for groups of individuals to move towards common goals (i.e. birds or fish) They create a FlockManager because flock movement requires the individual agents to know about and understand they movement and positioning of all the other agents around them. This will be at a higher level providing data for an entire flock as a whole. This starts with logic to instantiate the flock by creating many fish prefabs in a randomized starting position bound around the FlockMa...

UnityLearn - AI For Beginners - Crowd Simulations - Fleeing

May 22, 2020 AI For Beginners Crowd Simulations Part 2 Beginner Programming: Unity Game Dev Courses Unity Learn Course - AI For Beginners Intro I was going to combine both of the end parts of the Crowd Simulation tutorial into one blog, but the Flocking tutorial was rather large and interesting so I decided to break it off into its own post. Because of that, this is a smaller one just focused on the basic fleeing crowd logic. Fleeing This is similar to the concept covered with single AI agents, it is just being applied to many agents here. An object is introduced to the environment and the fleeing agents determine the vector towards that object, and set a new course for the exact opposite of that vector. Key Parameters covered for their flee inducing object: Radius of Influence - how close agents must be to be affected by the object Cooldown - how long an agent flees before returning to standard behavior They decided to induce fleeing by adding a cylinder obje...

UnityLearn - AI For Beginners - Crowd Simulations - Moving As One & Creating A City Crowd

May 20, 2020 AI For Beginners Crowd Simulations Part 1 Beginner Programming: Unity Game Dev Courses Unity Learn Course - AI For Beginners Intro This is the first part of the Crowd Simulations section of the AI course that I covered. This was the first two major tutorials of four, Moving As One & Creating a City Crowd. These introduce the basic concepts of crowd simulations, and at least cover ways to start moving groups of agents with Nav Mesh Agents in Unity to help visualize these concepts (more so than particularly creating agent crowd AI behaviors yourself). 1: Moving As One Crowd Behavior: agents move enmasse, as opposed to solely as individual units; their movements are usually also dependent on each other's movements Reynold's Flocking Algorithm: Common flocking logic based on 3 simple rules: Turn towards average heading of group Turn towards average center of the group Avoid those around you They start with a really basic Nav Mesh setup...