Interface which exposes the CryAction subsystems
struct IGameFramework { };
IGameFramework.h
virtual ~IGameFramework();
virtual void AddBreakEventListener(IBreakEventListener * pListener) = 0;
Adds a listener for break events
virtual IGameFramework::TimerID AddTimer(CTimeValue interval, bool repeat, TimerCallback callback, void* userdata = 0) = 0;
Adds a timer that will trigger a callback function passed by parameter. Allows to pass some user data pointer that will be one of the parameters for the callback function. The signature for the callback function is: void (void*, int). It allows member functions by using CE functors
It returns the handle to the timer created
virtual void AllowLoad(bool bAllow = true) = 0;
virtual void AllowSave(bool bAllow = true) = 0;
virtual void ApplySingleProceduralBreakFromEventIndex(uint16 uBreakEventIndex, const SRenderNodeCloneLookup& renderNodeLookup) = 0;
For the kill cam: apply a single break event from an index
virtual void BeginLanQuery() = 0;
Begin a query on the LAN for games
virtual bool BlockingSpawnPlayer() = 0;
For the editor: spawn a player and wait for connection
virtual bool CanCheat() = 0;
Check if the current game can activate cheats (flymode, godmode, nextspawn)
virtual bool CanLoad() = 0;
virtual bool CanSave() = 0;
virtual bool ChangeGameContext(const SGameContextParams * pGameContextParams) = 0;
Parameters |
Description |
const SGameContextParams * pGameContextParams |
parameters for configuring the context |
true if successful
Changes a game context (levels and rules, etc); only allowed on the server
VIRTUAL void ClearNextFrameCommand() = 0;
virtual void CloneBrokenObjectsAndRevertToStateAtTime(int32 iFirstBreakEventIndex, uint16 * pBreakEventIndices, int32& iNumBreakEvents, IRenderNode** outClonedNodes, int32& iNumClonedNodes, SRenderNodeCloneLookup& renderNodeLookup) = 0;
For the kill cam : clone the list of objects specified in the break events indexed
Complete initialization of game framework with things that can only be done after all entities have been registered.
virtual bool CompleteInit() = 0;
virtual IDebugHistoryManager* CreateDebugHistoryManager() = 0;
virtual ITweakMenuController* CreateITweakMenuController() = 0;
Returns a pointer to the new ITweakMenuController interface
DECLARE_GAMEOBJECT_FACTORY(ILoadGame);
DECLARE_GAMEOBJECT_FACTORY(ISaveGame);
DECLARE_GAMEOBJECTEXTENSION_FACTORY(Actor);
DECLARE_GAMEOBJECTEXTENSION_FACTORY(GameObjectExtension);
DECLARE_GAMEOBJECTEXTENSION_FACTORY(Item);
DECLARE_GAMEOBJECTEXTENSION_FACTORY(Vehicle);
virtual void DelegateAuthority(EntityId entityId, uint16 channelId) = 0;
Wrapper for INetContext::DelegateAuthority()
virtual void DumpMemInfo(const char* format, ...);
virtual void EnableVoiceRecording(const bool enable) = 0;
virtual void EndCurrentQuery() = 0;
End the current game query
virtual void EndGameContext() = 0;
Finished a game context (no game running anymore)
virtual void ExecuteCommandNextFrame(const char*) = 0;
Executes console command on next frame's beginning
virtual void FlushBreakableObjects() = 0;
Remove broken entity parts
virtual const char * GetAbsLevelPath(char*const pPath, const uint32 cPathMaxLen) = 0;
0 if no level is loaded
OUTDATED: Description: OUTDATED: absolute because downloaded content might anywhere OUTDATED: e.g. "c:/MasterCD/Game/Levels/Testy"
relative to the MasterCD folder e.g. "game/levels/!Code/AutoTest0"
virtual IActor * GetClientActor() const = 0;
Returns the Actor associated with the client (or NULL)
virtual EntityId GetClientActorId() const = 0;
Returns the Actor Id associated with the client (or NULL)
virtual INetChannel * GetClientChannel() const = 0;
Returns the INetChannel associated with the client (or NULL)
virtual IEntity* GetClientEntity() const = 0;
Returns the Entity associated with the client (or NULL)
virtual EntityId GetClientEntityId() const = 0;
Returns the EntityId associated with the client (or NULL)
virtual INetNub * GetClientNetNub() = 0;
virtual void GetEditorLevel(char ** levelName, char ** levelFolder) = 0;
Retrieves the current level loaded by the editor.
virtual uint16 GetGameChannelId(INetChannel * pNetChannel) = 0;
The Game Server ChannelId associated with the specified INetChannel.
Retrieve the Game Server Channel Id associated with the specified INetChannel.
virtual const char* GetGameGUID() = 0;
virtual IGameObject * GetGameObject(EntityId id) = 0;
Pointer to IGameObject of the entity if it exists (or NULL otherwise)
Retrieve an IGameObject from an entity id
virtual IActionMapManager * GetIActionMapManager() = 0;
Pointer to IActionMapManager interface.
Returns a pointer to the IActionMapManager interface.
virtual IActorSystem * GetIActorSystem() = 0;
Pointer to IActorSystem interface.
Returns a pointer to the IActorSystem interface.
virtual IBreakReplicator * GetIBreakReplicator() = 0;
Pointer to IBreakReplicator interface.
Returns a pointer to the IBreakReplicator interface.
virtual ICheckpointSystem* GetICheckpointSystem() = 0;
Pointer to ICheckpointSystem interface.
virtual ICommunicationVoiceLibrary* GetICommunicationVoiceLibrary() const;
virtual ICooperativeAnimationManager* GetICooperativeAnimationManager() = 0;
Pointer to ICooperativeAnimationManager interface.
virtual ICustomActionManager* GetICustomActionManager() const = 0;
Pointer to ICustomActionManager interface.
virtual ICustomEventManager* GetICustomEventManager() const = 0;
Pointer to ICustomEventManager interface.
virtual IDialogSystem * GetIDialogSystem() = 0;
Pointer to IDialogSystem interface.
Returns a pointer to the IDialogSystem interface
virtual IEffectSystem * GetIEffectSystem() = 0;
Pointer to IEffectSystem interface.
Returns a pointer to the IEffectSystem interface
virtual IFlowSystem * GetIFlowSystem() = 0;
Pointer to IFlowSystem interface.
Returns a pointer to the IFlowSystem interface.
virtual IForceFeedbackSystem* GetIForceFeedbackSystem() const = 0;
Pointer to IForceFeedbackSystem interface.
virtual IGameObjectSystem * GetIGameObjectSystem() = 0;
Pointer to IGameObjectSystem interface.
Returns a pointer to the IGameObjectSystem interface.
virtual IGameplayRecorder * GetIGameplayRecorder() = 0;
Pointer to IGameplayRecorder interface.
Returns a pointer to the IGameplayRecorder interface.
virtual IGameRulesSystem * GetIGameRulesSystem() = 0;
Pointer to IGameRulesSystem interface.
Returns a pointer to the IGameRulesSystem interface.
virtual IGameSessionHandler* GetIGameSessionHandler() = 0;
virtual IGameStatistics* GetIGameStatistics() = 0;
Returns a pointer to the IGameStatistics interface
virtual IGameTokenSystem * GetIGameTokenSystem() = 0;
Pointer to IGameTokenSystem interface.
Returns a pointer to the IGameTokenSystem interface
virtual IGameVolumes* GetIGameVolumesManager() const = 0;
Retrieves manager which handles game objects tied to editor shapes and volumes
virtual IItemSystem * GetIItemSystem() = 0;
Pointer to IItemSystem interface.
Returns a pointer to the IItemSystem interface.
virtual ILanQueryListener * GetILanQueryListener() = 0;
Pointer to ILanQueryListener interface.
Retrieve a pointer to the ILanQueryListener interface
virtual ILevelSystem * GetILevelSystem() = 0;
Pointer to ILevelSystem interface.
Returns a pointer to the ILevelSystem interface.
virtual IMaterialEffects * GetIMaterialEffects() = 0;
Pointer to IMaterialEffects interface.
Returns a pointer to the IMaterialEffects interface.
virtual IPersistantDebug * GetIPersistantDebug() = 0;
virtual IPlayerProfileManager * GetIPlayerProfileManager() = 0;
Pointer to IPlayerProfileManager interface.
Returns a pointer to the IPlayerProfileManager interface.
virtual IRealtimeRemoteUpdate * GetIRealTimeRemoteUpdate() = 0;
returns a pointer to the IRealtimeUpdate Interface
virtual ISharedParamsManager * GetISharedParamsManager() = 0;
Get pointer to Shared Parameters manager interface class.
virtual ISubtitleManager * GetISubtitleManager() = 0;
Pointer to ISubtitleManager interface.
Returns a pointer to the ISubtitleManager interface.
virtual ISystem * GetISystem() = 0;
Pointer to ISystem interface.
Returns a pointer to the ISystem interface.
virtual IUIDraw * GetIUIDraw() = 0;
Pointer to IUIDraw interface.
Returns a pointer to the IUIDraw interface.
virtual IVehicleSystem * GetIVehicleSystem() = 0;
Pointer to IVehicleSystem interface.
Returns a pointer to the IVehicleSystem interface.
virtual IViewSystem * GetIViewSystem() = 0;
Pointer to IViewSystem interface.
Returns a pointer to the IViewSystem interface.
virtual IVisualLog * GetIVisualLog() = 0;
Pointer to IIVisualLog interface.
Returns a pointer to the IVisualLog interface.
virtual const char * GetLevelName() = 0;
path relative to the levels folder e.g. "MultiplayerPSShore"
VIRTUAL float GetLoadSaveDelay() const = 0;
Get the time left when we are allowed to load a new game When this returns 0, we are allowed to load a new game
virtual IMannequin & GetMannequinInterface() = 0;
virtual void GetMemoryUsage(ICrySizer * pSizer) const = 0;
virtual INetChannel * GetNetChannel(uint16 channelId) = 0;
Pointer to INetChannel associated with the specified Game Server Channel Id.
Retrieve a pointer to the INetChannel associated with the specified Game Server Channel Id.
virtual INetContext * GetNetContext() = 0;
virtual bool GetNetworkSafeClassId(uint16 & id, const char * className) = 0;
true if an entity class with this name has been registered
Retrieve a network safe entity class id, that will be the same in client and server
virtual bool GetNetworkSafeClassName(char * className, size_t maxn, uint16 id) = 0;
true if an entity class with this id has been registered
Retrieve a network safe entity class name, that will be the same in client and server
VIRTUAL const char* GetNextFrameCommand() const = 0;
virtual uint32 GetPreUpdateTicks() = 0;
Return ticks last preupdate took
virtual ISerializeHelper* GetSerializeHelper() const = 0;
Gets a serialization helper for read/write usage based on settings
virtual INetNub * GetServerNetNub() = 0;
virtual CTimeValue GetServerTime() = 0;
Returns the (synched) time of the server (so use this for timed events, such as MP round times)
Initialize CryENGINE with every system needed for a general action game. Independently of the success of this method, Shutdown must be called.
virtual bool Init(SSystemInitParams & startupParams) = 0;
Parameters |
Description |
SSystemInitParams & startupParams |
Pointer to SSystemInitParams structure containing system initialization setup! |
0 if something went wrong with initialization, non-zero otherwise.
virtual void InitEditor(IGameToEditorInterface* pGameToEditor) = 0;
Let the GameFramework initialize with the editor
virtual void InitGameType(bool multiplayer, bool fromInit) = 0;
Used to notify the framework that we're switching between single and multi player
virtual bool IsChannelOnHold(uint16 channelId) = 0;
Returns true if the specified game server channel has lost connection but it's stil able to recover...
Check if the game server channel has lost connection but still on hold and able to recover...
virtual bool IsEditing() = 0;
virtual bool IsGamePaused() = 0;
true - if the game is pause, false - otherwise
Returns the pause status
virtual bool IsGameSession(CrySessionHandle sessionHandle) = 0;
Returns true if the supplied game session is a game session
virtual bool IsGameStarted() = 0;
Are we completely into game mode?
virtual bool IsImmersiveMPEnabled() = 0;
virtual bool IsInLevelLoad() = 0;
virtual bool IsInTimeDemo() = 0;
virtual bool IsLevelPrecachingDone() const = 0;
Check if the game is allowed to start the actual gameplay
virtual bool IsLoadingSaveGame() = 0;
virtual bool IsTimeDemoRecording() = 0;
virtual bool IsVoiceRecordingEnabled() = 0;
Check whether the client actor is using voice communication.
virtual ELoadGameResult LoadGame(const char * path, bool quick = false, bool ignoreDelay = false) = 0;
Load a game from disk (calls StartGameContext...)
virtual void MutePlayerById(EntityId mutePlayer) = 0;
virtual void OnBreakageSpawnedEntity(IEntity* pEntity, IPhysicalEntity* pPhysEntity, IPhysicalEntity* pSrcPhysEntity) = 0;
Inform that an IEntity was spawned from breakage
virtual void OnEditorSetGameMode(int iMode) = 0;
Notification that game mode is being entered/exited iMode values: 0-leave game mode, 1-enter game mode, 3-leave AI/Physics mode, 4-enter AI/Physics mode
virtual void PauseGame(bool pause, bool force, unsigned int nFadeOutInMS = 0) = 0;
Parameters |
Description |
bool pause |
Boolean describing if it's pausing or not. |
unsigned int nFadeOutInMS = 0 |
Time SFX and Voice will be faded out over in MilliSec. |
Pauses the game
virtual void PostUpdate(bool haveFocus, unsigned int updateFlags) = 0;
Parameters |
Description |
bool haveFocus |
Boolean describing if the game has the input focus or not. |
unsigned int updateFlags |
Flags specifying how to update. |
Updates CryENGINE after a game frame.
virtual void PrefetchLevelAssets(const bool bEnforceAll) = 0;
Parameters |
Description |
const bool bEnforceAll |
true to ensure all possible assets become registered (list should not be too conservative - to support level stripification) |
to avoid stalls during gameplay and to get a list of all assets needed for the level (bEnforceAll=true)
virtual void PreloadAnimatedCharacter(IScriptTable* pEntityScript) = 0;
virtual void PrePhysicsTimeStep(float deltaTime) = 0;
Parameters |
Description |
float deltaTime |
the time interval that will be simulated |
Gets called from the physics thread just before doing a time step.
virtual bool PreUpdate(bool haveFocus, unsigned int updateFlags) = 0;
Parameters |
Description |
bool haveFocus |
Boolean describing if the game has the input focus or not. |
unsigned int updateFlags |
Flags specifying how to update. |
0 if something went wrong with initialization, non-zero otherwise.
Updates CryENGINE before starting a game frame.
virtual IGameObjectExtension * QueryGameObjectExtension(EntityId id, const char * name) = 0;
Pointer to IGameObjectExtension of the entity if it exists (or NULL otherwise)
Retrieve an IGameObjectExtension by name from an entity
virtual void RegisterListener(IGameFrameworkListener * pGameFrameworkListener, const char * name, EFRAMEWORKLISTENERPRIORITY eFrameworkListenerPriority) = 0;
virtual void ReleaseGameStats() = 0;
virtual void RemoveBreakEventListener(IBreakEventListener * pListener) = 0;
Removes a listener for break events
virtual void* RemoveTimer(TimerID timerID) = 0;
Remove an existing timer by using its handle, returns user data
virtual void Reset(bool clients) = 0;
Resets the current game
virtual void ResetBrokenGameObjects() = 0;
For the game : fix the broken game objects (to restart the map)
virtual bool SaveGame(const char * path, bool quick = false, bool bForceImmediate = true, ESaveGameReason reason = eSGR_QuickSave, bool ignoreDelay = false, const char* checkPoint = NULL) = 0;
Save the current game to disk
virtual bool SaveServerConfig(const char* path) = 0;
Saves dedicated server console variables in server config file
virtual void ScheduleEndLevelNow(const char* nextLevel) = 0;
Schedules the level load for the next level
virtual void SetEditorLevel(const char * levelName, const char * levelFolder) = 0;
Inform the GameFramework of the current level loaded in the editor.
virtual void SetGameGUID(const char * gameGUID) = 0;
virtual void SetGameSessionHandler(IGameSessionHandler* pSessionHandler) = 0;
Sets the current game session handler to another implementation.
virtual void SetLevelPrecachingDone(bool bValue) = 0;
Inform game that it is allowed to start the gameplay
virtual bool ShouldMigrateNub(CrySessionHandle sessionHandle) = 0;
Returns true if the nub should be migrated for a given session
virtual void ShowPageInBrowser(const char* URL) = 0;
Opens a page in default browser
virtual void Shutdown() = 0;
Shuts down CryENGINE and any other subsystem created during initialization.
virtual bool StartedGameContext() const = 0;
true if a game context is running
Detect if a context is currently running
virtual bool StartGameContext(const SGameStartParams * pGameStartParams) = 0;
Parameters |
Description |
const SGameStartParams * pGameStartParams |
parameters for configuring the game |
true if successful
Initialises a game context
virtual bool StartingGameContext() const = 0;
true if a game context is starting
Detect if a context is currently starting
virtual void StartNetworkStallTicker(bool includeMinimalUpdate) = 0;
Allows the network code to keep ticking in the event of a stall on the main thread.
virtual bool StartProcess(const char* cmd_line) = 0;
Opens a page in default browser
virtual void StopNetworkStallTicker() = 0;
virtual void UnhideBrokenObjectsByIndex(uint16 * ObjectIndicies, int32 iNumObjectIndices) = 0;
For the game : unhide the broken game objects (at the end of the kill cam)
virtual void UnregisterListener(IGameFrameworkListener * pGameFrameworkListener) = 0;
Entry function to the game framework
typedef IGameFramework * (* TEntryFunction)();
a new instance of the game framework
Entry function used to create a new instance of the game framework from outside its own DLL.
typedef Functor2<void*, TimerID> TimerCallback;
typedef uint32 TimerID;