Create a Boo Character with Unique AI Behaviors

Create a Boo Character with Unique AI Behaviors

Table of Contents

Introduction

Boo is one of the most iconic Ghost characters in the Mario franchise. Known for its shy personality, Boo adds an element of mystery to any Game. In this Tutorial, we will create a Boo model and add different AI behaviors to it. We will start by creating the Boo model and customizing its appearance. Then, we will add an AI to give Boo random movement when the person is not nearby. Finally, we will implement an AI to make Boo follow the person while also reacting to the person's gaze. Let's get started!

Creating a Boo Model

To create the Boo model, we will use a UFO model as the base. However, we need to make some adjustments to make it look like a ghost. Here's how you can create your own Boo model:

Removing Visible and Solid Properties

Since Boo is a ghost, we want it to be invisible and not solid. Remove the "visible" and "solid" properties from the UFO model to achieve this effect.

Adding Textures

To give Boo its ghostly appearance, we need to add textures. Use a white texture for the body and add two additional textures for the face: a normal face and a shy face. Connect the textures to the sphere model. Show the shy face when a warmhole exit labeled "s" sends a signal, and show the normal face otherwise.

Adding Random Movement AI

Next, let's add an AI to make Boo move randomly when the person is not nearby. We will use a combination of nodons to achieve this behavior.

Detecting Person's Proximity

To determine if the person is nearby, we will add a warmhole exit labeled "P" that sends a signal when the person is within a certain distance. We will use this signal to control Boo's movement.

Randomizing Boo's Movement

To give Boo a random movement pattern, we will use a timer nodon set to output every three seconds. Connect a random nodon to the timer nodon to generate random values between 0 and 360 degrees. Convert these values into positions using the angle-to-position nodon. Multiply the angle-to-position output with the NOT-P output to ensure the random movement only occurs when the person is not nearby.

Controlling the UFO's Movement

To control the UFO's movement based on the random values, use multiplication nodons to multiply the angle-to-position outputs with the NOT-P output. Connect these values to the UFO's forward/backward and left/right movements. Adjust the horizontal and vertical speeds to achieve the desired movement behavior.

Adding Follow AI

Now, let's make Boo follow the person when the person is nearby but stop when the person looks at Boo. We will add another AI behavior to achieve this.

Calculating Distance Between Person and Boo

To determine if the person is nearby, we need to calculate the distance between the person and Boo. Use location sensors to obtain the locations of both characters. Compute the square root of the sum of the squared differences in the x, y, and z coordinates to obtain the distance value.

Checking if Person Sees Boo

To check if the person sees Boo, add a touch sensor in front of the person. Connect the touch sensor to the person nodon and set it to detect only the UFO. If the UFO touches the touch sensor, it means the person can see Boo.

Making Boo Follow the Person

To make Boo follow the person, use an AND nodon to combine two conditions: (1) the person does not see Boo (use the NOT nodon with the touch sensor output) and (2) the person is nearby (use the P signal from the warmhole exit). Convert the x and z differences between the person and Boo's locations into directions using the position-to-angle nodon. Multiply the horizontal and vertical outputs with the AND output to control the UFO's left/right and forward/backward movements. Adjust the y-axis movement based on the y-difference between the person and Boo.

Adding the Shy Behavior

Lastly, let's make Boo display a shy behavior when the person sees it. We will use the warmhole exit labeled "s" to determine when Boo should be shy.

Determining When Boo Should Be Shy

Add a warmhole entrance labeled "s" and connect it to an AND nodon. The two conditions for Boo to be shy are: (1) the person is looking at Boo (use the touch sensor output) and (2) the person is nearby (use the P signal from the warmhole exit). Connect the output of the AND nodon to the shy face texture.

Conclusion

In this tutorial, we have created a Boo model with its own unique AI behaviors. We started by customizing the Boo model's appearance and adding textures. Then, we added an AI for random movement when the person is not nearby and another AI for following the person while reacting to the person's gaze. Finally, we implemented a shy behavior for Boo when the person sees it. You can further customize these behaviors and make your Boo even more eccentric. Have fun creating your own Boo character in your game!


FAQ:

Q: What is the iconic ghost figure in the Mario franchise? A: Boo is the iconic ghost figure in the Mario franchise.

Q: How can I make Boo move randomly? A: To make Boo move randomly, you can add a timer nodon and connect a random nodon to it to generate random values. Convert these values into positions using the angle-to-position nodon and control the UFO's movement using the outputs.

Q: How can I make Boo follow the person? A: To make Boo follow the person, you can calculate the distance between the person and Boo using location sensors. Use an AND nodon to combine conditions such as the person not seeing Boo and the person being nearby. Use position-to-angle nodons to convert the x and z differences into directions for the UFO's movement.

Q: How can I make Boo display a shy behavior? A: To make Boo display a shy behavior, use a touch sensor to check if the person sees Boo. Connect the touch sensor to an AND nodon along with the condition of the person being nearby. Use the output of the AND nodon to trigger the shy face texture display using the warmhole exit labeled "s".

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content