The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 08, 2022, 10:01:14 am
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Unit of speed in the source code?
« previous next »
Pages: [1] Print
Author Topic: Unit of speed in the source code?  (Read 1505 times)
Valaggar
Guest


Email
Unit of speed in the source code?
« 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?
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Unit of speed in the source code?
« Reply #1 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.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Valaggar
Guest


Email
Re: Unit of speed in the source code?
« Reply #2 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. Corrected.
(By the way, how could I forget that the length of a pixel varies with zoom?!)
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Unit of speed in the source code?
« Reply #3 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. 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. */
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!