Author Topic: Automatic replay analysis  (Read 779 times)

dreadnaut

  • Helen`s Lover
  • **
  • Posts: 613
    • View Profile
    • chezDreadnaut
Automatic replay analysis
« on: May 30, 2014, 11:42:01 AM »
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

  • Moderator
  • Considering trying out spam
  • *****
  • Posts: 3410
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: Automatic replay analysis
« Reply #1 on: May 31, 2014, 09:45:28 PM »
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).
« Last Edit: May 31, 2014, 09:55:51 PM by Duplode »

dstien

  • Moderator
  • Stunts Master
  • *****
  • Posts: 161
    • View Profile
    • Stunts Tools
Re: Automatic replay analysis
« Reply #2 on: June 01, 2014, 04:59:46 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.

Code: [Select]
$ ./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
« Last Edit: June 01, 2014, 07:40:11 AM by dstien »