Access violation after building C++ FPS template with no changes

#1
Hey guys, I am getting an access violation in the C++ FPS template. I have not made a single change. All I did was generate the solution(VS2015 x64), build it and run "GameLauncher"(no warnings no errors reported by compiler/linker). It crashes in Player.cpp line 40

Code: Select all

m_idleFragmentId = m_pAnimationComponent->GetFragmentId("Idle");
The last message in the Output window is:

Code: Select all

this->m_pAnimationComponent->m_pControllerDefinition was nullptr.
If I copy Game.dll from C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\Templates\cpp\FirstPersonShooter\bin\win_x64 it works again so something is wrong with my build. If the github source is valid, It seems like I am not getting into the branch that assigns m_pControllerDefinition but according to the debugger both m_defaultScopeSettings.m_controllerDefinitionPath and m_databasePath.value have valid strings in them so I don't understand why I am not getting CryWarning() messages or m_pControllerDefinition assigned to something.

Win 10 64 bit
VS 2015 Express
Cryengine 5.4

Here is the entire log from the Output window:

Spoiler!  Show

Any idea what I am doing wrong?

EDIT: Only in release mode. Debug and Profile appear to work.
Last edited by thehankinator on Sun May 20, 2018 6:50 pm, edited 1 time in total.

Re: Access violation after building C++ FPS template with no changes

#3
I am absolutely positive I have made no changes at all. To be sure of this, I validated the engine through CRYENGINE Launcher, created a new C++ FPS project, build solution and run GameLauncher project. Crashes in the same spot with same messages.
I did not change a single character of Player.cpp(or any file for that matter) and it has the following line:

Code: Select all

m_pAnimationComponent->SetControllerDefinitionFile("Animations/Mannequin/ADB/FirstPersonControllerDefinition.xml");
I verified that the controller definition exists at

Code: Select all

C:\Users\thehankinator\Documents\CRYENGINE Projects\BuildTest2\Assets\Animations\Mannequin\ADB\FirstPersonControllerDefinition.xml
and contains

Spoiler!  Show

Re: Access violation after building C++ FPS template with no changes

#4
And no changes within assets were made too ?
Damn.. it's very common error actually and it always refers to missing or broken files. Is this 5.5 ? Where is LoadFromDisk function called ? Before or after the problematic statement ?
Did you try to use vs 2015 community instead of express? I've heard that many people experience issues with express version..
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Access violation after building C++ FPS template with no changes

#5
Not changing anything at all, not even assets. I am creating the C++ FPS template and trying to use it as is.

I uninstalled 2015 express, then installed 2015 community. Unfortunately it still crashes in the same spot with the same message. For the record, I did delete the "solution" directory and regenerated the project file after installing 2015 community.

I have discovered that Debug and Profile targets do NOT crash however Release still crashes (previously I thought Debug and Profile didn't work because I had built it but didn't know it wouldn't copy Game.dll unless you did rebuild or had changes to build).

Am I making a mistake using Cryengine 5.4? Is there a more stable version?

Really bummed out about this since I was finally getting to the point where I could actually do things with the engine...

Re: Access violation after building C++ FPS template with no changes

#6
Good that it works in profile and debug mode. I'm not sure why release mode fails. Maybe this is a known issue, don't know. Because I have never built 5.4 in release mode. However I use 5.5 a lot now, and it builds in release mode just perfect, so maybe check that out, 5.5 is quite stable even at the current stage, so it is worth trying.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Access violation after building C++ FPS template with no changes

#7
I'm still trying to get this to work, I noticed a couple things that I am not sure are right.

1) Running the "INSTALL" project from VS2015 errors out, complaining that boost is missing. Same failure in Debug and Release mode. Log output below. I did verify that there is no boost directory inside C:/Program Files (x86)/Crytek/CRYENGINE Launcher/Crytek/CRYENGINE_5.4/Code/SDKs.

Spoiler!  Show

2) In C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\bin I have a win64 and win64_release directory. Contained win64 directory there are lots of dlls and exes. These appear to be the binaries that run Game.dll. Debug binaries maybe? The win64_release directory however, only contains a single .dll file (CryScaleformHelper.dll). Is this correct?

Re: Access violation after building C++ FPS template with no changes

#8
And one more thing, I tried adding prints to Player.cpp to try and figure out what is going on. I added this around m_pAnimationComponent->LoadFromDisk():

Spoiler!  Show

The Result prints at run-time produce:

Spoiler!  Show

So both m_defaultScopeSettings.m_controllerDefinitionPath and m_databasePath.value contain valid strings. Below is what CAdvancedAnimationComponent::LoadFromDisk() looks like(trimmed) according to c:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\Code\CryPlugins\CryDefaultEntities\Module\DefaultComponents\Geometry\AdvancedAnimationComponent.h. When executing this function, 1 of 2 things must happen, either m_pControllerDefinition is assigned nullptr and a CryWarning() is printed (and we return early) or m_pControllerDefinition is non-nullptr. I am getting a nullptr but no CryWarning() message so wtf? It really seems like CAdvancedAnimationComponent::LoadFromDisk() in C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\bin\win_x64\CryDefaultEntities.dll differs from what is in the provided AdvancedAnimationComponent.h.

Spoiler!  Show

Re: Access violation after building C++ FPS template with no changes

#9
I stumbled on this today(emphasis mine):
The Game Code solution can always be compiled in either Debug or Profile configuration. Compiling the Release configuration requires the access to full engine source code.
http://docs.cryengine.com/display/CEPRO ... Game+Code#

Is that page current? It seems out of date, referencing v3.X versions of the engine. It talks about using WAF to generate solution/project files but everything I've read/seen/used previously uses cmake to generate the solution/project files.

Maybe the restriction to having full engine source code to build release is still in place?

I've also found this page for creating a package to release to end users. It mentions copying files that are in the win64_release directory but as I posted previously this directory contains a single DLL on my system.

http://docs.cryengine.com/display/CEPRO ... V+projects

It seems like I am missing something, stuff in win64_release or a better understanding of how CryEngine handles release builds of Game.dll or both or more than that.

Re: Access violation after building C++ FPS template with no changes

#10
One thing to check is if you are debugging your code, you may get strange steps that seem to have wrong values or skipping/reusing code due to optimization flags used at compile time.
You can disable all optimizations for a specific function by putting the following line above the function definition:

Code: Select all

#pragma optimize("", off)
Regarding WAF, this is indeed old documentation. Most functions now reside in the .cryproject context menu (Right-Click menu of your .cryproject file). Such as Generate Solution, and Package Build.

If you want to compile the engine yourself, please take a look at the new documentation you can find here:
http://docs.cryengine.com/display/CEPRO ... ource+Code

Full engine source code is available since 5.0, and Sandbox source code is also available since 5.5. You should find no restrictions extending the engine or developing the C++ side of your game.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron