Hello and welcome to my Cat Simulator project. I developed this simulation in Unity to explore a specific approach to artificial intelligence known as Utility-based Decision Making. The idea is simple yet fascinating: a virtual cat to act like a real one.
The main idea is to watch the AI deciding the next action based on the cat stats
Cats have a wide range of behaviors and needs, from eating and drinking to playing and sleeping. This provides an excellent test bed for exploring how well a utility-based AI can simulate complex, living beings.
Cats don't just act on a single need at a time; they evaluate their entire situation. This mirrors the complexities of utility-based AI, which also considers multiple variables to make decisions.
Cats are known for their unpredictable and sometimes quirky behavior, making them an ideal subject for demonstrating the capabilities and sometimes unpredictable outcomes of utility-based decision-making.
Last but not least, simulating a living being is a creative challenge that pushes the boundaries of AI, game design, and behavioral psychology. It provides an opportunity to experiment with more advanced AI techniques, including utility functions that might consider more complex emotional states, to get closer to simulating a living being.
For those unfamiliar with the concept, Utility-Based Decision Making is an AI technique where each possible action is assigned a utility score based on the current state of the agent—in this case, our cat. These utility scores are derived from a function that considers various properties of the agent. For our cat, these properties are Hunger, Thirst, Energy, and Fun.
So how does it work? Simple. When it's time for the cat to decide what to do next, the utility function crunches the numbers and assigns a utility score to each available action based on the cat's current stats. The AI then chooses the action with the highest utility score to execute. This means that if the cat is super thirsty, the utility function might favor actions like 'Drink Water,' causing the AI to make the cat head toward a water source.
What makes this approach particularly intriguing is its dynamic nature. The cat's needs are constantly changing, and the utility function adapts to these fluctuations in real-time. This results in a more natural and sometimes unpredictable behavior, closely resembling how real cats act. So, don't be surprised if our virtual kitty sometimes throws you a curveball!
The AI controlling the cat chooses actions based on these properties. Actions can either increase or decrease specific properties. This way, the AI makes decisions dynamically, simulating how a cat would naturally behave.
While this is just a prototype, the goal is to capture authentic cat behavior. If you observe closely, you'll notice that the cat behaves in ways reminiscent of a real cat. It's not always predictable; while you might guess its next move, ultimately the cat will decide.
The cat's movement in the simulation relies on Unity's Navigation Mesh (Nav Mesh) for pathfinding. The Nav Mesh allows the cat to intelligently navigate the environment, taking into account various obstacles and geometry to find the most efficient route to its target location.
Once the Utility-based decision making agent decides the next Action, a FSM inside of the Action is triggered and initialized
Each action that the cat can perform is implemented using a Finite State Machine (FSM). The FSM is responsible for managing transitions between different states associated with each action. The primary states are as follows:
This FSM-based approach provides a structured yet flexible framework for the AI, allowing for a diverse range of realistic and dynamic behaviors.
There's a limited range of interaction you can have with the cat. The main option available to you is to ask the cat direct the cat to a specified spot or to interact with some objects. This is a particularly interesting aspect of the simulation, as this action interrupts whatever the cat is currently doing (unless when you try to send the cat to an object with which it is currently interacting or similar to what it is interacting with). During this time, the stats will fluctuate, giving the cat an opportunity to make a new decision after completing the required action. This allows you to see the utility-based decision-making approach in action.
These quirks might be considered bugs, or perhaps they add an extra layer of realism, simulating the sometimes unpredictable nature of cats. Regardless, they are aspects of the current prototype that are under review.
The code is available on Github
Thank you for taking the time to check out my Cat Simulator. I hope you enjoy observing the AI in action as much as I enjoyed developing it.