Thread Tools
Old February 8, 2001, 09:58   #1
Albert B
Warlord
 
Albert B's Avatar
 
Local Time: 19:14
Local Date: October 30, 2010
Join Date: Dec 2000
Location: Indianapolis, IN USA
Posts: 118
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
Albert B is offline  
Old February 9, 2001, 07:48   #2
Julius Brenzaida
King
 
Julius Brenzaida's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Aug 2000
Location: Currently cleaning the 9000 rooms of Sticky Mouse's Palace
Posts: 1,171
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
Julius Brenzaida is offline  
Old February 9, 2001, 09:14   #3
Albert B
Warlord
 
Albert B's Avatar
 
Local Time: 19:14
Local Date: October 30, 2010
Join Date: Dec 2000
Location: Indianapolis, IN USA
Posts: 118
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
Albert B is offline  
Old February 17, 2001, 09:50   #4
Roman
King
 
Roman's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Sep 2000
Location: Bratislava, Slovakia
Posts: 1,292
The automated log is a wonderful idea. It would be a great help. Unfortunatelly, having no knowledge of programing, I cannot help you.
Roman is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 20:14.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team