You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ISceneObject have Updatable bool property and ComponentUpdateChainCall(GameTimeLoop gameTime) method. IGameClient implementation can call ComponentUpdateChainCall when game Update part (separated from drawing) is active. IGameClient implementation can check component update is possible by Updatable property (which default is 'true').
ComponentUpdateCompatibility
DungeonGlobal have ComponentUpdateCompatibility property. This property can be used by IGameClient implementation and target game for controlling Updatable check. It should be removed.
ComponentUpdateChainCall implementation
SceneObject call component Update() method
Elapsed calculated
Default frame-based animation calculated
AfterUpdate invoked
It's ok for now not use Update name of method at top of abstraction.
Dungeon.Monogame implementation
When Update part is active, implementation follows:
Controls update events (check block and scene switch)
For each layer.objects call UpdateComponent
If object is updatable, it calls ComponentUpdateChainCall
For each children calls UpdateComponent
Issue
Dungeon.Monogame implementation 2 and 4 - harm for performance. Its clearly seen when there are more than 10.000 components, and even on 1.5k components: Update method takes so long, that the FPS drops to 0.
Solution
All of this for Dungeon.Monogame:
Remove DungeonGlobal.ComponentUpdateCompatibility
Rename ComponentUpdateChainCall to ComponentUpdate
SceneObject Update system
ISceneObject have
Updatable
bool property andComponentUpdateChainCall(GameTimeLoop gameTime)
method.IGameClient
implementation can callComponentUpdateChainCall
when gameUpdate
part (separated from drawing) is active.IGameClient
implementation can check component update is possible byUpdatable
property (which default is 'true').ComponentUpdateCompatibility
DungeonGlobal
haveComponentUpdateCompatibility
property. This property can be used byIGameClient
implementation and targetgame
for controllingUpdatable
check. It should be removed.ComponentUpdateChainCall implementation
Update()
methodIt's ok for now not use
Update
name of method at top of abstraction.Dungeon.Monogame implementation
When
Update
part is active, implementation follows:UpdateComponent
ComponentUpdateChainCall
UpdateComponent
Issue
Dungeon.Monogame implementation 2 and 4 - harm for performance. Its clearly seen when there are more than 10.000 components, and even on 1.5k components:
Update
method takes so long, that the FPS drops to 0.Solution
All of this for
Dungeon.Monogame
:DungeonGlobal.ComponentUpdateCompatibility
ComponentUpdateChainCall
toComponentUpdate
ISceneLayer
propertyISceneObject[] Updatables {get;}
(name optional)ISceneLayer
voidAddUpdatable()
GameClient.UpdateLoop:24
iterate bySceneLayer.Updatables
GameClient.UpdateComponent
recursive call for childrenNew update logic
When
ISceneLayer.AddObject
called, check forUpdatable
and if it is, add to array. (perfer way is resize array, not asSceneLayer.Objects
prop)New add updatable logic
For composited objects in composition tree (e.g.
AddObject
inside ISceneObject) do likeSceneControl.AddControl
works:AddObject
callUpdatable
ISceneLayer.AddUpdatable
SceneLayer
check for duplicates etc, resize arrayOptional:
ISceneLayer.Updatable
propertyScene.AddLayer(..., bool updatable=false)
GameClient.Update
check for scene is updatableImportant
The text was updated successfully, but these errors were encountered: