UpdateWorld x ?

Blitz3D Forums/Blitz3D Programming/UpdateWorld x ?

Santiworld(Posted 2008) [#1]
hi, i am programing a game, who FPS goes from range 25 to 70 FPS...

the problem is the speed, change to much...
this donsent seam work, the parame acl_juego#, is ok?...

why my game change so much the speed?..
what can i do to fix that?

thanks..


--------------------------------------------------


If fps < 60 Then acl_juego# = 70 - fps
UpdateWorld acl_juego#
RenderWorld


Zethrax(Posted 2008) [#2]
The parameter used with the UpdateWorld command is intended to set the animation speed for 3D model animations.

The FPS of your game will vary depending on how heavy a load is being placed on the graphics card. This is normal - different 3D scenes will place different loads on the card depending on how many polygons are being rendered, etc.

If you are having a problem with the rendering FPS interfering with the regularity of your game logic updates, do some searches for 'render tweening' and 'delta timing' in this forum and in the code archives. Also, check out the castle demo in the Blitz3D samples folder ( C:\Program Files\Blitz3D\Samples\Blitz 3D Samples\mak\castle ), to see an example of render tweening with timing regulation of the game logic.


nawi(Posted 2008) [#3]
;game loop, renderworld etc

frameTime = MilliSecs()-frameTime
if frameTime<16 then Delay 16-frameTime
frameTime = Millisecs()


John Blackledge(Posted 2008) [#4]
http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=1497


GfK(Posted 2008) [#5]
In 99.9% of circumstances you don't need to use any parameters with UpdateWorld(). All it does is change the speed of any mesh animations that are playing. Normally you will set the animation speed when you start an animation playing, with the Speed parameter of the Animate command.


Santiworld(Posted 2008) [#6]
ok..

but now i have a graphics problem...

i have 16 tanks in a big terrain....
when i face the camera, to the others tanks, the game down to 30 frames, when the normal is 60...

my new question is, why the frames goes down, if i dont see the video render thats far tanks...?..

what can i do to fix that?...


smilertoo(Posted 2008) [#7]
Your pc cant handle 16 tanks; Blitz does frustrum culling so when some tanks cant be seen the game speeds up. The problem is if your tank is just behind a building...blitz still counts it as being seen.


Zethrax(Posted 2008) [#8]
It takes time to render the tanks. The more tanks that are being rendered, the longer it will take to render the scene, which will result in a lower frame rate.

Even if the bounding box for a model is only partly within the camera's viewing fustrum, the model will still be rendered (or at least a large part of the work involved in rendering the model will still happen). If the model is occluded by other models, etc, it will still be rendered, as the rendering engine doesn't know that the model is occluded.

I suggest you check out the EntityAutoFade, and CameraRange commands for more info on stopping distant entities from being rendered.


Santiworld(Posted 2008) [#9]
thanks...