Pac-Man Basic Ghost AI

Hello i’m currently working on a school project and I need to recreate Pac-Man in Unreal using blueprints

The way i’m setting up the project is to create a Basic AI from which all the other ghosts will inherit from
The basic ghost AI need the funcionality to switch between modes (Pacman ghost have 6different Modes/Behaviour) as well as the funcionality os each Mode .

I’m very new to unreal and i don’t know where to start
I’m thinking about using a bahaviour tree but i have.

So far i’ve created 2 enums one for the different modes and one for the the direction

this is where i am right now

It is required that you use behavior trees and blackboards?
If not then stick to blueprints.
Behavioral trees would be yet another thing to learn and understand, and kn owing those school projects you do not have much time.

do not start with enums, start from bottom, pick easiest mode and implement it, then pull out all functions that may be common to more than single mode.

yes and no, Unreal bluprint proficiency makes for 30% of my mark and they require us to make our best effort to use the best practices. I have 4 weeks and i’m working on the game with 2 more people, one of them has a background in software develpment. Also on average we spend 7 hours at school, i think we enough time.

Regardless of that i still don’t know where to start actually, other than the things i linked

Well unless you have more than 30 of those ghosts best practice would be pure blueprint.
Blackboards are needed for performance saving as they are faster than blueprints.
But i know best practices are just best for teaching you not implementing for this case. :wink:

And back to topic:

  • google for random roaming bacis AI in unreal, there are tutorials.
    do that first,
    make sure your navigation volume is set up correctly (press N, and floor should lit in green), you can see one of templates it has that implemented.

next is lots of problems with blackboards, to make them act like you want.

1 Like

Nah, I only have 4.
But inheritance is needed, so I need to create a basic AI and then 4 different ghosts AI based on that.

Thanks, I will follow the tutorial and abandon the idea of behavior trees.

Dont abandon it, list all ai modes first.
If blackboards will give better score, at least try it with 2 modes:
following player and avoiding player

Just implement those two (easiest) with blackboards then do rest if you have time

Don’t abandon the post you mean?

If so the Ai modes are 5, that’s why I am using an Enum
-SCATTER
-CHASE
-FLEE
-FRIGHTENED
-HOUSE

that is quite easy/fortunate :smiley:

Follow tutorial for random roaming, at some point it sets goal/target, and that is single thing you need to change for all those modes

make logic changing behavior for ghost in game mode in blueprints.
then dispatcher and make ghosts hook to it, then blueprint in their pawn code should change their AI mode (like goal where they go)