Raid System like valhiem or palword

I was wondering how I would be able to even make something like that.

You could start with a Raid Manager Blueprint that checks trigger conditions, such as elapsed time or player progress, and selects spawn points a safe distance from the base.

Have it spawn enemies in waves, track how many are still alive, and end the raid when they’re defeated or a timer expires.

Is this for single-player or multiplayer? For multiplayer, you’ll want the server to control spawning and raid state.

i got something started and it was fine at first but the more you go into each raid it messes up the logic it is singleplayer

Haven’t played Valheim enough to see a raid, but just reading the wiki, I’d probably set it up like this:

First, in game instance make a map variable with creature type or faction enum as the key, and use float as the value. Then whenever a mob dies, have it call a function on game instance called Update Agro or some such, and have it increase the float value in map var based on creature’s type or faction. Update Agro func could have a float input so each creature could have its own “score.”

Then in game mode, on begin play, set a looping timer by event of 2700 seconds (or whatevs), and have the delegated event check the scores in that map var in game instance. Probably a foreach loop, and if float value > trigger threshold, set a new bool called bRaidActive or something to true, and call a Start Raid event or function.

During the raid itself, I’d probably tweak the Update Agro logic in game instance, and if bRaidActive is true, add the creature kill “score” to another float var called raid progress, and when that’s >= value needed to end raid, call func on game mode (or dispatch event and have gamemode bind to it) to end raid and set bRaidActive back to false. Should probably reset the float in the agro map to 0 for the current raid faction too on complete, so it doesn’t just restart immediately.

what do you think of the code above?

it works for raid one and two but then it starts to start ignoring logic that should limit spawn behavior on raid 3

nvm i fixed it

Glad you got it working! What turned out to be causing the issue on raid 3? Would be useful to know for anyone running into something similar.

I instead used an index that increments on spawn so that I can keep a tighter hold of the logic and I set the index back to zero when all enemies are gone. and use that for the first check spawned actor index greater or equal to max.