top of page

THE A.I. BEHIND THE CHARACTERS

Standard A.I. Wait Times (Wario, Waluigi, Luigi)

How long does each character take to move exactly? How does A.I. play into their wait time mathematically?

Wario, Waluigi, and Luigi all function under a standard A.I. equation that has different values for each character, but the general idea is the same:

Wario moves to a different location every " Random(25, 30) - Wario AI" seconds.

Waluigi moves to a different location every " Random(25, 28) - Waluigi AI" seconds.

Luigi moves to a different location every " Random(23, 29) - Luigi AI" seconds.

This is how long they wait to make their move. The amount of seconds they wait, as you can guess, is dependent on the A.I. value plugged into the equation.

For example, let's say Wario's A.I. is 5.

If we plug in 5 as Wario's AI into Wario's wait equation, we get "Random (25,30) - 5" seconds, meaning Wario will move after a number between 20 and 25 seconds, as 5 has been subtracted from 25 and 30.

This is how each character moves faster as the AI value increases, because the higher it is, the larger difference it makes to the equation when subtracted.

If Wario's A.I. is set to a max difficulty of 20, the equation will read "Random (25,30) - 20", which means Wario is incredibly fast, taking a number between 5 and 10 seconds to move.

This logic also applies to Waluigi and Luigi, but they both have different values in the Random parenthesis to de-synchronize their movements.
 

unused8.png

Standard A.I. Movements (Wario, Waluigi, Luigi)

What happens when their wait time goes down to zero? They move, obviously. But what does that mean?

When a movement occurs, tons of different values change: the "Decision" value, the "Pose Set" value, and the "Noises" value.

"Decision" is the most important, as this is the value that tells them where to go when they move. They choose to either move forward or go back one room in their path (see Standard A.I. Paths).

When moving, the "Decision" value picks a random number between 1 and 4 (1 and 7 for Night 4 and above, including custom nights).

If this randomization picks the number 3, the character moves backward one room. Otherwise, the character will move forward 1 room in their path.

"Pose Set" simply changes between 1 and 2 when a character moves. All this value does is change the set of poses the characters use on camera.

"Noises" picks a random value between 1 and 10 when characters move, if they land on specific numbers (the numbers depend on the character), they will play footstep or door noises.
 

Standard A.I. Paths

(Wario, Waluigi, Luigi)

Each standard character (Wario, Waluigi, and Luigi) have a path, or sequence of numbers, they follow to enter your office. These paths are controlled by two values: "Location" and "Room Location".

"Location" is what number of the sequence the character is on. For example, Wario's path to the office is this:

0 > 1 > 2 > 3 > 4 > 5 (Office door)

Wario's "Location" starts at 0, meaning he is outside the factory, and not visible in the cameras. When he gets a movement opportunity, he either moves forward one number in the sequence, or moves backwards one number (unless he's already outside the factory). If he reaches to 5 on the sequence, he attacks. Movement code no longer applies when he reaches 5.

"Room Location" translates the Location value (the number in the sequence) to a corresponding camera on the map as a value.

 

For example, Wario enters the Eatery as his second room. This is 2 for the location value, but CAM 2 is the Backdoor. So, the Room Location translates 2 to 5, making him appear in CAM 5, aka the Eatery. Whether Wario is visible in the camera or not depends on if his Room Location matches the camera you're viewing.
 

Standard A.I. Attacking

(Wario, Waluigi, Luigi)

Their attack speed functions similar to their A.I. Wait Times. However, it does not use the same code as the normal movements. When one of the standard characters enters their attacking spot (left door for Wario, right window for Waluigi, middle hall for Luigi), their Door Timer is set to a random amount depending on their A.I. value, and the timers goes down.

Wario gives the player " Random (26,27) - Wario AI " seconds to react.

Waluigi gives the player " Random (27,30) - Waluigi AI " seconds to react.

Luigi gives the player " Random (30,39) - Luigi AI " seconds to react (this timer freezes if the middle light is activated).

Once this timer reaches zero, they make their move.

For Wario and Waluigi:

If their timer runs down to 0, and the door is closed, they will backtrack to a previous room, and the Location will be set to a random amount between 0 - 3. This means Wario can retreat to outside the factory, Lobby, Eatery, Storage Unit, Factory Hall or the middle hall.

Waluigi also retreats to a Location value of 0 - 3, which means he will retreat to either outside the factory, Lobby, Machinery, or the middle hall.

However, if their timer reaches 0, and the doors aren't closed, they will disable the door and light buttons for whichever side they attack on, and they will eventually kill you, unless the clock reaches 6AM before they attack.

For Luigi:

When Luigi's timer reaches 0, he will jump from the hall and immediately kill you.

The only way to make Luigi go away is to toggle the middle light. Leave the light on for 3 seconds (does not have to be 3 seconds in a row) to make him go away. After he goes away, he will retreat to a Location value between 0 - 2, which means he will either go backwards to outside the factory, Backdoor, Control Room or the Machinery.

Peach's A.I. and Attacking

Princess Peach does not have a standard A.I. path she follows. Instead, her attack style is a little different. She remains outside the factory until eventually entering a random room in the factory. If you don't play the music enough in the room she's in, you will hear her run towards you and kill you.

Peach has an A.I. Wait Time just like the standard characters do that controls when she enters a room in the factory:

Peach enters the factory every " Random (45-60) - Peach AI " seconds, noticeably longer than the standard A.I. character wait times.

When she enters a room, the time it takes for her to run towards you is actually not controlled by randomization or A.I. values, rather it is a consistent 20 seconds every time. This 20 second timer freezes when the music is playing. Keep in mind the music only works against her when it's playing in the room she's in.

The amount of time you need to keep the music playing is randomized, though. You have to keep the music playing for " Random (2.9, 4.1) " seconds for her to go away.

Mario's A.I. and Attacking

Mario does function using a path for his A.I., but it acts a little different, since his path takes place inside the office computer, rather than the cameras. He only has to make 3 moves to reach your office, rather than the standard 4 moves.

Mario moves every " Random (24-36) - Mario AI " seconds. Unlike the standard characters, it is impossible for Mario to backtrack.

When Mario enters the Office, he waits for you to pull the camera down to attack. Once you see him standing in the Office, you have 2 seconds to pull up the camera, otherwise he will kill you, resulting in a Game Over.

If you pull it up in time, he retreats to Location 0 - 2, similar to Luigi's backtracking (see Standard A.I. Attacking)

Wario Man's A.I.

Wario Man only appears on Night 0, and he does not get faster using A.I. values, thus why he is not in Custom Night. Instead, he gets faster in relation to what time it is (i.e. he will be faster at 5AM and slower when it is 12AM).

Wario Man has a similar equation to the standard A.I.:

Wario Man moves every " Random (7-12) - (Time value * 0.8) " seconds.

His attacking is nothing of note, as it's very similar to the Standard A.I. attacking, however he will pound on the door and leave after the door's been shut for around 4 seconds.

bottom of page