# 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:** 11

<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:** [November 10, 2015, 2:27pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/207 "2015-11-10T14:27:18Z")

</div>

> [@Naitguolf;412144](#):
>
> I am stuck with something… I do want to make a simple rpg launcher. So the weapon fire a proyectil that, on impact, explode like the bomb. Tried to change the damage\_type, but I am unable to do it, any help please? Thanks!

Changing the damage type is not enough, that’s purely to identify the kind of damage was applied, and has nothing to do with actually applying damage to hitpoints or FX.

ShooterGame has an implementation for projectile based weapons, and the project uses a nearly identical weapon framework. the class is named ShooterWeapon\_Projectile I believe. That should be a good starting point.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9d7a9e0b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9d7a9e0b](https://forums.unrealengine.com/u/anonymous_user_9d7a9e0b)\
**Post date:** [November 15, 2015, 3:07pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/208 "2015-11-15T15:07:52Z")

</div>

Hya !

Just noticed you adapter your project to 4.10, tried compiling it to check the differences:

```auto

Severity	Code	Description	Project	File	Line
Error	C2248	'FActiveSound::AudioComponent': cannot access private member declared in class 'FActiveSound'	SurvivalGame	D:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Editor\SoundNodeLocalPlayer.cpp	13
Severity	Code	Description	Project	File	Line
Error (active) member "FActiveSound::AudioComponent" (declared at line 74 of "d:\UnrealEngine-release\UnrealEngine-release\Engine\Source\Runtime\Engine\Public\ActiveSound.h") is inaccessible	SurvivalGame	d:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Editor\SoundNodeLocalPlayer.cpp	13
Severity	Code	Description	Project	File	Line
Warning	C4996	'USkinnedMeshComponent::bChartDistanceFactor': bChartDistanceFactor is no longer useful, please remove references to it Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.	SurvivalGame	D:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Items\SWeapon.cpp	16

```

Just thought you should know 🙂

PS- I see you’ve changed the messages to IDs, nice!

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [November 15, 2015, 3:20pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/209 "2015-11-15T15:20:40Z")

</div>

> [@;420443](#):
>
> Hya !
> 
> Just noticed you adapter your project to 4.10, tried compiling it to check the differences:
> 
> ```auto
> 
> Severity	Code	Description	Project	File	Line
> Error	C2248	'FActiveSound::AudioComponent': cannot access private member declared in class 'FActiveSound'	SurvivalGame	D:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Editor\SoundNodeLocalPlayer.cpp	13
> Severity	Code	Description	Project	File	Line
> Error (active) member "FActiveSound::AudioComponent" (declared at line 74 of "d:\UnrealEngine-release\UnrealEngine-release\Engine\Source\Runtime\Engine\Public\ActiveSound.h") is inaccessible	SurvivalGame	d:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Editor\SoundNodeLocalPlayer.cpp	13
> Severity	Code	Description	Project	File	Line
> Warning	C4996	'USkinnedMeshComponent::bChartDistanceFactor': bChartDistanceFactor is no longer useful, please remove references to it Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.	SurvivalGame	D:\Unreal Projects\SurvivalGame\Source\SurvivalGame\Private\Items\SWeapon.cpp	16
> 
> ```
> 
> Just thought you should know 🙂
> 
> PS- I see you’ve changed the messages to IDs, nice!

You can fix the error in this way

In SoundNodeLocalPlayer.cpp change this

```auto

AActor* SoundOwner = ActiveSound.AudioComponent.IsValid() ? ActiveSound.AudioComponent->GetOwner() : NULL;

```

with this

```auto

AActor* SoundOwner = ActiveSound.GetAudioComponent()->IsValidLowLevel() ? ActiveSound.GetAudioComponent()->GetOwner() : NULL;

```

🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9d7a9e0b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9d7a9e0b](https://forums.unrealengine.com/u/anonymous_user_9d7a9e0b)\
**Post date:** [November 15, 2015, 4:40pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/210 "2015-11-15T16:40:34Z")

</div>

> [@ZioYuri78;420447](#):
>
> You can fix the error in this way
> 
> In SoundNodeLocalPlayer.cpp change this
> 
> ```auto
> 
> AActor* SoundOwner = ActiveSound.AudioComponent.IsValid() ? ActiveSound.AudioComponent->GetOwner() : NULL;
> 
> ```
> 
> with this
> 
> ```auto
> 
> AActor* SoundOwner = ActiveSound.GetAudioComponent()->IsValidLowLevel() ? ActiveSound.GetAudioComponent()->GetOwner() : NULL;
> 
> ```
> 
> 🙂

I know lol but thanks anyway 🙂

The goal is for him to push the fixes onto the repo so other people wont have problems.

Btw you M.O.S looks great!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8b7ae4131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8b7ae4131](https://forums.unrealengine.com/u/anonymous_user_8b7ae4131)\
**Post date:** [November 15, 2015, 6:08pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/211 "2015-11-15T18:08:32Z")

</div>

To what extent can we use this as a base for our projects?

And is there a way to rename the project/files from SurvivalGame to our name?

---

<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:** [November 16, 2015, 8:19pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/212 "2015-11-16T20:19:01Z")

</div>

> [@GuilhermeB;420518](#):
>
> To what extent can we use this as a base for our projects?
> 
> And is there a way to rename the project/files from SurvivalGame to our name?

It’s quite simple, you can use it like ShooterGame and all the other Epic sample content. Meaning you can use it as a starterkit to build your own project on top of.

As for renaming, I’ve seen some tools floating around that will help with renaming, but none were a guarantee that you didn’t need to add manual edits for it to compile again.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8b7ae4131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8b7ae4131](https://forums.unrealengine.com/u/anonymous_user_8b7ae4131)\
**Post date:** [November 16, 2015, 8:53pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/213 "2015-11-16T20:53:10Z")

</div>

> [@;421089](#):
>
> It’s quite simple, you can use it like ShooterGame and all the other Epic sample content. Meaning you can use it as a starterkit to build your own project on top of.
> 
> As for renaming, I’ve seen some tools floating around that will help with renaming, but none were a guarantee that you didn’t need to add manual edits for it to compile again.

Oh so nice! Do you know the name of the tools - searched for them yet can’t seem to find them.

Additionally, can you explain two things:

- What is the LocalPlayer class about? Doesn’t seem to do anything at all.
- When the clients on a multiplayer game load another clients, (e.g., I’m player A, and I see player B), which class exactly is loaded on local client A for player B? Is it a normal instance of the default character class?

Lastly, I know this is pretty specific, but if the loaded client is just an instance of the default player class, how are we supposed to distinguish between them? Should we check IsLocalPlayer() ?

---

<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:** [November 18, 2015, 9:42pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/214 "2015-11-18T21:42:10Z")

</div>

> [@GuilhermeB;421111](#):
>
> - What is the LocalPlayer class about? Doesn’t seem to do anything at all.

LocalPlayer is useful when dealing with multiple users on a single machine (so mostly for game consoles) when using splitscreen or local multiplayer, each player has one LocalPlayer instance that holds some info on name, HUD etc. Generally you don’t do a whole lot with this class, but it will exist even for your single player game.

> [@GuilhermeB;421111](#):
>
> - When the clients on a multiplayer game load another clients, (e.g., I’m player A, and I see player B), which class exactly is loaded on local client A for player B? Is it a normal instance of the default character class?

When you see another player, you see his Character (eg. Pawn)

> [@GuilhermeB;421111](#):
>
> Lastly, I know this is pretty specific, but if the loaded client is just an instance of the default player class, how are we supposed to distinguish between them? Should we check IsLocalPlayer() ?

that is indeed how you usually check, IsLocallyControlled() etc.

---

<div class="post-metadata">

**Author:** ![ZioYuri78](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zioyuri78/32/1194615_2.png) [@ZioYuri78](https://forums.unrealengine.com/u/ZioYuri78)\
**Post date:** [November 19, 2015, 2:04pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/215 "2015-11-19T14:04:45Z")

</div>

> [@;420481](#):
>
> I know lol but thanks anyway 🙂
> 
> The goal is for him to push the fixes onto the repo so other people wont have problems.

😃

> [@;420481](#):
>
> Btw you M.O.S looks great!

Thank but is not so great, has a lot of limitations but i’m happy people is liking it 🙂

---

<div class="post-metadata">

**Author:** ![gozu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gozu/32/869945_2.png) [@gozu](https://forums.unrealengine.com/u/gozu)\
**Post date:** [November 23, 2015, 5:50am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/217 "2015-11-23T05:50:04Z")

</div>

> [@GuilhermeB;420518](#):
>
> To what extent can we use this as a base for our projects?
> 
> And is there a way to rename the project/files from SurvivalGame to our name?

Hi, I have renamed some code projects using FAR before, works fine.  
see:

> **[Instruction: How to rename ShooterGame project step by step](https://forums.unrealengine.com/showthread.php?83428-Instruction-How-to-rename-ShooterGame-project-step-by-step)**
>
> Hi, after wasting a few time to do this, here the complete instructions, it should take less then 30 minutes from start to finish, not including download and installation 🙂 Step 1 From the launcher, download and install ShooterGame, rename using...

and:

> **[\[TIP\] Renaming C++ Classes without breaking your project](https://unrealxeditor.wordpress.com/2015/05/28/tip-renaming-c-classes-without-breaking-your-project/)**
>
> Ever wondered how to rename your C++ classes that you already use in your project? For example, you have a C++ class called MyAwesomeClass and in your Content Browser you created a Blueprint extend…

---

<div class="post-metadata">

**Author:** ![QQZeroQQ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@QQZeroQQ](https://forums.unrealengine.com/u/QQZeroQQ)\
**Post date:** [November 23, 2015, 8:29pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/218 "2015-11-23T20:29:52Z")

</div>

Hello everyone,

I’ll probably look like the biggest newbie ever but… after spending tons of time opening and checking every things, I was unable to find where the “Main Menu” Widgets is managed… is it me who are really blind or it’s hardcoded somewhere ?  
I had a memory that I found it before, but now unable to retrive where it’s managed…

Thank you in advance !  
Sincerely.

---

<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:** [November 25, 2015, 7:05pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/219 "2015-11-25T19:05:07Z")

</div>

> [@QQZeroQQ;425173](#):
>
> Hello everyone,
> 
> I’ll probably look like the biggest newbie ever but… after spending tons of time opening and checking every things, I was unable to find where the “Main Menu” Widgets is managed… is it me who are really blind or it’s hardcoded somewhere ?  
> I had a memory that I found it before, but now unable to retrive where it’s managed…
> 
> Thank you in advance !  
> Sincerely.

If I recall correctly this is added through the Level Blueprint of the main menu map.

---

<div class="post-metadata">

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

</div>

After checking again, I found where the widget was… sorry for disturbing…

Great job for your work !

---

<div class="post-metadata">

**Author:** ![sparco912](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sparco912](https://forums.unrealengine.com/u/sparco912)\
**Post date:** [November 26, 2015, 7:03pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/221 "2015-11-26T19:03:49Z")

</div>

hello, I start on EU4, let me know how it is to add to project my project. a simple video’ll be fine? thx

---

<div class="post-metadata">

**Author:** ![sparco912](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sparco912](https://forums.unrealengine.com/u/sparco912)\
**Post date:** [November 26, 2015, 7:19pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/222 "2015-11-26T19:19:56Z")

</div>

how do we project to add the survival game on Unreal 4 engine?

---

<div class="post-metadata">

**Author:** ![Prometheus88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Prometheus88](https://forums.unrealengine.com/u/Prometheus88)\
**Post date:** [January 6, 2016, 10:21pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/224 "2016-01-06T22:21:15Z")

</div>

Links are not working.

---

<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:** [January 7, 2016, 7:16am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/225 "2016-01-07T07:16:39Z")

</div>

> [@Prometheus88;448947](#):
>
> Links are not working.

I just checked the links in the OP and they all work fine. What’s not working on your end?

---

<div class="post-metadata">

**Author:** ![Vahid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vahid](https://forums.unrealengine.com/u/Vahid)\
**Post date:** [January 7, 2016, 11:45am UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/226 "2016-01-07T11:45:36Z")

</div>

Hi ,  
Do you have any plan for another tutorial ?

---

<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:** [January 7, 2016, 12:04pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/227 "2016-01-07T12:04:49Z")

</div>

> [@Vahid;449304](#):
>
> Hi ,  
> Do you have any plan for another tutorial ?

Yes I do.

-

---

<div class="post-metadata">

**Author:** ![AlAhmedElHamed](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alahmedelhamed/32/1121564_2.png) [@AlAhmedElHamed](https://forums.unrealengine.com/u/AlAhmedElHamed)\
**Post date:** [January 11, 2016, 10:09pm UTC](https://forums.unrealengine.com/t/ongoing-c-gameplay-example-series-making-a-survival-game/24878/228 "2016-01-11T22:09:39Z")

</div>

is this project still alive ? i checked it couple of times and it seem a great Resource since i want to learn co-op on 4.10 :ٍD

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

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