News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Automatic replay analysis

Started by dreadnaut, May 30, 2014, 11:42:01 AM

Previous topic - Next topic

dreadnaut

Dstien's rpldump gives us the car coordinates; Duplode's annotation language makes it possible to set up section boundaries.

What are we missing? Just something that scans a replay dump and tells us when the car crosses a section line?


Duplode

#1
Quote from: dreadnaut on May 30, 2014, 11:42:01 AM
What are we missing? Just something that scans a replay dump and tells us when the car crosses a section line?

Pretty much so. In fact, it would be easy to implement that within Cartography. The lap trace data is ready at hand, so all it would take is reading the split specs and writing a [[Split]] -> [TracePoint] -> [FrameIndex] unfold function which runs through the trace and uses a little analytic geometry to detect crossing points (it would take a [[Split]] rather than a [Split] just in case we want to have multi-part splits in tracks with long dual-way sections).

dstien

#2
Quote from: dreadnaut on May 30, 2014, 11:42:01 AM
What are we missing? Just something that scans a replay dump and tells us when the car crosses a section line?

For the last section, the most accurate way to determine the finish point is probably to read Stunts' finish frame number at offset 0x146 in the gamestate. I've attached a simple (and barely tested) program that reads the last gamestate entry from a repldump file and prints details similar to those in the highscore screen. Turns out the gamestate provides all we need to return penalty time and finish state (crossed finish line/crashed/aborted) without having to worry about the extra post-finish frames.

$ ./replinfo TST0001.BIN
Driving time : 1:30.80
Penalty time : 0:00.00
Total time   : DNF (crashed)
Avg speed    :  56.45 mph,  90.85 km/h
Top speed    :  77.23 mph, 124.30 km/h
Impact speed :  63.77 mph, 102.62 km/h
Jumps        : 4

$ ./replinfo TST0002.BIN
Driving time : 0:53.75
Penalty time : 3:00.00
Total time   : 3:53.75
Avg speed    :  48.30 mph,  77.73 km/h
Top speed    :  79.86 mph, 128.52 km/h
Jumps        : 0