Converting civ3 maps to other formats

Fullerene

Warlord
Joined
Aug 26, 2009
Messages
228
I'm looking for way to automatically convert civ3 maps to another format. For example I want to convert map from civ3 into Freecol map.

I googled this:http://apolyton.net/showthread.php/105623-Civilization-III-BIX-BIQ-file-format, but I guess there already exists map/save game editors that can process the binary data of biq file for example. Is there any tool that can convert the binary bic/bix/biq file into for example readable text file? Or is there source code available for reading the binary file of civ3 map?

I could of course try to create my own conversion app, but I wouldn't like to do work someone else has already done. :)

I'm interested of terrain types of tiles and river placements. Rules and city/unit placements aren't necessary for me.

I own steam version of CivIII complete, if it's required.
 
The Apolyton link you found is the definitive Civ3 scenario format thread. And your suspicion that other tools have already been made to read it is correct. My Civ3 editor (in sig), Steph's, and several other tools can do that. However, getting them into the format you need may require some additional work.

Starting with what I'm most familiar with, my editor does have the ability to export information about the map (and all the Civ3 scenario sections, actually) to a text file, in a properties style format, such as:

Code:
Tile at 71, 69
tileID: 2726
dataLength: 45
riverConnectionInfo: 0
border: 0
resource: -1
image: 39
file: 3
questionMark: 0
overlays: 0
baseRealTerrain: 17
bonuses: 0
riverCrossingData: 0
barbarianTribe: -1
colony: -1
city: -1
continent: 1
questionMark2: 6
victoryPointLocation: -1
ruin: 0
C3COverlays: 0
questionMark3: 0
C3CBaseRealTerrain: 17
questionMark4: 0
fogOfWar: 0
C3CBonuses: 0
questionMark5: 0
owner: -1
borderColor: 0
definiteOwner? false

This is somewhat more readable, but isn't ideal. For example, "baseRealTerrain: 17" tells you what type of terrain is at that tile, but it isn't obvious what that "17" means. I could improve it to be clearer without too much additional work, but there hasn't been demand for it for years.

The source code for my BIQ-reading functionality is available at https://bitbucket.org/QuintillusCFC/civ3_shared_components. This isn't the entire editor, but with a few lines of code you can load a BIQ, and then manipulate it as needed. I think I had an intro to it somewhere; if not I can provide more details or add one.

I could probably also help with some of the code, with more specifics on what is required. I could either make some tweaks to the exporting tool in my editor to make it more useful for what you need, or potentially do some sort of direct-to-Freecol tool, provided that (a) there's decent documentation on the Freecol format somewhere, and (b) it wouldn't take too long (in which case I may still be able to if it looks interesting, but it might take longer than what you're aiming for).

As I recall your game thus far has hex tiles, so I'm curious what you're thinking for that, since Civ3 is isometric, and if that is the case it wouldn't be a 1:1 conversion.
 
Great! Your editor's ability to provide text data is exactly what I needed.

Had bit of headache with coordinates system, but I have the basis of conversion system down now. Although I had forgot that rivers in CivIII flows between tiles, not inside them as in Freecol. So rivers require some manual fixing.

Creating full map converter for Freecol sounds like interesting task. With some creativity it might be possible to convert certain scenarios too. But at the moment, the modding community of Freecol is almost non existing though, so it might not be worth the effort.

As I recall your game thus far has hex tiles, so I'm curious what you're thinking for that, since Civ3 is isometric, and if that is the case it wouldn't be a 1:1 conversion

No, nothing to do with my game project. I just want to create scenario/mod for Freecol.
 
https://github.com/myjimnelson/c3sat

I have a project that reads an uncompressed save file and exports the map data to JSON. It's probably not as capable as Quinitllus' code, but it may have the info you need to create a map in another format as it's basically a JSON dump of all the map data I can decode.

It's currently done in Python which isn't something every Windows machine has on it.

Here's an example tile. Actually it's not a very good example as it's poorly copied and pasted, and it's the upper-left tile which has no player visibility. Some more info is included if the value of that info isn't -1. But you get the idea of what might be in there.
Spoiler :
Code:
        {
            "land_trade_network_id": [
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535, 
                65535,               65535, 
                65535
            ], 
            "terrain": 221, 
            "terrain_features": 0, 
            "improvements_known_to_civ": [
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0, 
                0
            ], 
            "rivers": 0, 
            "whatsthis": 0, 
            "is_visible_to_flags": 0, 
            "improvements": 0, 
            "is_visible_now_to_flags": 0, 
            "worked_by_city_id": 65535, 
            "continent": 6
        }
 
Oh yeah, good thought that the JSON you have might be a good fit. Though hopefully the note on August 2nd means things have progressed well on that front. Nice idea to do it for FreeCol; there's quite a few Civ3 maps here that could potentially be imported.
 
That python script might be useful for converting more maps.

But yes, I already converted the map I wanted. It was Rhye's 180x180 Earth map, that seems to be very suitable for the global colonization scenario I have in mind. I had to manually place the rivers since the format differs from civ3. Also Freecol has few more terraintypes than civ3, so that caused some extra work too. But the whole process of converting the map took me just few hours, so I'm happy with the method and result.

This is offtopic, but I think that Freecol has lot of potential to become awesome historical scenarios engine at least for certain eras. The colonization style resource system and city population management allows describing more detailed economies and societies than in Civ series. And the fact that it's 100% open source game, means endless possibilities of modifications. At the moment there's no official scenario editor though, but I extended the map editor to support city placing while I'm building up scenario of the world 1500-1800 A.D. I plan to release the editor when I'm finished with the scenario.
 
Glad it worked! Incidentally, if you have a script/program that is creating the maps currently, I wouldn't be opposed to adding an option to the editor to automatically invoke what you have and get a FreeCol map out of it, and take a step out of the process.

The idea of exporting existing Civ3 maps and making FreeCol scenarios out of them is interesting. There's long been a fair amount of interest here about ways of extending Civ3, and I think it's worth thinking about ways to take what's available in Civ3 and make use of it (or parts of it) in other games, as well as possibly going the opposite way and, say, taking a cool FreeCol map and being able to convert it into at least a starting place for a Civ3 map. The Paradox community has done some interesting things with, for example, allowing Europa Universalis III and IV games exportable to and playable in Victoria II - to the extent that there is now an official, supported converter between two of their games - and being able to move more easily between games more easily could be interesting for the Civ series as well, even if it's converting assets rather than save games.
 
Quintillus, is it possible using your editor to import maps into .biq format from Vanilla's .bic format and Play the World's .bix format?
 
Quintillus, is it possible using your editor to import maps into .biq format from Vanilla's .bic format and Play the World's .bix format?

Not currently. The status right now is that I've done some work for opening .bix files, with a goal of being able to open them and save them as .biq, but it's not complete, and I haven't looked at .bic before that.

However, it's an interesting thought to look at just the map, since that would allow taking a vanilla/PTW map and then adding Conquests rules to it, without relying on the Firaxis editor as an intermediary. I'm not sure at this point how straightforward that would be - probably more so than being able to open a whole .bix, but I'd have to check for a better estimate (and it's already late here, so I'll do that at a future time).
 
Top Bottom