AI ECS Usage algorithm


First the terrain's heightmap gets converted into a big PhysicsCollider for DOTS physics. Then to spawn a monkey, a capsule prefab gets instanced and it's main texture replaced with a random jpeg before conversion into a monkey entity. Then I use ECS to update a flow field towards the player which then goes through all monkeys and sets the direction to go for every monkey. The monkey also keeps a dynamic buffer of neighbors, and both are used to create a steering direction. The monkeys get a impulse towards that steering direction while it's touching the ground. bullets from the gun are cloned from a entity prefab and just has its position and PhysicsVelocity.linear set to make it shoot. Monkeys are dead when their velocity exceeds some big number. The player, sound emitters, particle effects, and nft pickups are all gameobjects only.

Get Enter the glockchain

Leave a comment

Log in with itch.io to leave a comment.