Announcing Section #1 for Survival Game - Third-person Player Setup

thank you very much!!!I found it!

What you need is the post processing volume in your new level. Under “Blendables” we assigned our own post-processing material. If you need you can copy/paste the volume from one level to another. If you are creating a new volume in your level, then don’t forget to check “Unbound” in its properties to make sure the volume is always active regardless if we are overlapping or not.

EDIT: The quoting got messed up, but I see you got it working!

I was hoping to compile this with 4.9.1 due to limited space on an SSD.

I’m getting the error


1>M:\Dev\Unreal Projects\Survival Series\EpicSurvivalGameSeries-Section-1\SurvivalGame\Source\SurvivalGame\Public/SCharacter.h(72): error C3668: 'ASCharacter::OnLanded' : method with override specifier 'override' did not override any base class methods

This is the line it refers to.


void OnLanded(const FHitResult& Hit) override;

Just in case its not possible to do, what version was this made with originally?

Thanks a lot for this series, its going to be a great help. Its very much appreciated!

This function was changed during the API updates of 4.7. The source on Github is updated to 4.9, so all you need is the latest from the master branch. (The section specific branches were made with 4.6 I believe)

Ok cool. As soon as my VDSL100 is up and ready, i will start planing this.

Looking forward to your example game since a Survival Game was my first “project” i did in UE4 (:

http://imgupp.com/img/1434725316.jpg

Hey, i just started to go through the example code and this may be a stupid question… but why do you prefix all your classes with “S”?
I thought “Classes that inherit from SWidget are prefixed by S.” ?^^
At this point i didnt read through the doc to teach myself the meaning of the SWidget class, so maybe im missing something.

S is my project prefix from “SurvivalGame” much like Unreal Tournament uses UT as their class prefix. SWidget is purely a coincidence.

Refactor ‘OnLanded’ to just ‘Landed’ and that will fix the compile error if your trying to compile section 1 on version 4.9.

http://imgupp.com/img/1446918954.jpg

I really have some problems understanding a few things in this project…
I cant find anything which explains the use of classes like “Local Player”, “Player State”, “Spectator Pawn”.

And where do you specify where to spawn the player at the start of a game? There are 6 “PlayerStart” objects but only 2 of them, inheriting from
your custom “SPlayerStart.h”, are used. Even when i start it for 3 players.

EDIT: K i figured out the playerstart thing… for those who want to know: it is used in SGameMode

But here is another question: When is "ChoosePlayerStart(AController* Player) called? I guess it uses the Controller spawned for the new player?

**LocalPlayer **is a class that’s mostly used for local multiplayer and splitscreen.

PlayerState is used to store variables that need to be send over the network so other clients can understand the state of another player. (A Pawn can replicate variables, but a pawn is destroyed and recreated on every death, the playerstate class allows us to persist certain variables like death count across the network)

SpectatorPawn, used during spectating. No mesh, no FX, just a fly camera usually. This can be assigned in the gamemode.

ChoosePlayerStart is called when a new Pawn is spawned during ServerRestartPlayer(…) You can do a search in the entire solution since UE releases now come with all source, it’ll help you understand the framework.

How would i change how fast the time of day cycles? for example if i want the daytime to last longer?

In SGameState.cpp you can find a variable called TimeScale in the constructor, tweak it as you want.

If you want you can set this variable at runtime via console in this way:

  1. Open SGameState.h

  2. Scroll down and after the SetTimeOfDay function declare a new function like this



UFUNCTION(exec)
void SetTimeScale(float NewTimeScale);


  1. Now open SGameState.cpp and define your function (personally i done it after the SetTimeOfDay definition)


void ASGameState::SetTimeScale(float NewTimeScale)
{
	TimeScale = NewTimeScale;
}


Hope it help :slight_smile:

Not sure why, but it does not seem to be helping, i even built the solution after i made the changes…

http://s020.radikal.ru/i717/1511/b8/2b03e53ccbed.jpg
rox keep going with update

برمجة تطبيقات الاندرويد](http://nokhetha.com/index.html)
تصميم برامج الايفون](http://nokhetha.com/index.html)
تطبيقات اندرويد](http://nokhetha.com/index.html)

Hey I am doing my own Shooter game test thingy and I am using your Survival Game as a reference for learning Animation Blueprint and some other things.
In your projects Player_AnimBP, StartCrouch to Crouch rule, there is this ‘Stand_to_Crouch_Rifle_Hip Asset’ which has ‘Time Remaining’ float.
I am not able to recreate this in my own project, how did you create this asset? Did you create this asset somewhere in C++ or do you make some sort of reference within that animation file?

The TimeRemaining node is built-in, I didn’t do anything custom in C++. It will only be available if the state A (eg. Idle or Crouching state) has an animation to play so we can access this animation info when we want to check TimeRemaining on it.

Any of the arrows you drag between states has the animation info from the state node it originates from (eg. where the arrow starts) so long as that state is playing an animation sequence, you should be able to get nodes specific to that animation, like the TimeRemaining node.

Hope that made any sense.

More info on State Machines and the Transition Rules: State Machines in Unreal Engine | Unreal Engine 5.3 Documentation

For Windows 10 users.

I have a build of UE v4.7.6 for Windows 10 for whomever is interested. The version from epic doesn’t load the project and locks my system. Great work on this.

The latest version on Github runs on UE 4.10. I’m using Windows 8.1, but have not heard of any Windows 10 related issues.

Hey , I verified master works with 4.10 on windows 10 however the section branches are pre 4.9 api, hence the necessary 4.7.6 rebuild. I like seeing this project in it’s early stages!