Main interface used for the game central object
struct IGame { struct ExportFilesInfo { }; };
IGame.h
The IGame interface should be implemented in the GameDLL. Game systems residing in the GameDLL can be initialized and updated inside the Game object.
IEditorGame
struct ExportFilesInfo { };
IGame.h
ExportFilesInfo(const char* _baseFileName, const uint32 _fileCount);
const char* GetBaseFileName() const;
uint32 GetFileCount() const;
static void GetNameForFile(const char* baseFileName, const uint32 fileIdx, char outputName[512]);
virtual ~IGame();
virtual uint32 AddGameWarning(const char* stringId, const char* paramMessage, IGameWarningsListener* pListener = NULL) = 0;
A unique handle to the warning or 0 for any error.
Add a game warning that is shown to the player
virtual bool CompleteInit();
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.
virtual IGameStateRecorder* CreateGameStateRecorder(IGameplayListener* pL) = 0;
creates a GameStateRecorder instance in GameDll and passes its ownership to the caller (CryAction/GamePlayRecorder)
virtual IGame::TSaveGameName CreateSaveGameName() = 0;
c_str or NULL
Auto-Savegame name creation
virtual const bool DoInitialSavegame() const = 0;
true or false
Query whether an initial levelstart savegame should be created.
virtual void EditorResetGame(bool bStart) = 0;
Parameters |
Description |
bool bStart |
Boolean describing if we enter or exit game mode |
Called on the game when entering/exiting game mode in editor
virtual IGame::ExportFilesInfo ExportLevelData(const char* levelName, const char* missionName) const = 0;
Editor export interface hook, to allow the game to export its own data into the level paks Return: Exported file information
virtual void FullSerialize(TSerialize ser) = 0;
virtual bool GameEndLevel(const char* stringId) = 0;
false, if the level end should continue true, if the game handles the end level action and calls ScheduleEndLevel directly
callback to game for game specific actions on level end
virtual IAntiCheatManager * GetAntiCheatManager() = 0;
Returns the anticheat system interface
virtual const char* GetDRMFileList();
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.
virtual const uint8* GetDRMKey(uint32 * pKeySize);
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
virtual IGameFramework * GetIGameFramework() = 0;
Pointer to the game framework being used.
Returns a pointer to the game framework being used.
virtual IGamePhysicsSettings* GetIGamePhysicsSettings() = 0;
Retrieve interface for the IGamePhysicsSettings
virtual const char * GetLongName() = 0;
The name of the mode. (i.e.: "Capture The Flag")
Returns the name of the mode. (i.e.: "Capture The Flag")
virtual const char* GetMappedLevelName(const char * levelName) const = 0;
c_str or NULL
Mapping level filename to "official" name.
virtual void GetMemoryStatistics(ICrySizer * s) = 0;
virtual const char * GetName() = 0;
A short description of the mode. (i.e.: dc)
Returns a short description of the mode. (i.e.: dc)
virtual bool Init(IGameFramework * pFramework) = 0;
Parameters |
Description |
IGameFramework * pFramework |
Pointer to the IGameFramework interface. |
pCmdLine |
Pointer to the command line interface. |
0 if something went wrong with initialization, non-zero otherwise.
Initialize the MOD. The shutdown method, must be called independent of this method's return value.
virtual void LoadActionMaps(const char* filename) = 0;
Void
Loads a specified action map, used mainly for loading the default action map
virtual void LoadExportedLevelData(const char* levelName, const char* missionName) = 0;
Interface hook to load all game exported data when the level is loaded
virtual void OnClearPlayerIds() = 0;
Void
Called when playerID is reset in GameChannel
virtual void OnRenderScene(const SRenderingPassInfo & passInfo) = 0;
Called from 3DEngine in RenderScene, so polygons and meshes can be added to the scene from game
virtual void PlayerIdSet(EntityId playerId) = 0;
Parameters |
Description |
EntityId playerId |
The entity Id of the local player. |
Called on the game when the local player id is set.
virtual void PostSerialize() = 0;
virtual void RegisterGameFlowNodes() = 0;
called by FlowSystem to register all game specific flow nodes
virtual void RemoveGameWarning(const char* stringId) = 0;
Remove a game warning
virtual void RenderGameWarnings() = 0;
Render Game Warnings
virtual void SetUserProfileChanged(bool yesNo);
virtual void Shutdown() = 0;
Shuts down the MOD and delete itself.
virtual int Update(bool haveFocus, unsigned int updateFlags) = 0;
Parameters |
Description |
bool haveFocus |
Boolean describing if the game has the input focus or not. |
0 to terminate the game (i.e. when quitting), non-zero to continue
Updates the MOD.
Entry function used to initialize a new IGame of a GameMod
typedef IGame * (* TEntryFunction)(IGameFramework* pGameFramework);
Parameters |
Description |
pGameFramework |
a pointer to the game framework, from which a pointer of ISystem can be retrieved |
A pointer to the newly created IGame implementation
Type to represent saved game names, keeping the string on the stack if possible.
typedef CryStackStringT<char, 256> TSaveGameName;