From: Speed D. <no...@so...> - 2012-05-14 10:57:28
|
#692: Replay, Ghost Cars and Flashback -------------------------+-------------------------------------------------- Reporter: mungewell | Owner: somebody Type: enhancement | Status: new Priority: major | Milestone: to be defined Component: Whole game | Version: 2.0.0 Keywords: | -------------------------+-------------------------------------------------- Comment(by kakukri): I think storing the commands create a lot of problems, for a minor space saving. It assumes that all the simu engines and robots remain unchanged, and they work exactly the same way on all computers - which is not true, different processors/OSs do somewhat differently the floating point math. So it means a replay works only on the same computer under the same version of SD. But if we instead store the car positions, than a particular replay may work across several versions of SD, until the cars and track are still present. It also uses more CPU, as all the calculations need to be done during replay. The bottom line is that driving a race car is an unstable thing, meaning that minor changes (like different rounding errors) in driver input accumulate and might result in big changes in the car behavior (like doing the turn or spinning out). Whereas having car positions is a stable system, minor errors remain minor, they do not accumulate, only appear in the certain time point. The problem of size. For user input, we need to store the 3 pedals and steering wheel angle as floating point number, plus the digital commands (e-brake, or ABS on/off, etc.), let us assume they fit in a 64 bit integer, which gives a total of 5*8 bytes/car/time step. If we rather store car positions, than we have more numbers. The position and rotation requires 6 floating point ones, than the steering angle and the rotational position of all wheels, the 4 ride heights nedd to be stored as well, this gives 15 floating point numbers. We also need an integer to store light status and other digital things (like hig or low wing angle, which is about being implemented). So it gives 16*8 bytes/car, but then it should not be stored in every time step. The simu engine currently runs at 100 Hz, but for a replay we can go with 50, 33 or even 25 Hz. There are some additional data, in the first case the setup files, in the second we need to store the time and position of smoke, tire marks and damage sounds as they are not calculated (first we can go without them). So the total size of the replay files is roughly the same with both ways. -- Ticket URL: <http://sourceforge.net/apps/trac/speed-dreams/ticket/692#comment:7> Speed Dreams <http://sourceforge.net/projects/speed-dreams> An Open Motor-sport Simulator featuring high-quality 3D graphics and an accurate physics engine, all targeting maximum realism as well as exciting new features, cars, tracks and AI opponents to make a more enjoyable game for the player. |