IGame

Main interface used for the game central object

C++
struct IGame {
  struct ExportFilesInfo {
  };
};
File

IGame.h

Description

The IGame interface should be implemented in the GameDLL. Game systems residing in the GameDLL can be initialized and updated inside the Game object.

See Also

IEditorGame

IGame::ExportFilesInfo Structure
C++
struct ExportFilesInfo {
};
File

IGame.h

IGame::ExportFilesInfo::ExportFilesInfo Constructor
C++
ExportFilesInfo(const char* _baseFileName, const uint32 _fileCount);
IGame::ExportFilesInfo::GetBaseFileName Method
C++
const char* GetBaseFileName() const;
IGame::ExportFilesInfo::GetFileCount Method
C++
uint32 GetFileCount() const;
IGame::ExportFilesInfo::GetNameForFile Method
C++
static void GetNameForFile(const char* baseFileName, const uint32 fileIdx, char outputName[512]);
IGame::~IGame Destructor
C++
virtual ~IGame();
IGame::AddGameWarning Method
C++
virtual uint32 AddGameWarning(const char* stringId, const char* paramMessage, IGameWarningsListener* pListener = NULL) = 0;
Returns

A unique handle to the warning or 0 for any error.

Description

Add a game warning that is shown to the player

IGame::CompleteInit Method
C++
virtual bool CompleteInit();
Description

Finish initializing the MOD. Called after the game framework has finished its CompleteInit. This is the point at which to register game flow nodes etc.

IGame::CreateGameStateRecorder Method
C++
virtual IGameStateRecorder* CreateGameStateRecorder(IGameplayListener* pL) = 0;
Description

creates a GameStateRecorder instance in GameDll and passes its ownership to the caller (CryAction/GamePlayRecorder)

IGame::CreateSaveGameName Method
C++
virtual IGame::TSaveGameName CreateSaveGameName() = 0;
Returns

c_str or NULL

Description

Auto-Savegame name creation

IGame::DoInitialSavegame Method
C++
virtual const bool DoInitialSavegame() const = 0;
Returns

true or false

Description

Query whether an initial levelstart savegame should be created.

IGame::EditorResetGame Method
C++
virtual void EditorResetGame(bool bStart) = 0;
Parameters
Parameters
Description
bool bStart
Boolean describing if we enter or exit game mode
Description

Called on the game when entering/exiting game mode in editor

IGame::ExportLevelData Method
C++
virtual IGame::ExportFilesInfo ExportLevelData(const char* levelName, const char* missionName) const = 0;
Description

Editor export interface hook, to allow the game to export its own data into the level paks Return: Exported file information

IGame::FullSerialize Method
C++
virtual void FullSerialize(TSerialize ser) = 0;
IGame::GameEndLevel Method
C++
virtual bool GameEndLevel(const char* stringId) = 0;
Returns

false, if the level end should continue true, if the game handles the end level action and calls ScheduleEndLevel directly

Description

callback to game for game specific actions on level end

IGame::GetAntiCheatManager Method
C++
virtual IAntiCheatManager * GetAntiCheatManager() = 0;
Description

Returns the anticheat system interface

IGame::GetDRMFileList Method
C++
virtual const char* GetDRMFileList();
Description

Returns a comma separated list of files to perform a DRM boot check on. You can return NULL to perform no checks but Sony TRCs require an encrypted HDD boot game to have at least one NPDRM EDATA encrypted file in the package. If the file is not present or the user cannot decrypt them, the game will display a TRC compliant error message and quit. Note that this is ONLY used on games that are specified as HDD Boot Games in their PARAM.SFO.

IGame::GetDRMKey Method
C++
virtual const uint8* GetDRMKey(uint32 * pKeySize);
Description

Returns the DRM key data used to decrypt a key file in a PS3 HDD boot game. Sony TRCs require at least one encrypted file to be present for DRM to be effective. This key is a 32 character user defined string and must match the key used to encrypt the list of files returned by GetDRMFileList

IGame::GetIGameFramework Method
C++
virtual IGameFramework * GetIGameFramework() = 0;
Returns

