Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    I am using 4.19.. now looks like i have this error. ..also added "#include "BehaviorTree/BehaviorTreeComponent.h"" in the SGameMode.h
    Attached Files
    Last edited by skeetaseasonTV; 06-25-2018, 03:54 AM.

    Leave a comment:


  • replied
    This is due to how UE4 merges cpp files before compile, adding empty line changes timestamp of gamemode, and sudenly there is include missing, just add #include "BehaviorTreeComponent.h" after #include "SMutator.h" and it will compile ...

    Leave a comment:


  • replied
    I am able to compile the code with no problem, but when i try to edit the game mode...

    Lets say all i did was added one line with 0 code and i get errors... please review images... image one is normal code from github complie works fine.. image two is one line added with tons of errors..how does this happen? I tried reinstalling VS,,, generating project files again...
    Attached Files

    Leave a comment:


  • replied
    MachineX
    This is due to the mods if I recall correctly. What I did was downloaded the 4.18 copy of the source. Opened it in 4.18. Then if you upgrade it, it should tell you that the rifle mode and the other mod are not supported would you like to disable them.
    Say yes.
    Then find all the mod references and remove them or work on trying to upgrade them to 4.19. I'm going to revisit modding later but this got me started.

    Leave a comment:


  • replied
    Hello,


    I'm having trouble opening the SurvivalGame project in 14.19.2, I get an error about the UE4Editor-SurvivalGame.dll file and am too inexperienced to resolve this, I've tried a few things after a couple of days extensively Googling, installed Windows SDK & Visual Studio 2017 (OS: Windows 7 Ultimate 64-bit) as some mentioned that resolved compiling issues but I've had the same error since the start.

    Error:
    Click image for larger version

Name:	UnableToOpen1.png
Views:	92
Size:	25.4 KB
ID:	1484480

    Log during Rebuild (best screenshot I could get as it happens within 1sec):
    Click image for larger version

Name:	UnableToOpen2.png
Views:	137
Size:	66.4 KB
ID:	1484479

    Failure:
    Click image for larger version

