Page 1 of 3 123 LastLast
Results 1 to 30 of 79

Thread: Replay Viewer

  1. #1

    Default Replay Viewer

    I'm making on a replay viewing program for EB, to replay the progression of factions on the campaign map, which I mentioned over the AAR forum.

    The current version grabs the screen, and cuts out the map, saving it to a .png file. It then works out the turn and season, and writes it on the image. However, this relies on the player taking a print screen every turn and toggling fow. If you dont take a printscreen one turn, it will go out of sync. Obviously this is a problem. This problem wouldnt exist if I could have access to the turn number and map data.

    V.T. Marvin suggested integrating it with the script, so I looked into it. I was wondering if there was any way at all to get output from the script - such as a log file. I looked around on google and read about the command line switch fplog, which may be able to specify a log file, and I was wondering if it works ( I tried, but I may be doing something wrong ). I also found some info on console commands called dump_fac_score/dump_fertility, which aparrently get routed through to the log/output window. However, no such log is created as far as I can see. Even though these seem completely irrelevant, I would be able to represent turn numbers and map data with them ( albeit a long-winded way ).

    If it's not possible to get information out using any built in functions, I do have a workaround, but it's a bit of a fudge, and I would prefer to avoid having to do it.

  2. #2

    Default Re: Replay Viewer

    Iff you pull this off you will be my favouritest person ever. If you need someone for general bitch-work (ie, editing lots of stuff, etc.), PM me.

    Have a Cookie *offers Jar*

  3. #3

    Default Re: Replay Viewer

    *Takes Cookie* Thanks

    Just been nosing around a .sav file, and I might be able to get the information from there (hurray for hex editors!).

    Update : Slowly, very slowly figuring out the file format for savegames. Although its quite interesting/fun, it might take a while.
    Last edited by Chris_; 07-23-2008 at 22:34. Reason: Update

  4. #4

    Default Re: Replay Viewer

    I cant think of anyway to make script communicate with external software.

    Few ideas I had how this can be done:

    1. Hooking windows so you can monitor mouse and key events in RTW ( to detect end turn ).
    Only problem with this are battles that can cause false positives.

    2.Using autosave. Checking out when autosave file is changed would be enough for simple implementation. You can also read a date from this file but not season unfortunately.

    Second problem is lifting fow. I guess some good timed EB script could help here but I guess this will be tricky.

    Edited:
    Best way would be to use only save file to generate custom map. Not using RTW at all to capture screenshots.
    Unfortunately this would require fairly well understanding of save file format so you can extract all necessary data from it.
    Last edited by LorDBulA; 07-24-2008 at 08:25.

  5. #5

    Default Re: Replay Viewer

    Yeah, those are the same kind of possibilities that I came up with if it couldn't be done with script. At the minute, it detects keystates, and grabs the screen based on that. And yes, it does generate false positives ( because it watches Print Screen - but I can change that ).

    The save file does seem to be the way to go. Which is why I stayed up till 3am reading one and comparing it with another. I managed to get some understanding of it - I noticed a couple of the faction indexes - 06 for Romani, 0A for Aeudi, and so on. I also changed Roma to Smeg, but thats not really useful. However, I think i'm getting close to being able to figure out ownership of a province, which would in turn allow me to figure out who owns what.
    Last edited by Chris_; 07-24-2008 at 09:28. Reason: Typo

  6. #6

    Default Re: Replay Viewer

    Check out descr_sm_factions.txt file. I think you can get faction table from this file.
    At lease examples given by you match this file.
    Also faction colors can be obtained from this file.
    Last edited by LorDBulA; 07-24-2008 at 09:52.

  7. #7

    Default Re: Replay Viewer

    Thanks for the info. Been looking at some saves from the 1.1 savegame thread, and i've found where the player's faction is specified. Not at a computer with RTW at the minute, so I can't see if swapping it works. At least the weekend is coming up, so I can slowly figure out the format.

    Also, do you know how provinces are indexed? Is it in the order listed in DESCR_FACTIONS.txt? It just really helps to have some numbers to look out for.

  8. #8

    Default Re: Replay Viewer

    Also, do you know how provinces are indexed?
    I would bet on descr_regions.txt file (in Data/world/maps/base directory )

    In this file you can also get RGB values of province that you can use to draw a map (with help of map_regions.tga).
    Check out Recruitment Viewer for nice EB map you can draw on.

  9. #9

    Default Re: Replay Viewer

    I'm getting slightly more understanding of the format, and have just changed my faction from Rome to Aedui. Cant end turn though, apparently its still Rome's turn . Slow going though. I think I saw the map data - it looked list-like, although its hard to tell sometimes.

  10. #10

    Default Re: Replay Viewer

    Here's an update on progress. I'm nearly there (I think). Here's what I did to Roma while trying to figure out which byte defines ownership, so I can read it out later:

    Spoiler Alert, click show to read: 

    Spoiler Alert, click show to read: 
    Last edited by Chris_; 07-25-2008 at 00:22.

  11. #11

    Default Re: Replay Viewer

    Roma just got a new city plan!
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  12. #12

    Default Re: Replay Viewer

    Awesome idea here Chris_.

    I wouldn't go around asking for people to give suggestions as they are likely to end up asking for a full blown savegame editor... Unless your are up to such a challenge?!?

    Last edited by Gaias; 07-25-2008 at 23:18.
    Help make developers understand the importance of game AI and earn credits as a Game Designer. The Restaurant Game Project

  13. #13

    Default Re: Replay Viewer

    Gaias, I know for one, that I would certainly want that!

  14. #14

    Default Re: Replay Viewer

    I wouldn't go around asking for people to give suggestions as they are likely to end up asking for a full blown savegame editor... Unless your are up to such a challenge?!?
    I'm going to do the replay viewer first - I just found what the data I need in the save game ( it was 6E 00 00 00 06 that gave it away if anyone wants to know). After that, maybe a save editor (time permitting). I have accidentally changed most things by now anyway . But anyway, replay viewer first.

  15. #15

    Default Re: Replay Viewer

    Well, 6e = 'n' or simply 110; and the other is a four byte integer corresponding to what is IIRC called I_TurnNumber in the script?
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  16. #16

    Default Re: Replay Viewer

    It would be nice if you could document your discoveries when you are done with reverse-engineering RTW save file.

  17. #17

    Default Re: Replay Viewer

    Well, 6e = 'n' or simply 110; and the other is a four byte integer corresponding to what is IIRC called I_TurnNumber in the script?
    110 = Latium2, and 06 = Romani.

    It would be nice if you could document your discoveries when you are done with reverse-engineering RTW save file.
    I've been keeping notes as I go along. Half of them in a word document, half scrawled all over a notepad, along with with lots of ?'s and random doodles.

  18. #18
    Barely a levy Member overweightninja's Avatar
    Join Date
    Jun 2007
    Location
    Plymouth, U.K
    Posts
    459

    Default Re: Replay Viewer

    Quote Originally Posted by Chris_ View Post
    110 = Latium2, and 06 = Romani.



    I've been keeping notes as I go along. Half of them in a word document, half scrawled all over a notepad, along with with lots of ?'s and random doodles.
    *un-lurks*
    Ramdom .doc and notepad files are cool, I'm sure LordBula isn't the only one following this thead with interest
    Cheers mate
    *back to lurking*

  19. #19

    Default Re: Replay Viewer

    Quote Originally Posted by Chris_ View Post
    110 = Latium2, and 06 = Romani.
    Ah, I misread your post. But (obviously) you'd need region numbers/identifiers & faction numbers/identifiers as well to construct your map... <_<
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  20. #20

    Default Re: Replay Viewer

    Good news, I figured out what identifies the owner of a town. Also, I moved a city, rebound what cities own what provinces, and some other stuff. Replay editor should be easy to do now.

  21. #21

    Default Re: Replay Viewer

    Wow so city positions are controlled by save game? Thats surprising.

  22. #22

    Default Re: Replay Viewer

    Yeah, it seems to load most stuff from the files when the campaign is started, and after that just loads it from the save game. It still uses the files (it stores the path), probably for some cross referencing of buildings/traits and the like, but things like positions, and unit counts seem to be taken straight from the save.
    Last edited by Chris_; 07-27-2008 at 17:37.

  23. #23

    Default Re: Replay Viewer

    I suppose it's also possible to extract the # of cash any given factions has from the save game? Because that would be a real valuable piece of info to "replay" throughout the game; as it allows for more accurate testing of money scripts...!
    - Tellos Athenaios
    CUF tool - XIDX - PACK tool - SD tool - EVT tool - EB Install Guide - How to track down loading CTD's - EB 1.1 Maps thread


    ὁ δ᾽ ἠλίθιος ὣσπερ πρόβατον βῆ βῆ λέγων βαδίζει” – Kratinos in Dionysalexandros.

  24. #24

    Default Re: Replay Viewer

    I suppose it's also possible to extract the # of cash any given factions has from the save game?
    Yep, done that.

    As i've been going through this, i've been wondering how many of the supposed 'hardcoded' things are actually hardcoded. Yknow, the 240 unit count cap (which I broke), stuff like that.

    Update : Just swapped Baktria and Rome around completely, by changing two numbers
    Last edited by Chris_; 07-27-2008 at 18:00.

  25. #25

    Default Re: Replay Viewer

    I actually would love to write a peace of software that will allow player to boost up AI army composition to give more enjoyable gameplay.
    Basically less levies more professionals and with some right proportions of unit types.

    Getting AI standings with other factions would be very helpful to make head and tails of AI diplomacy decisions.
    Although this would be very tricky.

    And of course if we could raise faction from the dead by editing save game would be insane.

    Possibility to raze city like Carthage from the face of earth would also be great (although with all the scripts this would be more tricky ).

    I really hope you will share your findings Chris when you are done with reverse engineering save file.

    Great job man.

  26. #26

    Default Re: Replay Viewer

    I just sent Carthage off the map, and it seemed to just cease to exist. The game seems to get rid of everything that goes into the offmap.

  27. #27

    Default Re: Replay Viewer

    Quote Originally Posted by Chris_ View Post
    ( it was 6E 00 00 00 06 that gave it away if anyone wants to know).
    Bah! All you programmer types are freaking crazy anyways. All I see there in that alpha numeric sequence is blonde, brunette, and red head.
    Help make developers understand the importance of game AI and earn credits as a Game Designer. The Restaurant Game Project

  28. #28

    Default Re: Replay Viewer

    Quote Originally Posted by Gaias View Post
    Bah! All you programmer types are freaking crazy anyways
    Yep, all the more fun

    More findings :

    Spoiler Alert, click show to read: 


    Looks like it was meant to be 4 turns per year after all.

    Edit : Before anyone gets excited, I could get this to show up on loading, couldnt stop it from going Summer -> Winter -> Summer -> Winter. Yet
    Last edited by Chris_; 07-28-2008 at 06:08.

  29. #29

    Default Re: Replay Viewer

    Quote Originally Posted by Chris_ View Post
    Yep, all the more fun

    More findings :

    Spoiler Alert, click show to read: 


    Looks like it was meant to be 4 turns per year after all.

    Edit : Before anyone gets excited, I could get this to show up on loading, couldnt stop it from going Summer -> Winter -> Summer -> Winter. Yet
    I don't get it. What are we looking at?

  30. #30

    Default Re: Replay Viewer

    IIRC it doesn't go to Spring by default in vanilla, since it runs 2 turns per year. As it says Spring, which indicates that RTW was originally going to be 4 turns. Although, its been a while since I played vanilla.

    (Funny when you realise how little you remember about pre-EB)
    Last edited by Chris_; 07-28-2008 at 10:40.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO