 |
|  |
 |
|
AlanH
|
|
quote: Originally posted by dreyk
... I hope that you know some way to decompress BIX files to make changes and then compress it again ..... |
I expect the BIX file compression process is the same as for BIC files. I found this reference describing the actual compression format, and there's Java source code available to implement the decompression in the MapStat Java source. I have successfully ported ChiefPaco's Java code into Objective C, and I'm sure it could be done for other languages.
It's not essential to compress copies of BIX files using the same format, as you can compress them using WinZip or whatever for efficient transfer over the Internet, and they can be installed uncompressed in the user's actual scenario folder. I suppose there's a bit of a benefit in disk usage, but at a dollar or two per gigabyte these days, disk capacity is not really a big issue.
-- Alan
|
|
|  |
 |
|
AlanH
|
|
quote: Originally posted by dreyk
At first, thank you kindly for your reply!
If I understand you quite well (English is not my native language then Civ3 can work with uncompressed BIX files, isn't it?
If it's true - it's really great!
Then we can uncompress scenario file (BIX), make some changes with it and then just save file with old name. After we can load this scenario directly from game and play it.
Please, correct me if I wrong. |
I'm pretty sure that uncompressed files would work for .BIC files. I don't have PTW, so I can't be so sure about .BIX files, but it is unlikely that Firaxis changed it.
quote: And one more question:
Maybe you know some way (utility etc.) to compress BIX back after we made changes?
For example: original_compressed.bix -> changed_uncompressed.bix -> changed_compressed.bix | It is possible, of course, but I have not seen any code to do it, only the description of the compression algorithm that I gave you. You could write your own compression program using that desription, but why bother if it works uncompressed?
-- Alan
|
|
|  |
 |
|
Gurrie
|
|
I'm having a question bout .BIX as well. Maybe a silly one, don't know
My CivIII gives an error when i want to open a BIX-scenario-file. I don't know what the problem is, but I can only open BIC-files...
Anyone familiar with this?
|
|
|  |
 |
|  |
 |
|
DrAlimentado
|
|
Hi, first let me say thanks to all who have contributed to this excellent thread. I have been coding up a small app to do some map tweaking stuff (copy/paste, resizing etc.) and without the information I gleaned from here I would probably never have even started it. This thread has been a real godsend for me!
I'm having a problem with my bix reading code and the new FLAV section. It appears to break the regular format of; section header(4 bytes); No of sub-sections(4 bytes); length of this sub-section(4 bytes); rest of sub-section, next sub-section etc.
What I see in the FLAV section is "FLAV" then [1,0,0,0][7,0,0,0] then the seven flavour sections, each starting with [1,0,0,0]. Am I going nuts or have they really changed the format for this one section? I can't find a value that corresponds to the section length (292x7) anywhere in the FLAV section either I hope I am wrong here... I just can't see how at the moment.
Oh well, if it really is the case that they have changed the format then at least it appears that the FLAV section will be a fixed length.
I don't actually need the FLAV section at all as my code is just for map tweaking - I just need to be able to read past the section to get at the map data, it's annoying that the 'generic section reading' code I have won't do it though!
Last edited by DrAlimentado on 31-12-2003 at 08:28
|
|
|  |
 |
|
darndt
|
|
Hi,
I'm writing a program that will convert a Civ3 map into a Civ2 map. Right now I only care about converting BIC files.
I believe that I have deciphered the "river info" part in the TILE section in BIC files. I'm basing my results on Civ3Edit v1.32.1 for Mac, which creates BIC files of v3.8.
The beginning of this thread shows the river info part as:
code:
2 short river info
I think it should be:
code:
1 byte river crossing data (binary):
00000000
crossing N .......1
crossing NE ......1.
crossing E .....1..
crossing SE ....1...
crossing S ...1....
crossing SW ..1.....
crossing W .1......
crossing NW 1.......
1 byte ??? (0)
(How do I indent or preserve spacing without using the [ code ] tags?)
The river crossing data is like that posted by Gramphos for BIX 11.18 on page 2 of this thread. It's in a different part of the tile info, though.
I have also discovered some subtleties in how the data is stored. Namely, a bit value of 1 is present for the N, E, S, and W parts if the river continues going straight as it leaves the tile or if the river turns along the edge of the tile. However, a the bit value is 0 if the river turns away from the tile as it leaves, or if it is a point where the river begins/ends. The point where a river runs into the sea is an end of the river so it gets a bit value of 0.
Edit: If a river touches a corner of a tile but does not run along the adjacent edges, a bit value of 1 is used.
These rules seems to work for computer-generated rivers, but if you make your own kooky rivers that run along the coastline, the encoding is a bit different. I don't want to bother figuring it out.
Maybe the river crossing data in BIX 11.18 also follows the same rules.
I made a picture as I was figuring this out, and it should help illustrate.
Attachment: river_crossing.jpg
This has been downloaded 59 time(s).
Last edited by darndt on 04-01-2004 at 00:57
|
|
|  |
 |
|
darndt
|
|
I've figured out a bit more about rivers in BIC files.
At the beginning of this thread, in the TILE section there is this part:
code:
2 short bonuses (binary):
00000000
bonus grassland .......1
player start ....1...
snow-capped mts ...1....
pine forest ..1.....
I think it should be:
code:
1 byte bonuses (binary):
00000000
bonus grassland .......1
player start ....1...
snow-capped mts ...1....
pine forest ..1.....
1 byte river source info (binary)
00000000
river in north .......1
river in west ......1.
river in east .....1..
river in south ....1...
It appears that the "river source info" is only non-zero if the following conditions are met:
- The given location is the point where a river was started by a human using Civ3Edit. That is, when it was initially placed it was not an extension of an existing river. If a river is extended so it looks like it starts at a different location, the river source info remains unchanged. Single-point rivers are encoded in the river source info. I think that single-point rivers can only be created by starting a new river source, and not by deleting part of an existing river.
- The river still exists in the given location. It was not deleted and replaced by a river extension.
- The tile is a land tile.
The river source info is similar to the "river connection info" posted by Gramphos for BIX 11.18 on page 2 of this thread. Maybe that data follows the same rules.
David Arndt
|
|
|  |
All times are GMT. The time now is 05:19. Apolyton Time is 00:19. |
top of page
|
|
|
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
|
|
|
|
|
|