Reading Civ5Replay files (update: HTML export!)

Hi Danny,

Thank you so much for making the replay files work! :goodjob: Firaxis should pay you for your proprietary programming!

Just wondering if anyone here has managed to find a workaround to save map templates in multiplayer games? I've tried saving a multiplayer game and reloading it in singleplayer but the save map button doesnt pop out..

Has anyone had any luck in extracting a map template off a multiplayer game from like a map editor or something?
 
http://civ5.flexd.net I integrated dannythefool's script into a web based service that will automagically use the script on your replays. All you have to do is upload them. This is currently a very beta version running on my laptop and will most likely be a bit slow (at least if a bunch of you try it out at the same time!) Currently there are not a lot of features. You can upload your replay and it will parse it. Future versions will include listing uploaded replays (unless ticked private for whatever reason), commenting on replays and being able to handle a zipped replay file with replay+map for automagic generation of that too.

If it works it will look something like this http://civ5.flexd.net/replay/5
Instructions on how to get there on the main link, it's not terribly hard :)

I'll make a new thread about this once it's up and running on a proper host :)

Forgot to mention it's not using the new version danny uploaded today. Will need to fix that soon :)
This isn't working for me. :(
 
Yeah sorry about that. I'm having some internet issues and currently that is hosted at my home (yay fiber internet!). My router is having odd issues. Suddenly getting http://pastie.org/1360590

Trying to fix it but at the moment best i can do is reboot it every so often. And the server does not like that very much.
 
Just an update:

Router issues seem to have been resolved.
Also fixed a problem with the web server having issues dealing out the css files (stylesheet) which made the site load without any styles defined.

It should be good to go then. I'm gonna make quite a few changes once i'm done with school (the 15th). Or atleast try anyway :)
 
Hey flexd (or anybody), have you figured out how to save a map in a multiplayer game? It's mighty boring to watch a replay without the map, and multiplayer games are something to talk about with friends.

We've uploaded two games to the site; this and this. I won both. :) Granted, there have been a few games I lost, but we never got to finish them, ergo no replay.
 
I have no clue, i just parse stuff based on Danny's work. I don't even own the game :p
 
For anyone still trying to use this script post patch, you will need to make some tweaks in order to get it to run.

The problems seem to be either DLC, or new game options post patch. Also, new terrain post patch seems to break map reading totally. So don't even try it.

I haven't had time to try and correct the problem, but I did work around it:
Line 1226:
#return ", ".join(map(lambda x:victory_types[x].s(), self.victory_types))
return "None"
Line 1232:
#return ", ".join(map(lambda x:game_options[x].s(), self.game_options))
return "None"

Hope it helps someone.
 
For anyone still trying to use this script post patch, you will need to make some tweaks in order to get it to run.

The problems seem to be either DLC, or new game options post patch. Also, new terrain post patch seems to break map reading totally. So don't even try it.

I haven't had time to try and correct the problem, but I did work around it:
Line 1226:
#return ", ".join(map(lambda x:victory_types[x].s(), self.victory_types))
return "None"
Line 1232:
#return ", ".join(map(lambda x:game_options[x].s(), self.game_options))
return "None"

Hope it helps someone.

Are you on IRC somewhere? :)
 
I took a poke at updating this after CornMaster's post. Victory conditions haven't changed, but the two advanced game options from the december patch are indeed missing. "Allow Policy Saving" and "Allow Promotion Saving" should be added to the game_options array as ids 12 and 13 respectively, and the last 3 options should have their IDs shifted accordingly.

Additionally, the 4 newest DLC civs (Mongol, Spain, Inca, and Polynesia) should be added to the civs list if anyone is trying to fully update this thing. I added them in my copy but only the Mongols have a complete entry since that's all I own; the others use a set of default colors and capital name guesses from Bibor's videos.

To fix the map issue, a new integer and string (of that integer's size) must be read just before the self.map initialization. Attached is a copy of the script from the OP which incorporates these changes and has worked for me on two post-patch games.

EDIT: See later post for a new update
 
Woo it finally works for me!! Now I can admire my TSL huge domination victory in full glory :) Great work!
 
I took a poke at updating this after CornMaster's post. Victory conditions haven't changed, but the two advanced game options from the december patch are indeed missing. "Allow Policy Saving" and "Allow Promotion Saving" should be added to the game_options array as ids 12 and 13 respectively, and the last 3 options should have their IDs shifted accordingly.

Additionally, the 4 newest DLC civs (Mongol, Spain, Inca, and Polynesia) should be added to the civs list if anyone is trying to fully update this thing. I added them in my copy but only the Mongols have a complete entry since that's all I own; the others use a set of default colors and capital name guesses from Bibor's videos.

To fix the map issue, a new integer and string (of that integer's size) must be read just before the self.map initialization. Attached is a copy of the script from the OP which incorporates these changes and has worked for me on two post-patch games.

If you have the time, and feel like fixing the script more, i have 117 failed replay files with accompanying stack-traces i could give you.

I don't have the time but if someone else wishes to keep the script working with DLCs that would be awesome.. I was thinking i'll just make it its own repository on GitHub. That way anyone can use it and/or update it for us all :)
 
I can take a look at the other failed replays, sure.

Great! Are you on IRC or something like that? I'll have to do some coding to make something that extracts the files + stack trace for each failed job, but it shouldn't take that long :)
 
Alright here's an updated version containing the following changes:

  • Script now supports English, French, German, Spanish, Italian, Polish, Korean, Japanese, and Russian replays to varying degrees. English and French still have the best support, Japanese and Russian the worst, and the others are in between. If anyone wants to help with the translations, post here or send me a PM and I'll let you know what's needed.
  • The default behavior is now to auto-detect the language based on some common events, but it can still be forced to use a particular locale with the command line option.
  • The script should better handle replays whose map script path contains non-unicode characters, and it should do a better job of shortening the map script name on the generated HTML page.
  • The 4 new "hidden" game options from patch 1.0.1.275 are now supported.
  • Support for all DLC civs (including Denmark) including their proper colors.
  • Some additional bugfixes regarding a too-long event list, potential infinite loop, and escaping double-quotes for the HTML output.

Known issues
  • Scenario replays (particularly those from scenarios with pre-placed cities) still will not work.
  • Replays based on some of the multiplayer map scripts (e.g. West vs East) still don't fit well in the window of the HTML page; i.e. they are much smaller than the standard sizes so they are shoved into the lower-left corner.
 

Attachments

  • civ5replay_patch_1_275.zip
    23.1 KB · Views: 412
Wow thank you very much. No replay history was my biggest disappointment. Firaxis should pay you tbh.
 
Top Bottom