# Ongoing C++ Gameplay Example Series: Making a Survival Game

**URL:** <https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878>\
**Category:** Announcements\
**Tags:** unreal-engine\
**Created:** [March 20, 2015, 3:38pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878 "2015-03-20T15:38:03Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [April 19, 2015, 12:39pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/103 "2015-04-19T12:39:03Z")

</div>

> [@shadowmint;274686](#):
>
> I personally just think that the tutorial series would be slightly more meaningful if it covered ‘why am I using C++ for this part?’; maybe even add some blueprint scripts which use exposed C++ functions and then cover ‘why have I chosen to use blueprint for this part instead?’.
> 
> That feels like it would be more practical to the majority of people using a combination of C++ and blueprint scripts in their games, rather than just the arbitrary decision to only use C++.

That is a good point. I’ll keep this in mind for the upcoming sections and see if I can be more explicit about that.

---

<div class="post-metadata">

**Author:** ![IceDealer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IceDealer](https://forums.unrealengine.com/u/IceDealer)\
**Post date:** [April 22, 2015, 8:22am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/104 "2015-04-22T08:22:02Z")

</div>

@: I’m eagerly following this project, couldn’t start out yet though since I’m still learning C++ right now. My question is: How many players can this project support ? Could it handle 50 players on a server at once ? What about saving stats or items after logging off ? Can you implement this in the end too ? This would be gold!

So far, work all the way! Loving it though I don’t understand much at the moment due to lack of C++ knowledge 🙂

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [April 22, 2015, 11:28am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/105 "2015-04-22T11:28:06Z")

</div>

> [@IceDealer;276785](#):
>
> @: I’m eagerly following this project, couldn’t start out yet though since I’m still learning C++ right now. My question is: How many players can this project support ? Could it handle 50 players on a server at once ? What about saving stats or items after logging off ? Can you implement this in the end too ? This would be gold!
> 
> So far, work all the way! Loving it though I don’t understand much at the moment due to lack of C++ knowledge 🙂

I’m building the project as a small coop project. At the moment I don’t have any large world features planned. Persistence is definitely interesting - but I can’t make any promises 😉

---

<div class="post-metadata">

**Author:** ![tucow](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tucow](https://forums.unrealengine.com/u/tucow)\
**Post date:** [April 30, 2015, 1:53pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/106 "2015-04-30T13:53:59Z")

</div>

Hi ,

this is a really cool Project and I think this will help a lot of people. Since you started it in GitHub I did follow the progress, a few minutes ago I checked for the latest commit and found a funny bug. As soon as you approach other Player or AI characters the gun fire doesn’t do any damage on a certain distance. For example, I’m like 10m away everything is fine but as soon as I stand in front of other characters the damage doesn’t count. I didn’t dig into the code yet, just wanted to share it asap.

Cheers

- tucow

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [April 30, 2015, 2:05pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/107 "2015-04-30T14:05:02Z")

</div>

> [@tucow;282343](#):
>
> Hi ,
> 
> this is a really cool Project and I think this will help a lot of people. Since you started it in GitHub I did follow the progress, a few minutes ago I checked for the latest commit and found a funny bug. As soon as you approach other Player or AI characters the gun fire doesn’t do any damage on a certain distance. For example, I’m like 10m away everything is fine but as soon as I stand in front of other characters the damage doesn’t count. I didn’t dig into the code yet, just wanted to share it asap.
> 
> Cheers
> 
> - tucow

Hi! I’ve seen this happen, it’s because of a difference between visual FX and actual damage rays. I’ll have to think about how I can best fix this difference for a later section revision.

Thanks!

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 1, 2015, 6:23pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/108 "2015-05-01T18:23:35Z")

</div>

Section 3 is now available on the Wiki!

**[RIGHT](https://wiki.unrealengine.com/Survival_Sample_Game:_Section_3)**

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/5/955971a1cac2e3f744a198aa766c5dbf8597eaf0.jpeg "Survival Section 3: AI & Behavior Tree Overview [UE4]") ](https://www.youtube.com/watch?v=27XFykjd8Ns)

---

<div class="post-metadata">

**Author:** ![TidB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TidB](https://forums.unrealengine.com/u/TidB)\
**Post date:** [May 1, 2015, 8:36pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/109 "2015-05-01T20:36:42Z")

</div>

Ohai, that’s interesting as I’m currently looking into developing a stealth game where AI comes in handy. I’m a bit confused though, as [this](https://answers.unrealengine.com/questions/182648/bot-ai-blueprints-or-behaviour-tree-or-pawnsensing.html) answer states PawnSensing isn’t developed any further and is replaced by the perception system. Moreover, it seems (regarding the comments on the same answer) PawnSensing doesn’t support networking (you might want to correct me on this topic). Do you plan to adapt to this new perception system?

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 2, 2015, 12:37am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/110 "2015-05-02T00:37:34Z")

</div>

I have PawnSensing working just fine with two networked players, so I don’t know what the issues are that were reported.

And yeah PawnSensing is no longer developed, but it’s not going away for a while either. I _may_ update to perception system post-4.8, it just wasn’t quite the right time to go for perception system yet and pawn sensing is quite simple to use for the simplistic zombie AI so it was a good fit.

---

<div class="post-metadata">

**Author:** ![Char1zART](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Char1zART](https://forums.unrealengine.com/u/Char1zART)\
**Post date:** [May 11, 2015, 9:32pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/111 "2015-05-11T21:32:22Z")

</div>

Welcome and thank you

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 18, 2015, 2:47pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/112 "2015-05-18T14:47:14Z")

</div>

**[Wiki Docs](https://wiki.unrealengine.com/Survival_Sample_Game:_Section_4) are now available for section 4 on time of day, spawning and game loop!**

 ![survival_section4_banner01.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/7/a73089b510d27cc976e1dd9cc29871dc85dd1c34.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_57a3123a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_57a3123a1](https://forums.unrealengine.com/u/anonymous_user_57a3123a1)\
**Post date:** [May 19, 2015, 12:38am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/113 "2015-05-19T00:38:27Z")

</div>

Hey for some weird reason, I can’t seem to open up the project. I always get this error message:

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/7/ef70415d20e8f5ff51543e01d4b0eb8433950486.png)  
's what I did:

1. Download the project using Git Bash.
2. Try to open the .uproject file -\> Results in error

I also tried this:

1. Download the project using Git Bash.
2. Right click on the .uproject file to generate Visual Studio project files
3. Try to open the .uproject file -\> Results in error

Tried :

1. Download the project using Git Bash.
2. Right click on the .uproject file to generate Visual Studio project files
3. Build the solution in Visual Studio -\> compiles without a problem
4. Try to open the .uproject file -\> Results in error

I also tried the methods using the UE4 Launcher instead of in the windows explorer. If it’s any help, the error appears around the 70% mark of opening up the project. I’m using Windows 7 SP1.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 19, 2015, 8:25pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/114 "2015-05-19T20:25:49Z")

</div>

> [@Ghi102;294727](#):
>
> Hey for some weird reason, I can’t seem to open up the project. I always get this error message:
> 
> [http://i.imgur.com/cJUmwRM.png](http://i.imgur.com/cJUmwRM.png)

I’ve never seen that before. Perhaps the log files can help us located at SurvivalGame/Saved/Logs/. Could you send them over through PM so I can take a look?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fd47b9c9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fd47b9c9](https://forums.unrealengine.com/u/anonymous_user_fd47b9c9)\
**Post date:** [May 22, 2015, 2:08pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/115 "2015-05-22T14:08:22Z")

</div>

Hi , thanks for your amazing work.

Just wanted to say i couldn’t build right out of the box on OS X with UE4 4.7.6. Had a compile error.

In SLocalPlayer.cpp :

I replaced :

```
 *NickName = FWindowsPlatformProcess::ComputerName() + FString::FromInt(FMath::RandRange(0, 999));*

```

By :

```
NickName = FGenericPlatformProcess::ComputerName() + FString::FromInt(FMath::RandRange(0, 999));

```

After that i could open the project with no problem.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 25, 2015, 4:16pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/116 "2015-05-25T16:16:51Z")

</div>

> [@Sumenia;297232](#):
>
> Hi , thanks for your amazing work.
> 
> Just wanted to say i couldn’t build right out of the box on OS X with UE4 4.7.6. Had a compile error.
> 
> In SLocalPlayer.cpp :
> 
> I replaced :
> 
> ```
> *NickName = FWindowsPlatformProcess::ComputerName() + FString::FromInt(FMath::RandRange(0, 999));*
> 
> ```
> 
> By :
> 
> ```
> NickName = FGenericPlatformProcess::ComputerName() + FString::FromInt(FMath::RandRange(0, 999));
> 
> ```
> 
> After that i could open the project with no problem.

Hi! I’ve had more people reporting this compatibility for OSX. Using the generic avoids the, but won’t allow you to ID others in a multiplayer game. So I’ll see if I can fix this using platform compilation flags.

---

<div class="post-metadata">

**Author:** ![\_cDub](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_cDub](https://forums.unrealengine.com/u/_cDub)\
**Post date:** [May 26, 2015, 4:11pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/118 "2015-05-26T16:11:36Z")

</div>

It would be nice to watch you work on this on a twitch live stream or something. Hearing someone talk about something or seeing something being worked out in a chronological order is how I learn best.

Also, I just downloaded it and I am getting a lot of weird errors like "no instances of overloaded function “ASCharacter::ASCharacter” or identifier “Use” is unidentified. These are all over the place.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 26, 2015, 9:36pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/119 "2015-05-26T21:36:35Z")

</div>

That’s odd, are you on 4.7.x? And did you download the branch or a specific section?

---

<div class="post-metadata">

**Author:** ![\_cDub](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_cDub](https://forums.unrealengine.com/u/_cDub)\
**Post date:** [May 26, 2015, 11:53pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/120 "2015-05-26T23:53:17Z")

</div>

branch, and 4.7.6, and the game runs in editor is fine. It’s just visual studio that has the problem.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [May 28, 2015, 1:28pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/121 "2015-05-28T13:28:54Z")

</div>

> [@\_cDub;299678](#):
>
> branch, and 4.7.6, and the game runs in editor is fine. It’s just visual studio that has the problem.

It sounds like the download is corrupt? Could try getting a fresh copy of the branch and see what happens?

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [June 1, 2015, 7:19pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/122 "2015-06-01T19:19:58Z")

</div>

The wiki docs for Section 5 are up! It’s all about networking using some practical examples

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![Kafumanto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kafumanto/32/1194651_2.png) [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Post date:** [June 3, 2015, 1:17am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/123 "2015-06-03T01:17:23Z")

</div>

> [@;303045](#):
>
> The wiki docs for Section 5 are up! It’s all about networking using some practical examples
> 
> [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Survival_Sample_Game:_Section_5)

Very interesting!

Could you elaborate the difference between the declaration [FONT=Courier New]UFUNCTION(Reliable, NetMulticast) and [FONT=Courier New]UFUNCTION(reliable, client)? From the description they seems to have the same behavior.

Thank!

[Previous page](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878.md?page=5)

[Next page](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878.md?page=7)
