Hide and Seek

Hey Unreal Engine Users

I am currently creating a hide and seek based game, the levels are coming along great but I am having one major problem, actually creating the gametype. I am wondering if anyone is able to point me to a tutorial that shows me how to do this or if anyone knows how to do this themselves.

I essentially want one seeker, the rest of the players as hiders, if a seeker comes close enough the can click to kill the hider. If the hiders survive 5 minutes they win, if the seeker kills everyone the seeker wins. Once a seeker is killed they spectate the rest of the round.

If anyone can point me in the right direction that would be great!

THanks! :slight_smile:

Hey there (:

these are hard to answer, since it was require to tell you how to create such a game in detail.

I can only tell you what topics you should cover.

For Seeker and Hider, you will want to google/youtube how to Spawn and Possess a Character.
(Note: The logic about selecting the Seeker/Hider is up to you)

For the Timer, you can create a variable that counts up to 5*60 Seconds in the TickEvent together
with the DeltaSeconds. You can also use “Set Timer” with a function/event that you get executed
once it reaches the passed time.

For the Kill, you will want to look up how to use a “Singe Line Trace” when clicking the left mouse button.
This is similar to shooting or picking something up, so you can use Tutorials showing this to learn something.

For spectating i have no idea, because i never made a spectator, but maybe a simple google helps you out
here!

Overall, this is a big thing (making your own game) and your best bet is to split this up into multiple section.
Thinking about what you should do first.

How i would start:

Create your 2 different Character Classes for Seeker and Hider.
Learn how to spawn and possess them.
Add a logic to the Seeker to kill the Hider (Line Trace on MouseClick->Cast HitActor to Hider Class->Call a Kill function that
should be inside the HiderBlueprint)

This is already A LOT. If you have this running, you can think about enabling the timer and tracking if everyone is dead or so.

Things that are REALLY important to learn:

Unreal Engine 4’s Networking! You really need to learn how networking works here. Which classes are good for which action.
Which classes only exist on the Server or on the Clients. Which classes can be used to perform so called RPCs. What is an RPC.
What does “Replicate” mean. How does “RepNotify” work. And so on.

Otherwise you will have a hard time understanding why you code isn’t doing what it should (which is most likely due to doing
something wrong in Multiplayer Code). Multiplayer requires some additional code than SinglePlayer.

Sides to check out:

Gameplay Guide Overview
Gameplay Framework Overview
Gameplay Framework Quick References
Epic Games Youtube Channel Playlists
Epic Games Youtube Network Playlist (Editor looks different due to older Version)
My YoutubeChannel | Networking 1/2 Steam Recap
Gameplay Framework together with Networking!

I hope this helps (:

For spectator you will want to spawn and posses a “spectator pawn.” It basically works like a disembodied ghost for controls.