Speed Vs. Tics

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
durnurd
Posts: 116
Joined: Wed Jan 18, 2006 8:44 pm
Location: Minnesota

Speed Vs. Tics

Post by durnurd »

I'm wondering, what does the "speed" argument of functions like Floor_Raise have to do with time passage in tics (for the purpose of scripting special platform movement)?

With a little experimentation, I've found an equation to convert the velocity to Units per Tic:

v(x) = (28/225) * x

where x is the "speed" you type in and v(x) is the velocity in Units per Tic.

If, then, you have a platform moving A units at speed S, you can find how many tics it will take by using:

T(A,S) = A / (S * (28/225)

Is there a more accurate or easier way to do this?

Thanks.
User avatar
Amuscaria
Posts: 6558
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Post by Amuscaria »

From what i've found in the past. Whatever speed you put is divided by 8. If your speed is 1, it would take 8 tics to move up 1 unit/pixel, this 1/8 units per tic. If it's 64, it would still take 8 to move that full 64 units, thus 8 units per tic. I'm not sure if I go tthis right, i might have reversed something.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Incidentally, 1/8 (0.125) is extremely close to 28/225 (0.12444~).
User avatar
randi
Site Admin
Posts: 7728
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

Unless explicitly stated otherwise, a speed of x will cause an object to move at a rate of x/8 units per tic.

Return to “Editing (Archive)”