Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Civilization III > Civ3-Creation > Civilization III SAV file format
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
16.Sep: 7 NEW FILES
15.Sep: TRIAL + NO SLEEP = ONE GAME
13.Sep: PATCH THE PREVIOUSLY UNPATCHABLE

bottom of page
   - CIV3 CONQUESTS $29.99 - CIV3 from $9.99
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
hot-bandito is offline hot-bandito
Settler
Eschweiler, Germany
Dec 2001
time: 06:16
Question  Old Post 17-12-2001 17:49
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Civilization III SAV file format Enter the AD-FREE zone

Hey Savegame-Editor-Programmers!

I would like to have all available infos or sourcecode about accessing and manipulating the SAV-files, please.

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 17-12-2001 19:21
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Suffering from ads?

What would you use it for?

The reason why I haven't given anything out, other then to other programmers, is that there are competitive games, and the fact that most of what I have are really hard to understand.

hot-bandito is offline hot-bandito
Settler
Eschweiler, Germany
Dec 2001
time: 06:16
  Old Post 17-12-2001 20:01
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

I want to know, if itīs possible to program a kind of email-multiplayer: Player1 saves the game, sends it to a friend (player2), player2 alters the savegame (switching the human-controlled civ), loads the savegame, makes the turn, saves the game and so on...

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:16
  Old Post 17-12-2001 20:24 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by hot-bandito
I want to know, if itīs possible to program a kind of email-multiplayer: Player1 saves the game, sends it to a friend (player2), player2 alters the savegame (switching the human-controlled civ), loads the savegame, makes the turn, saves the game and so on...


This might get implemented in a future patch by Firaxis, a feature called PBEM and already in use in Alpha Centauri and Call To Power.

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 17-12-2001 20:42
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Got spare money?

