1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Reading Civ5Replay files (update: HTML export!)

Discussion in 'Civ5 - Strategy & Tips' started by dannythefool, Oct 4, 2010.

  1. kaltorak

    kaltorak Emperor

    Joined:
    Jul 7, 2009
    Messages:
    1,520
    Location:
    Madrid
    You are a genius. This should be stickied
     
  2. flexd

    flexd Chieftain

    Joined:
    Oct 20, 2010
    Messages:
    50
    First of all, GREAT WORK! I love it!

    Second: Would it be possible for you to add a --tag to disable output (perhaps limit to a success/failure message) ? I've made a small ruby/sinatra web app that uses this to generate (and host) these replays. Figured it would be useful for people :) if you approve of course.
    Currently you can upload files and it will parse them, as soon as i get the time i will make it available + make it so you can upload a .zip with a replay file + map and it will automagically produce a replay with those. Having some issues detecting success/failure on the replay generation jobs at the moment.

    Anyway i could make the alterations myself too i guess but that would leave me needing to update it whenever you do :)
     
  3. Mikkeman

    Mikkeman Chieftain

    Joined:
    Mar 17, 2005
    Messages:
    37
    Location:
    Suomi
    I agree. And again thanks for the great work with this :)
     
  4. FantasiaWHT

    FantasiaWHT Chieftain

    Joined:
    Apr 13, 2006
    Messages:
    5
    Hi!

    I'm having a little trouble getting this to work. I've followed all the steps, but I get the following error message when I try to run the program from the command prompt:

    'python' is not recognized as an internal or external command, operable program or batch file.

    I'm using the 64-bit version of Python, if that makes a difference...

    any suggestions?
     
  5. fcolmenarez

    fcolmenarez Chieftain

    Joined:
    Jan 11, 2009
    Messages:
    22
    You need to set the path variable for python.exe. It's not finding it.

    SET PATH=%PATH%;C:\python\bin.

    Naturally substitue C:\python for wherever your real location for you file is. Then you should be able to run python. Might as well include it in your environment variables.
     
  6. FantasiaWHT

    FantasiaWHT Chieftain

    Joined:
    Apr 13, 2006
    Messages:
    5
    Hmmm still not working... it installed in C:\Python26, so I set the path to there, but there is no \bin subfolder. There's DLLs, Doc, include, Lib, libs, tcl, and Tools subfolder.
     
  7. wapamingo

    wapamingo Prince

    Joined:
    Sep 19, 2006
    Messages:
    399
    sticky. this is great!
     
  8. fcolmenarez

    fcolmenarez Chieftain

    Joined:
    Jan 11, 2009
    Messages:
    22
    Sorry, the Python.exe is in the C:\Python26 folder itself there's no need to add bin at the end.
     
  9. BotYann

    BotYann Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    9
    Location:
    France
    With the new patch 1.0.0.62, the code is working for you (with map) ?

    I dont know if it's because i have Deluxe version and i do wait a future patch or if there is a change on .Civ5Map file but when i try to convert a new game/replay with their map the script fail at the end when the_map = Civ5Map(options.map) is called. :cry:

    ( but work without map )

    Thanks to tell if new a game/replay + map work on a standard version.
     
  10. dannythefool

    dannythefool King

    Joined:
    Jul 15, 2009
    Messages:
    657
    I don't know, but can you send me the map file?
     
  11. BotYann

    BotYann Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    9
    Location:
    France
    Sure and someone sended me a replays+Map of a standard edition.
    Same problem.
     
  12. dannythefool

    dannythefool King

    Joined:
    Jul 15, 2009
    Messages:
    657
    I just uploaded a new version that can read these maps and replays, thanks again :)

    I also implemented a suggestion I got via PM about changing alpha for the borders.
     
  13. gunter

    gunter King

    Joined:
    Oct 16, 2002
    Messages:
    790
    Dannythefool, I wanna thank you for your skills and Firaxis of course must hire you asap.

    At least, you should be paid by them, 5.000 euros to start from.
     
  14. flexd

    flexd Chieftain

    Joined:
    Oct 20, 2010
    Messages:
    50
    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 :)
     
  15. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Well done, flexd. Just tried it out and it seemed to go ok. It'll be great when you can upload the map file too.
     
  16. BotYann

    BotYann Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    9
    Location:
    France
    Good to know someone is making that ;)

    Can i suggest to add some options like replay language and why not screen size ;)

    like i have made on http://c5r.sgsgames.com

    ( it's not designed to be a service, it's just a temporaly french service by waiting someone make one :D )
     
  17. flexd

    flexd Chieftain

    Joined:
    Oct 20, 2010
    Messages:
    50
    Yea i could add those, working on getting the background worker 100% first. Shouldn't be too hard :) Why not combine efforts? Do you code Ruby by any chance? The source to my little project is on github.
     
  18. BotYann

    BotYann Chieftain

    Joined:
    Oct 7, 2010
    Messages:
    9
    Location:
    France
    I never tried Ruby :blush:

    And i make just those page for people who are waiting someone making a service like you but, i can help you if you want some french translations :D
     
  19. flexd

    flexd Chieftain

    Joined:
    Oct 20, 2010
    Messages:
    50
    Ruby is better than PHP in my (and most others) opinion (anything > PHP :p). You should try it sometime :) French translations i guess could be nice once it's setup, i don't speak french so personally i don't have that much need for them :p
     
  20. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Thank you so much for this!

    I've got a replay from the new Mongol scenario which doesn't quite work with the script. Maybe you could take a look?
     

    Attached Files:

Share This Page