rosshamish / catanlog

machine-parsable, human-readable file format for describing a game of Catan
GNU General Public License v3.0
17 stars 1 forks source link

Suggestion: Timestamps #2

Closed antoinne85 closed 8 years ago

antoinne85 commented 8 years ago

You might consider adding optional timestamps to the file. Perhaps [2016-01-01T12:00:00.000Z] or even just the number of seconds since the game started [347].

It won't add much to the human-readable-ness of it. But it will add some more data for machine parsing. In terms of readable-ness the latter is probably a better option.

Why would anyone care about timestamps?

Well, if people start adopting your format there are some interesting possibilities. Having the timestamps will let you get information like average game length, average turn length, average turn length of a winning player, how does closeness to victory affect turn length, and possibly other things.

I think it would be interesting if this project picked up steam and the community generated hundreds or thousands of these files that we could pore over, extract data from, and create interesting analyses. But that requires that the information be captured and at a granular enough level.

rosshamish commented 8 years ago

Totally agree. Timing information will be possibly less useful for training AIs, but will be nice in analysis of human player game logs, perhaps of tournament matches and so on.

I'd like to somehow avoid the ugliness of timestamps being on every line. I like the idea of logging the number of seconds since game start instead of the full timestamp. The log contains the timestamp at game start anyway, in the header.

How about the timestamps are written as you suggest, as the number of seconds since game start, but instead of timestamping every action, only "$color ends turn" lines contain timestamps (and "$color wins").

blue rolls 7
blue buys settlement, builds at (1 NW)
blue ends turn [15s]

That still gives information about the length of each turn, which is useful, but gives up the (perhaps interesting?) information regarding time in between individual actions. Readability-wise, the maximum realistic value is about 5400s (90min * 60s/min), which is few enough digits to be not too distracting in the log.

rosshamish commented 8 years ago

This has been addressed in commit aedd314 - I settled on logging the length of each turn like blue ends turn after 15s. Thanks @antoinne85 !

btw, regarding this:

"I think it would be interesting if this project picked up steam and the community generated hundreds or thousands of these files that we could pore over, extract data from, and create interesting analyses"

I completely agree! Once the project settles and I freeze the format, I'll be getting the word out and promoting the spectator GUI, which writes game logs in this format. Then we need is lots and lots of games to be logged!

antoinne85 commented 8 years ago

Hey, Ross.

Sorry I haven't checked back in on these things (or submitted a PR). Thought I owed you some context.

I don't work in python much, but I ran across your project while up late and thought it was cool. The suggestions were somewhat self-serving because I like stats on this kind of thing and I thought it would be great if we could get a whole load of information and dive into it.

I think the timestamp only after a turn ends is a great compromise. Good call.