Nothing of want I know could be used for this. (I don't know where it stores what civ is human controlled)

hot-bandito is offline hot-bandito
Settler
Eschweiler, Germany
Dec 2001
time: 06:16
  Old Post 18-12-2001 03:39
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase Your PM Length

quote:
Originally posted by Gramphos
What would you use it for?

The reason why I haven't given anything out, other then to other programmers, is that there are competitive games, and the fact that most of what I have are really hard to understand.


If itīs written in VB, I will understand. If itīs written in C, it will take some time...

Merp is offline Merp
Settler
Brisbane, Australia
Dec 2001
time: 15:16
  Old Post 18-12-2001 04:51
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Help yourself to an AD-FREE life

It is reasonable to release the format of the file because then it is useful for any programming language: VB, C, C++, asm, Java, Pascal, Haskell, etc. Rather than wade through someone else's source, the format lays it all out and shows what we know and don't know.

Release of source is always at the descretion of the author. Having said that I think cooperative enterprises like civ3 prosper more from opensource style arrangements.

Last edited by Merp on 18-12-2001 at 05:03

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 18-12-2001 17:31
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton buy from Amazon

Well, but I don't know very mush about the format, and it is mostly the source code that makes the job. If I ever get an understandable description of the format I might publish it. As far as source code I'm more restrictive, not that this is anything to protect, but there might be other code that I don't want to get out. And if something doesn't work properly I don't want to tell everyone what changes to make.

So, you have to wait until I know more about the format myself.

Whoha is offline Whoha
King
The TOC is supposed to be classified guys...
Dec 2001
time: 23:16
  Old Post 19-12-2001 21:55
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
havent done alot of work into this but... Tired of ads?

heres what ive got

In the file theres a string TILE that marks the beginning of each one

then a long int of 28(havent seen this vary at all)

then another long int which I do not know what it means

The next long int is the resource one
0-21 means the resources and ff ff ff ff means no resource
(thats all the resources 0-7 strategic, 8-15 luxury,16-21 bonus)

then 2 more long ints that i dont know about

then the terrain and enhancement controllers long int
The first one is a bitwise operator with each of the bits meaning
road RR Mine irrigation fort goodie-hut pollution camp
or lemme try out the other way of writing it i saw
first byte 0 0 0 0 0 0 0 0
road 1 0 0 0 0 0 0 0
RailRoad 0 1 0 0 0 0 0 0
Mine 0 0 1 0 0 0 0 0
Irrigation 0 0 0 1 0 0 0 0
Fort 0 0 0 0 1 0 0 0
Goodie-Hut 0 0 0 0 0 1 0 0
Pollution 0 0 0 0 0 0 1 0
Barbarian Camp 0 0 0 0 0 0 0 1

The second and third bytes arent bitwise as far as i can tell, they control terrain
2nd byte 3rd byte value
Desert
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Plains
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 17 0
Grassland
0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 34 0
Grassland_Bonus
0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 34 1
Flood PLains
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 64 0
Hills
0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 82 0
Mountains
0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 98 0
Forest_Grassland
0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 114 0
Jungle_Grassland
0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 130 0
Coast
1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 153 0
Snow-Tipped Mountains
0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 98 16
Pine Forests_Grassland
0 0 1 0 1 1 1 0 0 0 0 0 0 1 0 0 114 32
Ocean
1 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 187 0
Forest_Plains
1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 97 0

I dont know about the forest plains one, im just assuming thats what it is, also i havent checked what sea squares are yet.
I also dont know what the 4th byte here means.

Also I understand that the tiles are marked in this particular way:
say you have a 4x4 map, heres the order in the file the tiles would appear the the isometeric nature of the map makes this alittle difficult to understand at first.

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Also tiles dont contain unit info, thats stored later under strings marked unit

Whoha is offline Whoha
King
The TOC is supposed to be classified guys...
Dec 2001
time: 23:16
  Old Post 19-12-2001 22:13
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
doh cant edit it Put an end to popups!

sorry about the spacing

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 20-12-2001 01:55
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Civilization 2

Yes, that is the map format, the easiest thing in the SAVs. The first part of it is almost the same as the one in the BIC.

However there is a few things that is in another way then you stated.:
that first long int is the remaining length of the section.
After that comes one byte of riverinfo. (I don't know exactly how it works yet)
Then one byte with the ingame id of the civ that has that tile in its border (-1 = NO CIV)
the two next bytes are unknown for me.

then, as you said the Resource# and 2 unknown long values.

For the terrain it is as you said first a bitwise byte of overlays.
After that is however two nibbles with the terraininfo. The first nibble is the actual terrain, and the second nibble the base terrain (used with mountains and forests). After that there is a short int that is bitwise for the bonuses. I see the BIC-format for more info on what the meaning of the bits are.
Then there are an unknown short (-1 = nothing, 75 = barbarian camp), an long, and then a short with the continent ID

hot-bandito is offline hot-bandito
Settler
Eschweiler, Germany
Dec 2001
time: 06:16
Post  Old Post 20-12-2001 17:18
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Enter the AD-FREE zone

Here's some info from CTYSON on structures in the save files. While I start by searching for the "packet IDs", you can't rely on them alone because they are often repeated with different meanings...e.g. there are at least 3 "WRLD" packets, and each city has 5 "CITY" packets. Also, the save files are full of random junk data which sometimes imitates packet IDs.

World...search for "WRLD"

Pos Len
0: 4: "WRLD" packet ID
4: 4: data-length of packet (always $0002?)
8: 2: unknown
10: 4: "WRLD" packet ID (but I continue to count from the 1st)
14: 4: data-length of packet
22: 4: Y-size of world
42: 4: X-size of world


Players...search for "LEAD"

Pos Len
0: 4: "LEAD" packet ID
4: 4: data-length of packet (always $1174?)
8: 4: player number (range 0-31, in ascending order. 0 is
always
Barbarian; human is currently always 1)
12: 4: race of player's civilization (range 0-16)
232: 4: current research project


Units...search for "UNIT"

Pos Len
0: 4: "UNIT" packet ID
4: 4: data-length of packet (always $0121?)
8: 4: unique unit number, in ascending order. First unit is 0
12: 4: X-position
16: 4: Y-position
20: 4: previous X-position, -1 if unit never moved
24: 4: previous Y-position
28: 4: owner (by player number, NOT race number)
40: 4: unit type (index into list of units)
44: 4: level (0 = conscript, 1 = regular, etc.)
52: 4: damage taken (0 = full strength)

Cities...search for "CITY"

Note there are several data packets labelled "CITY" for each city...
I am oversimplifying by counting from the first.

Pos Len
0: 4: "CITY" packet ID
4: 4: data-length of packet (always $0088?)
8: 4: unique index number of city?
12: 2: X-position
14: 2: Y-position
16: 1: owner (by player number)
44: 4: shields collected for construction
52: 4: what city is constructing (index into list of either
units or buildings, see next entry)
56: 4: type of construction ( 1 = building, 2 = unit)
384: 28: city name

After the city name there are several packets relating to population and citizens, followed by a "BINF" packet which relates to improvements:

Pos Len
0: 4: "BINF" packet ID
4: 4: data-length of packet (always $0004?)
8: 4: number of possible buildings

This is followed by 12 bytes for each building. To discover which
building is meant, you have to index into the building list:

Pos Len
0: 4: year of construction, 0 if not built
4: 4: number of player who constructed building (?), -1 if
not built
8: 4: accumulated cultural value of building (??)

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 20-12-2001 19:40
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Help yourself to an AD-FREE life

Good, as you have gotten started, I think that there is no need to keep what I know secret any longer.

For the CITY sections:

60: 4 year founded

384: 24: city name
408: 4 numbers of queue slots used
412: 9 * 8 Build data (4 Index and 4 type) for each of the 9 slots


The BITM section:
0: BITM Section starter
4: 4 length (40)
8: 32 bitwise building info. One bit foe each building type
40: 4 Number of bits used (74 with default rules)
44: 4 Unknown


For the UNITS:
32: Nationality
56: Movements used (stored in number of road movements used (default rules 3* movements))
72: Loaded on (Ingame Unit ID of unit that holds this unit. (used with ships and armies))


But remember that the hardest is to find the right Section. (If you make a tool)

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 20-12-2001 19:51
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton buy from Amazon

I'll remind everyone about that the X and Y value for cities only is the name, and where units from the city are created.

The location on the map is stored among the TILE-sections. However there are to many places where the Citynumber appear to be able to tell what all mean.
(Many of the unknown values are citynumbers. (some are for the city that work on that tile, others for the actual city.))

I think I managed to create a tile that teleported you directly to a city once, but I don't remember how I did it .

hwinkels is offline hwinkels
Settler

Nov 2001
time: 00:16
  Old Post 21-12-2001 14:53 Visit hwinkels's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Up

Chieftess is offline Chieftess
Chieftess
Baltimore, Md.
May 2002
time: 00:16
  Old Post 21-05-2002 23:24 Visit Chieftess's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Full PM-box? Change here!

Looks interesting. (yes, a "bump")

Anyone know of a more complete one? I'm creating a unit/city placement tool (That includes Fog of War, and other civs).

Gramphos is offline Gramphos
ACS Civ III Files Manager, Prince of Development
Chalmers, Sweden
Apr 2001
time: 06:16
  Old Post 22-05-2002 00:41
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Got spare money?

quote:
Originally posted by Chieftess
Looks interesting. (yes, a "bump")

Anyone know of a more complete one? I'm creating a unit/city placement tool (That includes Fog of War, and other civs).

Send me an email describing your project, and i might be able to help you.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:16.
Apolyton Time is 00:16.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0491 seconds (92.41% PHP - 7.59% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net