News:

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

Main Menu

Replay logging

Started by alanrotoi, February 02, 2013, 08:58:42 PM

Previous topic - Next topic

alanrotoi

Is there a possibility to make an automatic statistic program? Only with reading the replay?

dreadnaut


alanrotoi


Friker


Duplode

Quote from: Friker on February 03, 2013, 10:51:48 PM
Quote from: alanrotoi on February 03, 2013, 08:54:52 PM
Section times.

Nope.

Because the .RPL file saves laps as keystrokes, so you need the game engine to know where the car is at each instant. (That's the same reason why the various RPLInfo implementations can't detect penalty time.)

dreadnaut

How much code from restunts is reusable? Could the replay engine (i.e., the fast forward button) be used to run replays?

Friker

Quote from: dreadnaut on February 04, 2013, 02:26:31 AM
How much code from restunts is reusable? Could the replay engine (i.e., the fast forward button) be used to run replays?

I don't know. I was thinking about simulating a replay and now - blink - that's it - guys from stuntschallenge.net could run the game with a given replay, couldn't they? And also they could determine a time with penalty! Oh.. definitely we should ask them how is it possible (to run the game with a given replay). At least, it should be possible to run an environment which can capture key strokes and they make a list of key strokes to input (press enter at 10 secs, right key twice at 15 secs, x times down, then type a filename of replay, ...). 

CTG

#7
Quote from: Friker on February 04, 2013, 10:13:48 AM
Quote from: dreadnaut on February 04, 2013, 02:26:31 AM
How much code from restunts is reusable? Could the replay engine (i.e., the fast forward button) be used to run replays?

I don't know. I was thinking about simulating a replay and now - blink - that's it - guys from stuntschallenge.net could run the game with a given replay, couldn't they? And also they could determine a time with penalty! Oh.. definitely we should ask them how is it possible (to run the game with a given replay). At least, it should be possible to run an environment which can capture key strokes and they make a list of key strokes to input (press enter at 10 secs, right key twice at 15 secs, x times down, then type a filename of replay, ...). 

The stuntschallenge guys are in our midst... I don't really like the way of this whole hacking development. It will be a great weapon for "high-tech" cheaters (although I think some of us already have the tools for creating superb replays without touching stunts_k.exe).

The only way to avoid any kind of cheating is a special rule set, like in ZSC 2007, for example: you should hit all the signs, stay in the right lane or whatever - anything that can't be generated by softwares (or at least it's too much effort to write a new code for that).

dstien

Quote from: dreadnaut on February 04, 2013, 02:26:31 AM
How much code from restunts is reusable? Could the replay engine (i.e., the fast forward button) be used to run replays?
Restunts is just a 1:~1 translation from ASM to C. The replay functions haven't been documented yet, but I don't think there should be any problems* creating a separate executable that loads a replay, iterates through the buffer and dumps the final game state without the need to invoke any display code. Locating the needed functions and their signatures should be enough, as we are mixing ported and untouched code in the build process.

*) No problems besides lack of time.

Duplode

#9
Quote from: Friker on February 04, 2013, 10:13:48 AM
I was thinking about simulating a replay and now - blink - that's it - guys from stuntschallenge.net could run the game with a given replay, couldn't they? And also they could determine a time with penalty!

IIRC Wind (one of the stuntschallenge.net developers) said they ran the replays in-game used a modified DOSBox. That doesn't sound convenient for simulations...

While I'm not terribly excited about any dreams of automated replay generation (see CTG's post), I would be very happy with after-the-fact analysis tools. The crucial one, I guess, would be a logger which recorded the car position at every instant over a lap. (Dstien and co.: how hard would be doing that today given what we already know? I believe we already have located where the coordinates are stored in the ASM, but I am too clueless about debuggers and other low-level stuff to know how far along the way that takes us.)

dreadnaut

@CTG: You're smart enough to sketch a dimensional analysis for the problem of automatically generating a decent replay yourself. Not sure why you keep bringing this up :|   And sections times would indeed be an interesting stat to extract from replays, we could make all sorts of crazy graphs! :)

Quote from: dstien on February 04, 2013, 12:28:07 PM
The replay functions haven't been documented yet, but I don't think there should be any problems* creating a separate executable that loads a replay, iterates through the buffer and dumps the final game state without the need to invoke any display code. [...] *) No problems besides lack of time.

This, included the footnote, is what I was thinking. Run the game "engine" and print a list of tiles and times when a tile is reached —that's what you need for most statistics, including section times.


Quote from: Duplode on February 04, 2013, 04:09:12 PM
While I'm not terribly excited about any dreams of automated replay generation (see CTG's post), I would be very happy with after-the-fact analysis tools. The crucial one, I guess, would be a logger which recorded the car position at every instant over a lap. (Dstien and co.: how hard would be doing that today given what we already know? I believe we already have located where the coordinates are stored in the ASM, but I am too clueless about debuggers and other low-level stuff to know how far along the way that takes us.)

Two other things related to this come to my mind: dosbox has an integrated debugger —can it watch memory locations? and also, if we know where tile coords are kept in memory, we could just write a small tsr to dump them to a text file.

alanrotoi

@CTG stallin shut up!

Zak once did some code where the result was how meny times accel and breaks butons were pressed, remember?

Friker

well, i have to admit that - for me - write a replay generator is far more easier than getting some idea about low level code/ debugging. still i cannot spend a time with that (and its level is comparable to high-level master degree theses at our faculty).

btw a car position is probably irrevelant for section times because you can leave (at least) one tile out w/o penalty. which is leading to a question - does anyone know how is penalty counting?

dreadnaut

#13
Quote from: Friker on February 05, 2013, 01:17:54 AM
well, i have to admit that - for me - write a replay generator is far more easier [...]
You may think that, but on top of the dimensionality issue you have others: it's hard to evaluate solutions (need to run the replay¹), it's hard to evaluate partial solutions (need to reach the finish line, or set mid-lap goals which might be tiles you would actually skip), etc. A probabilistic/big-data solution might have more success, feeding on thousands of replays of winning drivers, but it's still much more than an MSc thesis.

[1] and this actually solves the whole "let's get section times!" idea!

Quotebtw a car position is probably irrevelant for section times because you can leave (at least) one tile out w/o penalty.

Section times would be measured on tiles you are sure to drive through, I suppose. It's still arbitrary stats anyway, so it's not really a problem.

dstien

Quote from: Duplode on February 04, 2013, 04:09:12 PM
Dstien and co.: how hard would be doing that today given what we already know? I believe we already have located where the coordinates are stored in the ASM, but I am too clueless about debuggers and other low-level stuff to know how far along the way that takes us.

Should just be a matter of getting the coordinates from the player matrix for each tick. Would be neat to overlay the resulting paths on a track map in order to compare racing lines.

Quote from: dreadnaut on February 04, 2013, 04:28:43 PM
Two other things related to this come to my mind: dosbox has an integrated debugger —can it watch memory locations? and also, if we know where tile coords are kept in memory, we could just write a small tsr to dump them to a text file.

The DOSBox debugger allows you to browse the memory and set breakpoints on changes. It's very helpful to locate and inspect code. Replays loaded from Main screen -> Options are fully processed to the end before the world is rendered, so going from there with a breakpoint on file reads (DOS interrupt) would probably be sensible.

Regarding the conspiracy theory/pipe dream about a perfect replay generator; you must have been watching too many computer science Hollywood movies, CTG. The individuals who are capable of doing that aren't tapping their feet, waiting for us hand them reversed code they could write themselves in their sleep. They're busy raking in Nobel prizes and building self-aware quantum computers.