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 Discussion / can you choose your lag in darkbasic?

Author
Message
kfoong
22
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 27th Mar 2003 09:27
Well is it possible to choose your lag in darkbasic? what i mean is at the moment when the gane lags the screen fps drops and the game slows down. what i want is the other type of lag like in diablo (i think) where the game doesnt really slow down but the refresh does, as in things teleporting across the screen other than things moving slowly across the screen.

Is it possible?
--------
http://www.stellarblue.vze.com/
arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 27th Mar 2003 12:57
base all your movement and angle changes on real values like meters per second.

you have to take system time at the begining of your loop and then at the end of loop. Then compare these two like time#=time_end#-time_begining# and multylpli all your walues by that:

move object x,5*time# where 5 would be 5 m/s
like this your object would move the same speed on any computer.

And dont forget that you get system time in miliseconds so divide it by 1000 to get seconds.

Another thing is that it seems like if DB cant recognize sistem time change smaler than 10 miliseconds so if your loop takes less than 10 you wil get time diference=0
I solved it by taking time only at the end of each 10 or 20 loops and then divide result by 10 or 20

here is example from my code:


do
tk=tk+1
if tk=1 then timer#=timer()

move object x,20*hh#

if tk=10
tk=0
hh#=timer() : hh#=(hh#-timer#)/10 : hh#=hh#/1000
endif
sync
loop


like this of course for first 10 loops hh#=0 so object would not move, but this is normaly not problem because 10 loop should take so less time that player do not notice it.
But if thats problem just set hh# before -do- comand to some general walue you think 10 loops can take at moderate computer.

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 27th Mar 2003 14:18
IanM has got a plug-in that uses the high-frequency timer, which may be of use for you.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 27th Mar 2003 14:35
sync rate 1-200

Darken the skies, we are god
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 28th Mar 2003 06:11
Kfoong, do you mean what it seems like you mean, and which has been answered above, or do you mean an effect where the frames fade transparently over time (as in 'jkII jedi outcast' when using 'force speed', or 'blinx the time sweeper' in 'fast forward'.)
Sorry, I've not played diabloII.

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.

Login to post a reply

Server time is: 2025-05-17 06:58:37
Your offset time is: 2025-05-17 06:58:37