Reading Civ5Replay files (update: HTML export!)

I've just uploaded a new version that understands more of the data in between the map name and the event list. Please pay special attention to the options and disabled victory types that are displayed and let me know if they're wrong.

By now, there isn't much left that I think I don't know the meaning of yet, but I could imagine that multiplayer replays (more than one human player) or replays of games with teams can break the script. All 14 replay files that I have (thanks to BotYann and Collin G. for sending me some of theirs) have the same data in one undecoded area that I think might hold data about either of those.
 
signal.alarm(60) gives me an error when I try to run this utility.

Code:
Traceback (most recent call last):
  File "civ5replayc.py", line 32, in <module>
    signal.alarm(60)
AttributeError: 'module' object has no attribute 'alarm'

If I comment that line out, everything works fine.


P.S.
Try adding some defaults, for example:
-make replay file of same name as save game if -H is not explicitly stated
-make replay look for map file of same name as save game, if not explicitly stated by -m
 
signal.alarm(60) gives me an error when I try to run this utility.

Hah, that's what I get for developing this on my Macbook, signal.alarm() is only there on Unix. Fixed, thanks :)

-make replay file of same name as save game if -H is not explicitly stated
-make replay look for map file of same name as save game, if not explicitly stated by -m

Thanks for the suggestions, I'll try to get them in soon.
 
I just uploaded a new version that implements the above suggestion from player1 fanatic. If HTML output isn't explicitly requested to go to a specific file, it's automatically written to the same name as the replay file with the extension changed to "html", and if no map file is specified but there is a Civ5Map file with the same name as the replay, that map file is used as the background.

Also, rivers are now displayed on the background map. I should have done this earlier, it turns out I can ignore most of the river related data and just focus on three cases where a river could be.
 
This is great work, very impressed with the progress you've made. It's fantastic for another reason as well; I imagine it should act as a further nudge to Firaxis to add in an official end of game replay system.
 
Wow, 2k must have rushed this game out like mad...
Seriously, Civ IV had some realy catastrophic mess ups when it was launched, but it had all of its features working (well sort of :)) at launch.
2k should be ashamed that they forced Firaxis to launch in this state...
 
Good work, and I have to agree with others that it is indeed a shame that this game was launched in this terrible state. I have seen many bad launches recently. When will the companies realize that the time it takes to finish a product will yield them customers who remember how the company published a quality product and they will maybe support the company in the future too.

At the moment I feel Funcomed (game company wich released Age of Conan MMO and repeatedly lied and decieved its customers). The term can be found here http://www.urbandictionary.com/define.php?term=Funcomed
 
Amazing!!!!! Not having the replay at the end was my biggest disappointment with civ 5.

Watching the replay was my favorite part of the game in the other civs, and now you brought it back!

I didn't think this was going to be possible. Thank you, thank you, thank you!
 
At the moment I feel Funcomed (game company wich released Age of Conan MMO and repeatedly lied and decieved its customers). The term can be found here http://www.urbandictionary.com/define.php?term=Funcomed

Funcom did exactly the same with their previous MMO, Anarchy Online. I guess history is doomed to repeat itself :p Although AO was quite good at first, they just kept making it worse for no good reason. If you get a chance to play their older adventure title The Longest Journey, that one is quite good.

But what I really wanted to say is this - please don't turn this thread into another ball of hate. Let's be constructive here and use this to show them that we're missing the replay and stats at the end of the game, not that we can insult each other in a fit of rage ;-)
 
This is great work, very impressed with the progress you've made. It's fantastic for another reason as well; I imagine it should act as a further nudge to Firaxis to add in an official end of game replay system.

Your work is greatly appreciate, but I hope Firaxis doesn't feel this absolves them of providing a true and integrated replay feature.
 
Just had a go at this. I followed your steps and had almost no troubles. I got a replay working, and I'm very impressed.

The only things I had to do that weren't covered in your steps were to use quotation marks "" around the name of each file because they had spaces in them and to add python to the windows cmd path variable. It's up to you whether you want to mention either of those things.
 
Too bad the replays don't save information regarding when you rename a City. I sort of customized one game where I changed the name of the empire, adjectives, leader name and I even renamed all my own cities...

Great utility Danny! I especially like the width option. Some of those replays look smallish on the standard size, having a 1920x1080 resolution monitor allows me to get a much larger map. If I ever run a huge map I'll let you know.

I can't imagine that a replay window won't be incorporated at some future point by Firaxis, otherwise why create the Replay files and replay folder?
 
This is really fantastic. Is the unit data present in the replay files? Do you think it may indicate that the CiV team is planning on giving us an in-game replayer at some point?
 
Top Bottom