Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / speed issues - sync and hide/show object

Author
Message
fatbiffa
23
Years of Service
User Offline
Joined: 15th Jan 2003
Location:
Posted: 29th Apr 2003 23:29
In trying to optimise my game I've timed various parts of my main game loop which runs at 68 milliseconds (about 20 fps which is too slow). I've found the bits I expected to take longest (NPC AI and player control and animation) took around 10 milliseconds but FASTSYNC takies a whopping 52 milliseconds!

Does it take that long to draw all my objects to screen (85k polys) or it the instruction waiting for some reason? If the former I will have to only sync my screen every few cycles - not the ideal solution.

I've tried hiding objects not drawn to screen (if object in screen show else hide) without any real change in main loop timing.

any clues chaps?
heart of gold, nerves of steel, nob of butter
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 29th Apr 2003 23:43
are you using the SYNC RATE command with a parameter other than 0?

If so then yes, a delay is inserted.

Anyhow, drawing the scene is VERY VERY CPU intensive, that is why 3D engines try to optimise the speed of the engine, by rendering as little as possible.

Current Project: Retro Compo. Entry.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Apr 2003 00:04
Here are a couple of ideas:

If you are filling the screen entirely with polys, then make sure you have switched the backdrop off.

If an object is not visible because it is too far away or outside the clipping distance, hide that object too.
TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 30th Apr 2003 00:49
Try lowering the viewing distance (clipping)

SET CAMERA RANGE [camera number,] near value, far value

The default is 1,3000
Try lowering the second value. If you game is inside small rooms without any open landscapes you can set it to around 1000

Login to post a reply

Server time is: 2026-07-11 04:23:19
Your offset time is: 2026-07-11 04:23:19