Civ3MultiTool - Now at Civfanatics

Status
Not open for further replies.
I am writing a program (using SUN java) to look at some of the flags in the UNIT structure in an uncompressed saved game. I can find the first structure by searching in the uncompressed game for ASCII "UNIT" but that wastes a lot of time because there is a lot of data that comes before that in the file. How do you find where the first "UNIT" structure is in an uncompressed saved game without searching through anywhere from 500K to multiple megs of data?

The reason I need to look at these flags: after an elite unit creates an elite, a flag gets turned on in that unit's structure so that it will never create another leader. Thus some elite units can create leaders and others can't but they look exactly the same unless you look at the internal flags.

It would be easier if you could add a field to display the flags at offset 0x30 after the start of the "UNIT" string, but I'll take any help I can get....
 
Originally posted by sumthinelse
I am writing a program (using SUN java) to look at some of the flags in the UNIT structure in an uncompressed saved game. I can find the first structure by searching in the uncompressed game for ASCII "UNIT" but that wastes a lot of time because there is a lot of data that comes before that in the file. How do you find where the first "UNIT" structure is in an uncompressed saved game without searching through anywhere from 500K to multiple megs of data?

The reason I need to look at these flags: after an elite unit creates an elite, a flag gets turned on in that unit's structure so that it will never create another leader. Thus some elite units can create leaders and others can't but they look exactly the same unless you look at the internal flags.

It would be easier if you could add a field to display the flags at offset 0x30 after the start of the "UNIT" string, but I'll take any help I can get....
Do you know what these flags are for?

I can read them, but I've not had time to investigate what I should put on checkboxes for them if I made any.

For the Location of the Units I also do some searches. However, as I read more parts of the save I do read it step by step, so the searching isn't so long. For instance you can see that their is a BIC header somehere in the early file. This has first a long value set to 8. The next value is the length of the BICs saved in the file. Skip the next long, and then jump those bytes. That way you will save a coupple of 100kB search. Also remember to not read 4 bytes at a time, but maybe 256 bytes, and use finding routines to search for UNIT in those areas. Then you always have to keep the three last bytes of a read chunk first in the next chunk.

Many of the sections begin with the length of them, and you can, byy reading it, skip searching over the map.
 
Just takeing a quick look at those flags in a few saves I think that I can spot "Has generated a leader" and "Has attacked" flags. But I'm not sure if thast's what they really are.
 
Originally posted by Gramphos

Do you know what these flags are for?

I can read them, but I've not had time to investigate what I should put on checkboxes for them if I made any.


Thanks for the info Graphos! :)

The flags at +0x30 from the start of the "UNIT" string:

The only one I know is the one defined by mask 0x20. After an elite unit creates a leader this flag gets turned on, and after that that elite unit can't create a leader again (this is not documented but I found it out empirically and Mike B. from Firaxis confirmed that an elite can create ony one leader).

So if that flag is on, it means "created leader."

Firaxis may make these "used" elite units visually different in some patch but hasn't promised to do so.
 
Okay, that was one of the flags I found out. The other is 4, which I think setts that a un it has attacked once.

Would you want them viewable, or editable?
 
Originally posted by Gramphos
Okay, that was one of the flags I found out. The other is 4, which I think setts that a un it has attacked once.

Would you want them viewable, or editable?

Hey, thanks again for your interest!

I just wanted them viewable, but IDSmoker wants them editable so that he can turn all these flags (0x20) off so that doesn't have to keep track of which elites have created leaders. That is, he wants to turn the flag off every time an elite creates a leader so that they will all have that same property.

As for myself, I play games slowly and viewable-only would be all I need. I'll try to take a poll, at least among the people who are most concerned, but I may find that more people care than I think....
 
Originally posted by Gramphos

Well it's alot easier when the first versions weren't compressed (as you then know how it should look once you had decompressed it)

You can test with standard compression routines. (Does SAVexpnd.exe work with it? (Then it is PKWARE compression))

It can also be a separately developed compression, but that is in most cases more expencive then to use already created and efficient compressions. So look for different cvompression libraries.

Thx.
The AVExpnd.exe don't work with it. But I think every compressed archiv has a special "design" of ascii-code. These savegames start with "+...BILZ.(...." and the string "BILZ" is very often in it. Did you eventually know which program it is? (I've trying to extract it with a lot of programs, but the correct one wasn't with in it)
 
Originally posted by sumthinelse


Hey, thanks again for your interest!

I just wanted them viewable, but IDSmoker wants them editable so that he can turn all these flags (0x20) off so that doesn't have to keep track of which elites have created leaders. That is, he wants to turn the flag off every time an elite creates a leader so that they will all have that same property.

As for myself, I play games slowly and viewable-only would be all I need. I'll try to take a poll, at least among the people who are most concerned, but I may find that more people care than I think....
The biggest problem is the way I handle strings and flags doesn't allow me to make gaps in the flags. I might be able to do something about it.
 
Originally posted by CCJ39