Pointer to the game framework being used.

Description

Returns a pointer to the game framework being used.

IGame::GetIGamePhysicsSettings Method
C++
virtual IGamePhysicsSettings* GetIGamePhysicsSettings() = 0;
Description

Retrieve interface for the IGamePhysicsSettings

IGame::GetLongName Method
C++
virtual const char * GetLongName() = 0;
Returns

The name of the mode. (i.e.: "Capture The Flag")

Description

Returns the name of the mode. (i.e.: "Capture The Flag")

IGame::GetMappedLevelName Method
C++
virtual const char* GetMappedLevelName(const char * levelName) const = 0;
Returns

c_str or NULL

Description

Mapping level filename to "official" name.

IGame::GetMemoryStatistics Method
C++
virtual void GetMemoryStatistics(ICrySizer * s) = 0;
IGame::GetName Method
C++
virtual const char * GetName() = 0;
Returns

A short description of the mode. (i.e.: dc)

Description

Returns a short description of the mode. (i.e.: dc)

IGame::Init Method
C++
virtual bool Init(IGameFramework * pFramework) = 0;
Parameters
Parameters
Description
IGameFramework * pFramework
Pointer to the IGameFramework interface.
pCmdLine
Pointer to the command line interface.
Returns

0 if something went wrong with initialization, non-zero otherwise.

Description

Initialize the MOD. The shutdown method, must be called independent of this method's return value.

IGame::LoadActionMaps Method
C++
virtual void LoadActionMaps(const char* filename) = 0;
Returns

Void

Description

Loads a specified action map, used mainly for loading the default action map

IGame::LoadExportedLevelData Method
C++
virtual void LoadExportedLevelData(const char* levelName, const char* missionName) = 0;
Description

Interface hook to load all game exported data when the level is loaded

IGame::OnClearPlayerIds Method
C++
virtual void OnClearPlayerIds() = 0;
Returns

Void

Description

Called when playerID is reset in GameChannel

IGame::OnRenderScene Method
C++
virtual void OnRenderScene(const SRenderingPassInfo & passInfo) = 0;
Description

Called from 3DEngine in RenderScene, so polygons and meshes can be added to the scene from game

IGame::PlayerIdSet Method
C++
virtual void PlayerIdSet(EntityId playerId) = 0;
Parameters
Parameters
Description
EntityId playerId
The entity Id of the local player.
Description

Called on the game when the local player id is set.

IGame::PostSerialize Method
C++
virtual void PostSerialize() = 0;
IGame::RegisterGameFlowNodes Method
C++
virtual void RegisterGameFlowNodes() = 0;
Description

called by FlowSystem to register all game specific flow nodes

IGame::RemoveGameWarning Method
C++
virtual void RemoveGameWarning(const char* stringId) = 0;
Description

Remove a game warning

IGame::RenderGameWarnings Method
C++
virtual void RenderGameWarnings() = 0;
Description

Render Game Warnings

IGame::SetUserProfileChanged Method
C++
virtual void SetUserProfileChanged(bool yesNo);
IGame::Shutdown Method
C++
virtual void Shutdown() = 0;
Description

Shuts down the MOD and delete itself.

IGame::Update Method
C++
virtual int Update(bool haveFocus, unsigned int updateFlags) = 0;
Parameters
Parameters
Description
bool haveFocus
Boolean describing if the game has the input focus or not.
Returns

0 to terminate the game (i.e. when quitting), non-zero to continue

Description

Updates the MOD.

IGame::TEntryFunction Nested Type

Entry function used to initialize a new IGame of a GameMod

C++
typedef IGame * (* TEntryFunction)(IGameFramework* pGameFramework);
Parameters
Parameters
Description
pGameFramework
a pointer to the game framework, from which a pointer of ISystem can be retrieved
Returns

A pointer to the newly created IGame implementation

IGame::TSaveGameName Nested Type

Type to represent saved game names, keeping the string on the stack if possible.

C++
typedef CryStackStringT<char, 256> TSaveGameName;