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 > Miscellaneous > Archive > Scenario League / Civ2-Creation -Archive > how are maps saved?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
shade is offline shade
King
of bribery.
May 2001
time: 06:14
  Old Post 09-07-2001 02:04 Visit shade's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
how are maps saved? Support Apolyton or Terrorists Win

The title says it all,is there anyone out here who knows how civ II(2.42) maps are saved?
Let me explain what I mean:
In my own mapeditor I save maps as binaries and the information is stored like this:
First line: map_x,map_y dimensions,kind of map(round(1) or flat(0))
rest:for each tile an 8-bit number(bit1=huts,bit2&3=special,bit4=river,bit5...8=number for terraintype)and the tiles are stored left to right,top to bottom
end.

I hope there is someone who can help with this problem.
(if so I will be supplying a new mapeditor that builds random-maps that give continents/islands when asked for,it could be a solution for generated worlds )

Shade

William Keenan is offline William Keenan
Prince
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999
time: 00:14
  Old Post 09-07-2001 07:18 Visit William Keenan's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Gothmog

MAP INFORMATION:

The map header is at a fixed location depending on file format.
Offset 3586 in FW and later
Offset 3478 in CIC and earlier

The map header is 14 bytes long
~ Map X dimension : integer (2 bytes).
~ Map Y dimension : integer (2 bytes). A 50 by 80 map will show up as 100 by 80 here.
~ Map Area: integer (2 bytes) or X times Y divided by 2.
~ Flat Earth Flag: integer (2 bytes). 1 = flat, 0 = round.
~ Map Seed: integer (2 bytes). I haven’t fooled around with this yet to see if it might change the resource pattern in an active game.
~ Locator Map X dimension : integer (2 bytes): equals ‘Map X’ divided by 4 rounded up.
~ Locator Map Y dimension : integer (2 bytes): equals ‘Map Y’ divided by 4 rounded up. The locator map is the small map in the corner.

THE MAP BLOCKS:
These begin immediately after the header.
~ Block 1 contains terrain improvement data, such as irrigation. This block is 7 times the ‘Map Area’ bytes long.
~ Block 2 Contains the basic terrain type data. This block is 6 times the ‘Map Area’ bytes long.
~ Block 3 is the locator map. It's stored in 2 pieces, each piece being ‘locator map x’ times ‘locator map y’ bytes long.
~ Note: Viewing the save file in graphical mode in the hex editor is what allowed me to figure out what these map blocks lengths were. When I oriented the hex editor to start viewing at the beginning of map block 3 and made the width of the display the same as the ‘locator map X dimension’, I could see two little maps! So when you’re looking around a save file, you might want try graphical mode to see the big picture.


I strongly suggest that you read Hex Editing by Allard Höfelt

shade is offline shade
King
of bribery.
May 2001
time: 06:14
  Old Post 09-07-2001 14:28 Visit shade's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

thank you very much this is just what I needed.

shade

Mercator is offline Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:14
  Old Post 12-07-2001 00:55 Visit Mercator's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

For maps you´d better have a look at some more recent info on this @ http://gene.wins.uva.nl/~jvermeir/savmaps.htm
It contains info about the encoding of maps in both map files and savegames.

shade is offline shade
King
of bribery.
May 2001
time: 06:14
  Old Post 12-07-2001 00:23 Visit shade's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Full PM-box? Change here!

thx, it gives the same info as the link keenan provided
(something both forget to mention is that in the map the 4th integer(i think) the one that holds width/4 this is the width you use in the first integer(ie:width*2))(this crashed my computer 3 times before i figured it out)

btw those .mp files are a nightmare(try opening with word ,close,save changes(although you didn't do a thing) and voila your file just increased 25% in size and became worthless)
as you can see I had my fun

shade

Mercator is offline Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:14
  Old Post 12-07-2001 03:33 Visit Mercator's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Remove this text

quote:
thx, it gives the same info as the link keenan provided

Well, most of it is the same, of course. I believe I made a few additions to the explanation of the encoding in savegames, though. Nothing short of Allard´s doc and William´s reference to it, of course.

quote:
Originally posted by shade
btw those .mp files are a nightmare(try opening with word ,close,save changes(although you didn't do a thing) and voila your file just increased 25% in size and became worthless)
as you can see I had my fun


That´s because there are a lot of appearances of the hex code 0A, which is the code for either a line-feed or a carriage return. In Windows a return this is encoded with a combination of both 0D 0A (or was it the other way around?), so when Word opens the file, it finds all the invalid occurences of returns, and replaces them by the above mentioned combination.
But you knew this, right? Since you appear to be a programmer, or so I hope if you´re creating a game! .
But why use Word at all on binaries, you surely have some hex-editor?

I´m rather puzzled why your post seems to be posted half an hour before mine though. Not only that, it couldn´t even post for a while, always getting the you-can-only-post-once-every-30-seconds message.

shade is offline shade
King
of bribery.
May 2001
time: 06:14
  Old Post 19-07-2001 03:26 Visit shade's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Browse Apolyton AD-FREE

Mercator: I thought it would be something like that.
btw I 'm no real programmer in the sence I did study for it.It's just a hobby of mine.Yes, I am trying(and i really mean trying) to make my own Civ-game.(You can read all about it on my webpage)
Hex-editor
no don't have one(and don't need one for the moment)

Grtz Shade

Mercator is offline Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:14
  Old Post 19-07-2001 20:15 Visit Mercator's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Inflate your Upload Space

Well, good luck with creating that game

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
archivepost
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.0304 seconds (88.41% PHP - 11.59% MySQL) with 31 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