Thx.
The AVExpnd.exe don't work with it. But I think every compressed archiv has a special "design" of ascii-code. These savegames start with "+...BILZ.(...." and the string "BILZ" is very often in it. Did you eventually know which program it is? (I've trying to extract it with a lot of programs, but the correct one wasn't with in it)
I'm not sure about what the BILZ means.

As you made thoes ... in the beginning, do you have the first say 16 bytes of the compressed file in HEX?
 
Don't think I've posted here before, so let me just start by applauding the great work you're doing Gramphos :goodjob: It's really making a modder's life easier.

2 humble requests - seing that the TCG Editor has apparently died, is there any chance you will include any of the features that were unique to that, in your savegame editor?. Most importantly IMO, the ability to change the active player.
And, is there any chance Kal-el will ever convince you to include a Building re-ordering function :) ? (beg, beg, grovel, grovel)
 
Originally posted by Isak
Don't think I've posted here before, so let me just start by applauding the great work you're doing Gramphos :goodjob: It's really making a modder's life easier.

2 humble requests - seing that the TCG Editor has apparently died, is there any chance you will include any of the features that were unique to that, in your savegame editor?. Most importantly IMO, the ability to change the active player.
And, is there any chance Kal-el will ever convince you to include a Building re-ordering function :) ? (beg, beg, grovel, grovel)
On the first request I say that it's not very likely, at least as it stands now. The second might be added, but in that case I'll not edit any pcx-files (which means that the icons needs to be fixed by the editor).
 
Originally posted by Gramphos
On the first request I say that it's not very likely, at least as it stands now.
That's sad - it would be incredibly helpful for playtesting our mod, and figuring out if the AI is up to all the changes we've made. Is it impossible, or do you just not want to do it?:confused: (I realize it could also be used to cheat, but...)
The second might be added, but in that case I'll not edit any pcx-files (which means that the icons needs to be fixed by the editor).
No problem on my part - it is the reordering in the BIC that is a pain in the a**. Editing the PCX files is like summer vacation :)
 
Originally posted by Isak
That's sad - it would be incredibly helpful for playtesting our mod, and figuring out if the AI is up to all the changes we've made. Is it impossible, or do you just not want to do it?:confused: (I realize it could also be used to cheat, but...)
It's just too mush work to do as it stands now. I'll have mush less time to program in a period of ten months from now, so it means that only very minor additions will be made, and that it may take up to one month for it to support the next generation of BIC-files. (And I don't know what features will be in PTW and the next editor, so I don't know how mauhs of the tool to keep) No major changes before PTW at least. I don't even know if I'll posrt the SGE to PTW. (Ynless I can make it impossible to load MP games.)

No problem on my part - it is the reordering in the BIC that is a pain in the a**. Editing the PCX files is like summer vacation :)
I'll look into it.
 
@gramphos
These was the first bytes.

I've attached a screenshot of my hexeditor with a savegame.
You can't see it, but the string "BILZ" is very often in the savegame. (the savegames are 25-27MB)
 

Attachments

  • hexview1.jpg
    hexview1.jpg
    369 KB · Views: 626
Originally posted by Gramphos

The biggest problem is the way I handle strings and flags doesn't allow me to make gaps in the flags. I might be able to do something about it.

Thanks Gramphos.

If you display a 4-character (e. g. 2400) hex number that would be good enough for me. And I'll test it for you!
 
I have a question about the Copy Tool. I've looked around the threads here and at Apolyton but couldn't find anything about this.

I've tried to use the Copy Tool to create a flat map and while in the Civ Editor it makes it look flat, during play it's still a round world. Can you actually use this tool to make it so the edges of a map do not wrap? How?

Also, as a side note, for some reason, even though I took out the polar caps, during play they appeared anyway. Anyone know what the deal is there?

Thanks for the program, Gramphos. It's otherwise sweet and you kick ass for making it available.
 
Well, it worked as a flat world in 1.07f (original game) and I've not tested it since then.
 
v0.93.5
- Fixes bug were a unit has to have Bombard Range greater then zero to set Air Bombard strategy in UCW
- Added brows buttons to Animation and Sound files in UCW
- Added Special flags to Units in SGE
- Bug where new icon entries aren't grouped correctly in pediaicons.txt fixed.
- Rules are now imported and exported among maps from saves.
 
Gramphos: Great tool. You said that the rules were imported and exported from saves. Can you edit them as well? Say you are half-way through a game and find out your custom bic doesnt allow galleons to upgrade to spanish galleons, can you load your save, change that, and keep playing? That would be cool.

Also, Wizard is spelled with 2 Z's? Hmm, weird.

Thanks for the tool. Really like it.

GIDustin
 
Gramphos I've got the latest version but I stil get a comct232.ocx error, I went to the Microsoft site and got the zip file but it still dosen't work. I mean I installed but it I still get the error message, apprently the version I had aldready was, any I installed the file but it still doesn't work.
 
Status
Not open for further replies.
Back
Top Bottom