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

#11
Hi Flare, thanks for taking a look at my problem. I added the pragma as you suggested but I wasn't able to get anymore information. I did tinker with it a bit more and I added a print after about line 26 so it looks like:
m_pAnimationComponent->SetCharacterFile("Objects/Characters/SampleCharacter/firstperson.cdf");
CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "SetCharacterFile = %#010x", m_pAnimationComponent->SetCharacterFile());

When running GameLauncher project it prints out:
<19:31:50> [Warning] SetCharacterFile = 0x00000001

Debugger confirms that m_characterFile has a value of 1. Which looks way wrong, something has to be screwed up at a fundamental level since according to github source for CAdvancedAnimationComponent::SetCharacterFile(const char* szPath) it simply assigns m_characterFile to szPath. I tried building a package with "Package build" from right clicking on Game.cryproject after building Game.dll in release mode but then executing GameLauncher.exe but it still crashed. I should be able to run GameLauncher.exe with Game.dll built in release mode, right? I didn't want to build the entire engine (since I am just getting started with CryEngine) but is that required in order to get a release build of Game.dll working? This really feels like a bad or incompatible build of CryDefaultEntities.dll or something. Are there are other people out there using CryEngine 5.4 building Game.dll in release mode? Am I doing something weird or wrong?

PS
In AdvancedAnimationComponent.h the function for setting the character file is void SetCharacterFile(const char* szPath) and the function for retrieving the character file path is has the same name(different signature of course) const char* SetCharacterFile(). I think it is suppose to be const char* GetCharacterFile()

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

#12
I thought of a couple other things I could try.

First - I generated an x86 project instead of x64. I did remember to update the Game.cryproject to point to the x86 Game.dll. Exact same symptoms, no crash in Debug but crashed in Release (same spot).
Second - I downloaded 5.5 preview 3. That actually worked in Release mode.

It's always possible I got something messed up but it really seems like 5.4 is broken. Is it abnormal to use CRYENGINE Launcher to download 5.4 and modify Game.dll to make a game? Has anyone gotten the C++ FPS template to work in release mode with CryEngine 5.4? Surely I am not the only person trying to use 5.4....

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

#13
If you're using the engine from the CRYENGINE Launcher, than you have to use the right engine binaries with the right game binaries. By default the engine binaries found in C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.5\bin\win_x64\ are build in profile configuration. That means that if you use those with a game dll build in release configuration you will have a mismatch between the code which causes the access violation. So for general testing it's recommended to build in profile configuration.

If you want to run your game in release mode in preview 3, there are two ways of doing this. For both options first build your game dll in release configuration, and make sure the .cryproject file is pointing to that dll.
Next, right click the cryproject file and select Package Build. A new menu should show up after a short while, where you can select the location where your build will be copied to, and which configuration of the engine binaries to use. Make sure to select the release binaries, and package your build. You should now have a portable package of your game. This is the recommended way to test release builds.

The other option is to go into your engine folder and rename the bin/win_x64 to bin/win_x64_profile, and rename the bin/win_x64_release folder to bin/win_x64. Now if you run the gamelauncher from either Visual Studio or the cryproject file it will use the release binaries of the engine instead of the profile binaries. Keep in mind that the Sandbox is not compiled in release configuration, so you can never run game binaries made in a release configuration in the Sandbox.

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

#14
Hi Miron, thanks for clarifying the procedure for testing release builds. Does this also apply to CryEngine 5.4? C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\bin\win_x64_release contains a single .dll (CryScaleformHelper.dll) and win_x64_profile doesn't exist. None of the other *_release directories have more than that actually. I have verified and reinstalled 5.4 a number of times already so I don't know how what the path forward to test release with CryEngine 5.4 (from the launcher).

EDIT: To be clear I have tried to build a package with 5.4 after building Game.dll in release mode and it crashed in the same way as when running from the debugger.

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

#15
Hey there,

The Package build option for from the .cryproject context menu simply takes the binaries from the bin/win_x65 folder in the associated engine path. This means you still build your game in Profile configuration.
If you want to use release-built binaries you will need to build the engine source code from GitHub in release configuration also. Note that certain features will be locked in release (eg, certain CVars will be hard-coded).

Regarding your CryWarning, it looks off to me, I would say that it shouldn't compile, since you are using the wrong signature of the SetCharacterFile method (no arguments) that doesn't exist. As well as trying to get a value from a void return type to display as a hexidecimal number in the Warning. You cannot get the internal m_szPath from the Animation Component by calling this function, this only allows you to set the internal variable.

Make sure after you call SetCharacterFile(...), you also call LoadFromDisk() and ResetCharacter().

Let us know if you still have issues.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

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

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

#16
Hi Flare, you must have missed my PS on my post. The print works as it should. There appears to be a typo for that function(Set vs Get). Here is the code from the header file for SetCharacterFile().




virtual void SetCharacterFile(const char* szPath);
const char* SetCharacterFile() const { return m_characterFile.value.c_str(); }

Here is the file on GitHub containing the above code from CryEngine 5.4(matches my local copy).

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

#17
Sorry, I didn't notice you were using 5.4. We've started shipping release config binaries since the (preview) release of 5.5. So in 5.5 you can choose to use either release config or profile config binaries. If you want the same in 5.4 you would need to build the engine yourself using the source code from Github.

Also we fixed the typo in the SetCharacterFile shortly after we released 5.4, so in 5.5 they now have the right names.

Who is online

Users browsing this forum: No registered users and 3 guests