About Store Forum Documentation Contact
Donations:
227$/mo



Post Reply 
World Updates
Author Message
MrPi Offline
Member

Post: #1
World Updates
Hello,

I would like to get more information about the internals of updating the world and all its objects.

1) Could you please give a general picture of how and when objects are updated? I would also like to know what kind of calculations are done inside the update routine to estimate how long a call to that function could eventually take in very large worlds.

2) If the world was initialized with the WORLD_FULL mode, what position has to be given to Game::World.update(...)?

3) If something is changed inside an object, for example input variables or the direction to move to or some other stat that is relevant to physics, will all these changes take effect right away or only after Game::World.update()?
08-27-2010 01:45 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: World Updates
1) The Game::World update does what the comments say
// World update automatically calls the following methods:
// UpdateGrassAndLeafs()
// Physics.startSimulation().stopSimulation()
// update on all active game objects
update is called on all custom game objects which are active (located in AREA_ACTIVE) every time you call world.update method

additionaly in WORLD_STREAM if you specify new position as the parameter, which is distant from previous action center, then some areas are unloaded/and loaded to memory

2) in WORLD_FULL the parameter is ignored, you can pass Vec(0,0,0)

3) I don't understand,
Game::World.update calls physics simulation start/stop, and update method for each objects

if you set some member value outside Game::World.update, then it's already set (there is no double buffering)
any physics movement is done only inside physics simulation, you can check physics tutorial, and modify the codes
08-29-2010 01:42 PM
Find all posts by this user Quote this message in a reply
Post Reply