The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Valaggar on June 11, 2007, 07:53:35 pm



Title: Unit of speed in the source code?
Post by: Valaggar on June 11, 2007, 07:53:35 pm
What unit of speed is used in the source code for ships? I.e., the Pkunk Fury has a maximum speed of 64.
Are they pixels per frame?


Title: Re: Unit of speed in the source code?
Post by: Novus on June 12, 2007, 11:18:27 am
Not quite. Maximum velocities are counted in world units per frame, and as far as I can tell, there are 4 world units to a pixel at maximum zoom (16 at minimum). This makes the Fury's top speed 16 (maximum-zoom) pixels per frame (24th of a second, according to src/sc2code/libs/timelib.h) or 384 pixels per second.

Experimentally, a Fury can fly around the playing area (about 2000 pixels) in about 6 seconds, roughly 14 pixels/frame, which probably means I've worked it out right.


Title: Re: Unit of speed in the source code?
Post by: Valaggar on June 12, 2007, 03:16:01 pm
Ah, thank you. So there are 24 FPS? Seems that meep-eep made a little typographical error on Tabe of bio types (http://uqm.stack.nl/wiki/Table_of_bio_types). Corrected.
(By the way, how could I forget that the length of a pixel varies with zoom?!)


Title: Re: Unit of speed in the source code?
Post by: Novus on June 12, 2007, 05:46:15 pm
Ah, thank you. So there are 24 FPS? Seems that meep-eep made a little typographical error on Tabe of bio types (http://uqm.stack.nl/wiki/Table_of_bio_types). Corrected.
Actually, those 24 fps are only in combat. The full comment from timelib.h is:
Code:
/* ONE_SECOND is the LCM of all the fractions of a second the game uses.
 * Battle is 24 FPS, Landers are 35 FPS, most UI-level things are 15 FPS,
 * The Interplanetary flight is 30 FPS, Comm ambient animation is 40 FPS,
 * (also Comm Oscilloscope is 32 FPS, but it does not require a stable
 * timer and currently runs within the Comm ambient anim paradigm anyway)
 * Thus, the minimum value for ONE_SECOND is 840. */