Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » January 1 - 2010
Re: January 1 - 2010 [message #436214 is a reply to message #415183] Tue, 07 September 2010 08:38 Go to previous messageGo to previous message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma:
General (2 Stars)

I don't remember the exact computation, but basically, it computes the amount of credits to deliver that frame, using some multiplier. If the frame rates are high enough, this number is between 0 and 1, and when rounded becomes 0. Therefore, the "gradual" effect only works when the framerate is low enough, and the multiplier becomes >1.

Again, I don't remember the details, but it is likely something similar to this:

// Values from LevelEdit
int dropoffCredits = 300;
int dropoffDuration = 10; // I have no clue what the real value is for Renegade.

// Every frame
time_t currentTime = timeGetTime();
time_t timeDifferenceInMs = currentTime - previousUpdateTime;
int timeDifferenceInSec = timeDifferenceInMs / 1000; // Loses precision here, will be 0 if timeDifferenceInMs < 1000, ie when FPS > 1.
int amountToDropOff = dropoffCredits / dropoffDuration * timeDifference;
previousUpdateTime = currentTime;
distributeCredits(amountToDropoff);

What TT did was change the "int" to a "float" to avoid the roundoff error.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Raw Data
Next Topic: Introduction to the SSGM 4.0 TCP Logging System
Goto Forum:
  


Current Time: Fri Nov 22 01:15:25 MST 2024

Total time taken to generate the page: 0.01961 seconds