Announcement

Collapse
No announcement yet.

Please help with the save file layout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please help with the save file layout

    Hi all, I am currently working on creating a utility that will create an automated game log from save game files. I have gathered a lot of information from this forum as well as from links from this forum. However, there are a couple of things I could use some help with.

    First, I have a a document by Allard Höfelt that maps out most of the save file for hex-editing, however, there are a few incomplete items. I know that all the wonders appear in the a block of bytes from 10A–141 (266-321 in decimal), however, the order of wonders is not listed. I had assumed it was by order in rules.txt, but it doesn't appear to be. I can find this out by trial and error, but if someone has done this, I would greatly appreciate being saved the extra effort and would be most grateful!

    Along the same lines, the location of city improvements is marked as the 53-57 byte of each city listing. I also have a brief description of how each byte maps out. However, I again would be eternally grateful if someone has a chart or table with each improvement mapped to its specific bit so that I can save a little more work for myself.

    The last thing I need is the biggest... I need some help in deciphering the save file programmatically. Using a hex-editor, it is easy to find the first city name and count backwards to the beginning of the city block section. Then each city is easy to isolate since it there is a set number of blocks per city. However, since it is a variable length section that follows several other variable length sections (map info, unit info, etc), how would you find the beginning of the first city while reading the file in? I know others have solved this in the past, especially for the 'civcity' utility made Carl Fritz, who also made the 'civtweak' utility. However, as yet, I have not developed an algorythm to do this.

    Thanks in advance for any help you may be able to provide.

    Albert B

  • #2
    Great idea, Albert !
    I cannot help now, too much work. But I might take a look at some of your questions in March.
    One more cause to worry, though. Are the saved files not different for 2.42, FW and MGE ?
    But it would be a great, great programm. The log/replay is, I think, the thing peoples misssed most from civ1.

    ------------------
    Oh Man, when will you understand that your greatness lies in your failure - Goethe
    Oh Man, when will you understand that your greatness lies in your failure - Goethe

    Comment


    • #3
      Some info on my above questions and for Julius...

      The layouts are a little different between a couple of the versions, but one of the first fields is a flag indicating which version the save file is from. My plan is to initially design it for MGE, which is the version I have. Then I should be able to easily go back and add support for other versions.

      I have the answer to the wonder layout and the city improvement format. The wonder layout really is in the same order as rules.txt. I had used an existing save file and was trying to locate wonders where I knew what city they were in, but apparently I just can't count straight... When I used a new game and slowly built each wonder and then checked to see where it was stored, it quickly became apparent of the order.

      As for the city improvement form, the bytes holding the information are bitmaps with each bit representing an improvement. I forgot about the 'none' improvement and that is why it was mapping out the way the document said it should.

      I am still working on determining the beginning of the city stack, but Carl (the developer of civcity and civtweak) was kind enough to forward some information to me. That's how I found my error with the city improvements. He also said he has some information for finding the said city stack.

      Anyway, that's my long winded update of my own problem...

      Albert B

      Comment


      • #4
        The automated log is a wonderful idea. It would be a great help. Unfortunatelly, having no knowledge of programing, I cannot help you.
        Rome rules

        Comment

        Working...
        X