Scott the poltergeist was a video game project in just 6 weeks! This project was in teams of three and my main responsibilities was programming and game/level design.
You play as a ghost named Scott whose job is to protect intruders from stealing his treasures that are spread around the mansion. Use the environment to fill up the intruders fear meter to scare them out! There are three type of props: Light, Sound and movement(Intruders faint if they see you possess a prop). Intruders have specific phobias that you can relate depending on their hat color. Use that to your advantage to survive as many nights possible and get the highest score possible.
Programming AI Logic:
Programming AI was a challenge for me since this was actually the first time coding a complex AI. All intruders in this game follow the same logic which is as follow:
- Pick a random room from the possible destination list(All rooms at the beginning)
- Once entered any room, the AI goes into the clearing state
- The AI moves to every clearing point in the room that is set by the level designer
- Once an AI reaches a clearing point he looks in the rotation of the point set and pauses there for a bit, to give the illusion that they are searching the room
- If treasure was found at the clearing point then the AI will steal it
- Once all points are cleared, the room is removed from the possible destination list
- Repeat step 1
Of course the point of the game is to scare the intruders away, so as a ghost you will be interrupting the AI logic above. The following are the AI reactions to different interruptions:
- Light: AI looks at the light that has been turned off for a while, trying to look at who turned off the lights
- Sound: AI gets scared of sound running away from the opposite direction of the sound source
- Movement: AI gets scared and faints to the ground for a duration of time
After interruption the AI returns to his normal routine.