Name:	UnableToOpen3.png
Views:	86
Size:	12.1 KB
ID:	1484478

    If there's a magic thing I can do to make this work please let me know, it's frustrating as I'm at a loss

    Attached Files

    Leave a comment:


  • replied
    Hello, I have followed the tutorial series and it worked great for a base, I have made a few changes but after I updated the project from UE 4.18.3 to 4.19.0 the engine and VS2017pro spit out errors about setting a class as Native. The file in question is the SGameMode.cpp to which I have made no changes. I have spent about 3 days now searching the HUB for any info on a change to the engine that would hide/remove the ability to set a function as Native. If someone would be so kind as to point me in the right direction for info on how to rework this to compile in 4.19 it would be greatly appreciated.

    here is the block throwing the error - Native undeclared identifier and ASGameMode uses non-stanard syntax use '&' to create pointer member.

    void ASGameMode::InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage)
    {
    // HACK: workaround to inject CheckRelevance() into the BeginPlay sequence
    UFunction* Func = AActor::GetClass()->FindFunctionByName(FName(TEXT("ReceiveBeginPlay")));
    Func->FunctionFlags |= FUNC_Native;
    Func->SetNativeFunc((Native)&ASGameMode::BeginPlayMutatorHack);

    /* Spawn all mutators. */
    for (int32 i = 0; i < MutatorClasses.Num(); i++)
    {
    AddMutator(MutatorClasses[i]);
    }

    if (BaseMutator)
    {
    BaseMutator->InitGame(MapName, Options, ErrorMessage);
    }

    Super::InitGame(MapName, Options, ErrorMessage);
    }

    Thanks in advance.

    Leave a comment:


  • replied
    Originally posted by dasshr View Post
    hi mr looman,i've got a problem,EpicSurvivalGameSeries\SurvivalGame\Binaries\Win64,there is not a UE4Editor-SurvivalGame.dll
    while rebuild from vs2017,the issue:

    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(55): error C2027: 使用了未定义类型“ASWeapon”
    1>C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Intermediate\Build\Win64\UE4Editor\Inc\SurvivalGame\SCharacter.generated.h(11): note: 参见“ASWeapon”的声明
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(54): note: 编译 类 模板 成员函数 "UClass *TSubclassOf<ASWeapon>:perator *(void) const" 时
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(77): note: 参见对正在编译的函数 模板 实例化“UClass *TSubclassOf<ASWeapon>:perator *(void) const”的引用
    1>C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Source\SurvivalGame\Private\World\SGameMode.cpp(385): note: 参见对正在编译的 类 模板 实例化 "TSubclassOf<ASWeapon>" 的引用
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(55): error C3861: “StaticClass”: 找不到标识符
    1>ERROR : UBT error : Failed to produce item: C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Binaries\Win64\UE4Editor-SurvivalGame.dll
    1>Total build time: 2.78 seconds (Local executor: 0.00 seconds)
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: 命令“E:\unrealEngin\UE_4.18\Engine\Build\BatchFiles\Build.bat SurvivalGameEditor Win64 Development "C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\SurvivalGame.uproject" -waitmutex”已退出,代码为 5。请验证您是否拥有运行此命令的足够权限。
    how can i solve it .. is it about hot reload? i hope you can have a look..
    you really should translate your log to english so we can give you some kind of feedback.

    Leave a comment:


  • replied
    I just found this project the other day, it looks a very promising start for building this type of game. I haven't had time to go through everything in detail yet, but would there be any interaction with a database to get a game like this to work? Would it be a situation where once the Unreal dedicated server went down (or crashed) all the world/player data would be lost and players would have to start anew in a fresh world?

    For example, if players had professions and they need to build up their skill to get access to more items. Maybe the player is level 10 out of 100 for First Aid. They login, advance to level 20 First Aid, then log out. Without a database would all of this would just be sitting in server memory?

    Any elaboration on how the database fits into the picture for a game like this would be greatly appreciated!

    Leave a comment:


  • replied
    hi mr looman,i've got a problem,EpicSurvivalGameSeries\SurvivalGame\Binaries\Win64,there is not a UE4Editor-SurvivalGame.dll
    while rebuild from vs2017,the issue:

    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(55): error C2027: 使用了未定义类型“ASWeapon”
    1>C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Intermediate\Build\Win64\UE4Editor\Inc\SurvivalGame\SCharacter.generated.h(11): note: 参见“ASWeapon”的声明
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(54): note: 编译 类 模板 成员函数 "UClass *TSubclassOf<ASWeapon>:perator *(void) const" 时
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(77): note: 参见对正在编译的函数 模板 实例化“UClass *TSubclassOf<ASWeapon>:perator *(void) const”的引用
    1>C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Source\SurvivalGame\Private\World\SGameMode.cpp(385): note: 参见对正在编译的 类 模板 实例化 "TSubclassOf<ASWeapon>" 的引用
    1>e:\unrealengin\ue_4.18\engine\source\runtime\coreuobject\public\Templates/SubclassOf.h(55): error C3861: “StaticClass”: 找不到标识符
    1>ERROR : UBT error : Failed to produce item: C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\Binaries\Win64\UE4Editor-SurvivalGame.dll
    1>Total build time: 2.78 seconds (Local executor: 0.00 seconds)
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: 命令“E:\unrealEngin\UE_4.18\Engine\Build\BatchFiles\Build.bat SurvivalGameEditor Win64 Development "C:\survivalGame\EpicSurvivalGameSeries\SurvivalGame\SurvivalGame.uproject" -waitmutex”已退出,代码为 5。请验证您是否拥有运行此命令的足够权限。
    how can i solve it .. is it about hot reload? i hope you can have a look..

    Leave a comment:


  • replied
    hello,everybody。
    I'm an unreal rookie, and i want start my unreal learning from this project.
    so , my first question is,can this project export an mobile version?
    because my gold is unreal mobile develop!

    in the end, sorry for my poor english. because i'm chinese!

    Leave a comment:


  • replied
    There is a lot not working for 4.16 and 4.17 with this.

    Leave a comment:


  • replied
    Hello!

    I have problem with UE4Editor-SurvivalGame.dll, and the rebuild.

    I use the 4.16 and start the rebuild, and i have a error:
    SurvivalGame could not be compiled. Try rebuild from source manually.
    How can I fixed this error/problem?

    Leave a comment:


  • replied
    It is awesome for me I don't like tutorials so this is perfect piece of code to look into when i don't know how to do something in my noobie project

    Leave a comment:


  • replied
    Hi Tom, how do you add extra weapons like pistols/rifle/melee?

    Leave a comment:


  • replied
    Hiho!

    Im trying to learn a bit using the project, and cannot set up proper headshot&limb damage for the player (i enabled pvp damage). Any help on why it doesnt work would be appreciated.
    1. I added 2 new surface types in project settings for player head and limbs
    2. Added 2 new physical materials cloning PlayerBody, and set the new surfaces there
    3. Changed in player's PhysicsAsset head and limb surface - click on head at 3d model, set playerhead material for simple collision physical material
    4. For PlayerPawn set collision preset to custom, enable (query and physics), object type to Pawn, and set weapon at trace responses to block.
    4. Changed some code:
    SurvivalGame.h:
    Code:
    #define SURFACE_PLAYERHEAD          SurfaceType5
    #define SURFACE_PLAYERLIMB          SurfaceType6
    SWeaponInstant.cpp, changed DealDamage function a bit:

    Code:
           ...
    	if (PhysMat && DmgType)
    	{
    		if (PhysMat->SurfaceType == SURFACE_ZOMBIEHEAD || PhysMat->SurfaceType == SURFACE_PLAYERHEAD)
    		{		
    			ActualHitDamage *= DmgType->GetHeadDamageModifier();	
    		}
    		else if (PhysMat->SurfaceType == SURFACE_ZOMBIELIMB || PhysMat->SurfaceType == SURFACE_PLAYERLIMB)
    		{
    			ActualHitDamage *= DmgType->GetLimbDamageModifier();		
    		}
    	}
    Last edited by valen.ce; 06-08-2017, 03:29 PM.

    Leave a comment:

Working...
X