The Event Loop of Life
Sit and watch how cruel the natural ecosystem is!!
Full screen to get the full experience.
Developed myself in Unity for the assignment of AI game programming course. Get inspired by using the Finite State Machine in Artificial Intelligence for Game Programming course. Get help from alumni in C# data structuring(class/inheritance/API/constructor etc.)
Game start point/ main(): Game Manager.
Grid:15*15(default), virtual/ initial tilemap, holding the layout and storing the position of each tile.
Tile: 15*15(default), attached to the grid, also the holder of the entities in tile.
TileManager: Different methods for calculating tile position, entities, etc.Mostly sensing logic. Agent/Entity: Grass/Sheep/Wolf agent, state starter.
StateManger: The actual “Update()”. State: Different states that holds Sense(),Decide(),Act().
-Grass:3 states, Grow, Mature, Wither. -Grow: Sense(): SenseMature(),SenseTrampled(). Decide(): if the grass is mature, Spread and go to StayMatureState. Act(): Grow(). -Mature: Sense():SenseWitherOrStayMature() Decide(): if the mature time is over, Wither. Act():StayMature(). -Wither: Sense():SenseTrampled()
Act():Wither(). -Sheep:4 states, Wander, Looking for Grass, Eat, Evade. -Wander: Sense():SenseGrassNearby(),SenseWolfNearby() Decide(): Flee or MovetoGrass. Act(): Randomly move around. -FindGrass: Sense():SenseGrassPosition(),SenseGrassNearby(),SenseWolfNearby(). Decide(): Flee or continue the move to grass or wander. Act():Move to grass. -Eat: Sense():SenseWolfNearby(),SenseIfGrassAlive() Decide(): Flee or wander. Act(): Enjoy the grass!!!! -Evade:
Sense():SenseWolfPostion()
Decide(): Still running away or wander. Act: RUN -Wolf:3 states, Wander, Looking for Sheep, Eat. -Wander: Sense():SenseSheepNearby() Decide(): MovetoSheep. Act(): Randomly move around. -FindSheep: Sense():SenseSheepPosition() Decide(): Continue the move to grass or wander. Act(): Move to sheep. -Eat: Sense():SenseIfSheepAlive()
Decide():Wander or not. Act: Enjoy the sheeppp!!! Sense Logic:
SenseGrass():Adjecent SenseWolf():Radius SenseWolfPosition():All vector
SenseSheep():Radius
Wander FindGrass EatGrass Evade
Wander Find Sheep EatSheep
Grow Mature Wither
Status | Released |
Platforms | HTML5 |
Author | Yin Liang |
Genre | Simulation |
Made with | Unity |
Tags | artificial-intelligence |
Leave a comment
Log in with itch.io to leave a comment.