Mouse in the House is a 3D stealth game produced with Unity. Play as a mouse in search for cheese in order to feed your colony, but beware! Michelle the Human is on the lookout for you! Hide behind the gadgets and knick-knacks of her kitchen to evade her scary punishment.
This is a collaboration project for which I helped with the design and had the role of AI programmer.
Creation Process
My first challenge was to design a path system that would allow the level designer to add his own waypoints around the level, wherever he wanted them. From that, he could then create multiple paths, each containing their own set of waypoints. Finally, he could then define zones in the level that would get activated when the player enters them and set a specific path for Michelle to use. This would help balancing the difficulty of the game based on each zone: Michelle could spend more or less time around the zones and waypoints selected when the player was near them.
Path system in the inspector
Path system in the inspector
Bird's eye view of the zones in green outline
Bird's eye view of the zones in green outline
Michelle's FSM diagram
Michelle's FSM diagram
I then programmed Michelle using Finite State Machines. I first had to define the states Michelle would use, such as Idle, Patrol, Persue and Attack. Defining the conditions of the state changes and getting familiar with the FSM model was confusing at times, since it was my first time using them. The Walk state in particular was a challenge because I had to account for the different paths and waypoints she could take, and the Idle state randomizes between two animations, Stand and Look Around.
The third challenge on my list was the AI's field of view. Its biggest constraint was that it had to work on the floor, but also on higher grounds because the player would spend a lot of time on counters. It also had to detect all the props in the level to be able to hide behind them. 
I first tried coding one from scratch and projecting it on the floor but the projection wouldn't show up on the counters. I realized I would have to code something much more complicated in order for it to work as intended.
So instead, I used a much more simple approach and set up a light attached to Michelle. This allowed me to change its colour more easily, position it at eye level of Michelle, and it would show up properly on all surfaces of the level. Because is it a light, it also means that it leaves shadows behind props, letting the player know that those spots are safe to hide.
I also used a ray cast to define with precision the distance and height at which Michelle could detect the mouse, which had to match the distance of the light.
Field of view - Mouse is detected
Field of view - Mouse is detected
Field of view on counter
Field of view on counter
Field of view on ground
Field of view on ground
Field of view - Michelle will attack
Field of view - Michelle will attack
To make the debugging phase easier and help my teammates list all the bugs in the game, I created a repertoire of bugs and suggestions for improvements. It allowed everyone to see which ones were already found, fixed or assigned to someone. They could include a screenshot to show exactly where the bug occurred, and its potential solutions. This would make it easier for the person who would pick up the bug to understand it quickly and look at it straight to the source.
Teammates
Hubert Lefebvre-Marcotte - Level & UI designer
Pierre-Olivier Kuyi - Sound & UI designer
Ariane Laferrière-Martineau - Gameplay Programmer
Shany Maltais - Mouse artist & animator
Back to Top