Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, degenerate_762), 907 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Aum 80 [Re: George] #241051
12/14/08 03:46
12/14/08 03:46
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Always grateful for your efforts, George.

Re: Aum 80 [Re: JazzDude] #241057
12/14/08 04:35
12/14/08 04:35
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
George, I noticed you used this method to count up seconds (Questions from the forum)

time_passed += time_step / 16;

rather than

wait(-1);
time_passed += 1;

Is there a difference? I've been struggling with an accurate timing code in my game. Does time_step equal a time duration of 16 seconds?

The manual says time_step is used for movement and frame rate compensation. Boy am I confused...but that's my normal state.

Re: Aum 80 [Re: JazzDude] #241058
12/14/08 04:53
12/14/08 04:53
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Quoting JazzDude.
Code:
Does time_step equal a time duration of 16 seconds?

@256?
According to some data, the following is an approximation (with faults):
time_step is the duration between frames in ticks.
one tick = 1/16 of second.
seconds = time_step / 16 or time_step * 0.0625 (1/16).
(precision considerations: division OR multiplication is preferred here?)
Usage (above) MAY produce more precise results than wait(-t)!?
Perhaps, if (+1) eval code is used with dependencies and no carry over (int), results may vary with timing hits?

precision (var 10-22): over extended period of time, fast / slow machines may be out of sync?

Certainly, George can provide better answers / replies.

Re: Aum 80 [Re: testDummy] #241125
12/14/08 17:07
12/14/08 17:07
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Quote:
time_step is the duration between frames in ticks.
one tick = 1/16 of second.


So, a framerate of 10 fps would have 160 ticks per second.
but a framerate of 100 fps would have 1600 ticks per second.

If that's the case, time duration based on time_step would be totally dependent on cpu or graphics muscle. Or so it appears to me.

I must be missing something, because on my computer both methods give the same result regardless of frame rate.

Re: Aum 80 [Re: JazzDude] #241129
12/14/08 17:37
12/14/08 17:37
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Originally Posted By: JazzDude
Quote:

one tick = 1/16 of second.


So, a framerate of 10 fps would have 160 ticks per second.
but a framerate of 100 fps would have 1600 ticks per second.

Possibly somethings wrong with your math
one tick = 1/16 of second.
that means one second = 16 ticks.
So, a framerate of 10 fps would have 16 ticks per second.
and a framerate of 100 fps would have 16 ticks per second.
smile


Re: Aum 80 [Re: Tobias] #241149
12/14/08 19:01
12/14/08 19:01
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline OP

Expert
George  Offline OP

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
We've got 16 ticks per second regardless of the frame rate.
My "while(1)" loop method allows you to stop the process immediately using a break instruction. If I would use something like this

wait(-1);
time_passed += 1;

I would have to wait until the entire second passes; I can't interrupt the process earlier if I need to.

On the other hand, "time_passed += time_step / 16;" adds 1 to time_passed each second. A loop that runs until time_passed is greater than or equal to 3 will run for 3 seconds, and so on.

I hope that this explains what's happening; let me know if you need more info.

Re: Aum 80 [Re: George] #241193
12/14/08 21:31
12/14/08 21:31
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I'm still asking, "Is time_step a measure of time duration", and if I am understanding this, it is.

If it is, one second contains 16 ticks.

from the manual:
Quote:
If time_step changes suddenly, speeds become inaccurate


Now, I can't reconcile those two things.

Anyway, no need to belabor the point in this thread. Maybe it'll get thru to me after a while. I'll work on it. Thanks.

Re: Aum 80 [Re: JazzDude] #241306
12/15/08 14:36
12/15/08 14:36
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
time_step is the length of the LAST frame, not of the running frame. So if there is a very long frame and then a very short one, objects will "jump" in that short frame. AFAIK you can prevent that with time_smooth.

Re: Aum 80 [Re: JazzDude] #241345
12/15/08 17:56
12/15/08 17:56
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline OP

Expert
George  Offline OP

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
time_step changes its value from one frame to the other. You can use Windows' api to build a high precision timer.

Re: Aum 80 [Re: George] #241527
12/16/08 20:56
12/16/08 20:56

F
Fear411
Unregistered
Fear411
Unregistered
F



hey, thanks George.

btw. when will there be some informations about the new competition?

Page 2 of 3 1 2 3

Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1