Customizing the Player
Adding custom behavior to the Player
The Player
that comes with your copy of Gameface allows for some level of customization. You can find the Player.exe
inside the CoherentSample/Apps
directory.
You can modify the settings of the Player
executable that comes with your copy of Gameface. This functionality is useful for testing various features that require additional implementation on the engine side of your game – such as Localization.
The custom settings are loaded through a Dynamic Link Library, called PlayerOverrides.dll
. Gameface comes with a PlayerOverrides
Microsoft Visual Studio solution file (located under CoherentSample/Apps/
PlayerOverrides
) that will allow you to automatically generate and use this dynamic library with the desired settings.
Changing the Root Directory
Before you can use the solution file to create, or make changes to the PlayerOverrides.dll
, you first need to properly set up the root directory of Unreal Engine (or your Game project, depending on where your Gameface plugin resides).
- Open your project in Microsoft Visual Studio and navigate to the
Property Manager
. - Open the
PlayerOverrides
Property Sheet
.
- Double-click on the
PlayerOverrides
Property Sheet
and open theUser Macros
menu.
- From there you should set:
- The
EngineDir
to point to the “Engine” directory of your Unreal Engine installation. - The
GameRootDir
to point to the root of your game project (the one that contains your.uproject
file)
- The
Below you can see an example of how these properties might look like after implementing this change.
CoherentSample/Apps/PlayerOverrides/PlayerOverrides/PlayerOverrides.props
and modifying the properties by hand.Implementing Changes
- Open the
PlayerOverrides.sln
file. The file is located in theCoherentSample/Apps/PlayerOverrides
directory. - Use the
CohtmlOverrides
interface in thePlayerOverrides.cpp
file to achieve your desired behavior. - Compile and start the project.
- The solution will build and copy the
PlayerOverrides.dll
to the directory of yourPlayer.exe
.
"Player Overrides Initialized"
should appear in the console after starting the Player
, if the Player.exe
has successfully loaded the PlayerOverrides.dll
library. If such a message does not appear, make sure PlayerOverrides.dll
is located inside the same folder as Player.exe
, and that you have correctly followed the instructions above.Saving and Removing Modifications
Preserving or applying different sets of overrides for different cases is just a matter of placing different PlayerOverrides.dll
files next to your Player.exe
.