Food Snatchers

A Programming elective project at Hanze University of Applied Sciences, The Netherlands

The requirement of this course was to work with a 5 member team of programmers and create a game where the player is only a spectator of 5 AI battling with each other.

Another requirement was after establishing the game genre, to split into creating our own individual AI player, with specific abilities, and unique interaction behaviors.

Tools:

Unity Engine, C#, Hack’n’Plan, GitHub

Roles:

Product Owner, Lead Developer

Team Size:

5 members

Responsibilities:

Product Owner & Lead Developer

  • Team Management

  • Set Up starting tasks

  • GitHub source control

  • Mentoring other team members

  • Oversight: Individual AI balance, Group files merge, Development plan

  • Setting up the parent script of AI_Player script

Developer

My AI:

  • AI Bot StateMachine

  • AI Bot States & logic: Movement, Fleeing from enemies, Stealing from enemies

  • AI Bot VFX, SFX, Animation


Description

Food Snatchers is a time-based arena where the AI is supposed to gather food as much as possible. The win condition is dependent on the score that the AI has, which is achieved by gathering or snatching the food from other players, where the name of the game comes from. AI’s use the same base script, which every developer inherits, and then can decide if they want to edit the parent script from their child scripts. Each AI starts with a score counter of 0 and equal move speed. However, every AI has its own unique ability, which it can use to protect itself or to engage with others better.


My AI Character

My AI has its own characteristics. It is mostly the type of pacifist. It wants to gather the closest food and simply keep out of trouble by checking if there are no enemies next to its targeted food. Therefore it has the ability to go invisible to safely collect food or flea from close enemies to avoid being stolen from. However, the pacifist personality is not constant. After engaging an opponent multiple times it decides to switch its personality to 180 degrees and use the benefit of invisibility to try and snatch food from its opponents, but only temporarily, after successfully snatching from another AI, it calms down and begins to evade enemies once more.

Also due to developing Melayu for another course in the meantime, I used the model of the main character for Food Snatchers to add a bit of life and animation, instead of a capsule character.

Movement

A simple script of changing the target move position of the character on the NavMesh to the closest food.

Ignoring Unreachable Food

To be safe from losing the food score and preserve time the AI checks for enemy characters around the food. Depending if the there is an enemy player next to it, the AI ignores it and goes for another closest safe food position.

Invisibility

My AI character's special ability is going invisible and untouchable by the enemy players, which allows it to safely bypass enemies while focusing on collecting food in a dangerous area.

Snatching/Stealing Food

While being invisible, if my AI passes by opponents he can steal food from them, which would decrease their score. Additionally to make my AI target enemies specifically for stealing, it requires to go invisible 3 consecutive times to get angry and target enemies, but only when invisible.

Fleeing

When the enemies target my AI to steal food from, it goes invisible and ”untargetable”. However, if it is on cooldown, my character tries to run away from them, until the ability goes off cooldown.

Development Conclusion

This project was a good learning practice experience for using AI state machine and script inheritance and getting better at it. Additionally adding it to an artificial intelligence character and creating interaction logic with other different AI players.

There were challenges during the development of this project, for example, I had more experience in the unity engine and coding than other team members. However, having the lead developer role let me at some points mentor my teammates and oversee the tasks for our game to work properly and allows us to transition to working on our individual character AIs.