Traditional RPG Random Enemy Encounters (UE 5.3)

I suppose you’d do either.
If you keep the base functionality on the game mode, and bounce the activity from the Level to the Game mode, you could pass along values such as encounter rate (that’s the number you’d divide by your steps) to be different based on the level, but not have to re-code the entire thing for different levels. I wouldn’t put it on the Character, no, this is more of a GameMode type thing.

Make a function to run on each step on the Game Mode, give it a variable of steps taken, ++ it on each run of the function, input of a Float for the Encounter rate (this will be a variable on your level blueprint) and an output of a boolean (this is your “Trigger encounter? T/F”).

Then, on each collision of the feet like you were talking about, on the collision logic in your level blueprint do GetGameMode-> F_RandomEncounterCounter(or whatever you name it). Then face the encounter trigger however you’re wanting to do that!

1 Like