Quick Modding Questions Thread

I think it had something to do with game options. Like I know for a fact that not all game options are visible in the custom game settings. So I think the thinking behind it was that "Play Now" resets all game options to default for that mod. So if you have a mod like FFH that has a lot of custom stuff behind the scenes and you switch to something else that does not explicitly overwrite those you might end up with odd game settings being set in your new mod and the two not interacting too well.
 
I've heard from somewhere (can't remember where), that when you swap between mods that you are supposed to:
"Clear the cache/reset settings" by beginning a quick Play-Now game that you can quit out of once the map loads.
Is this an actual thing? Does doing that do anything? Or can you just freely swap between mods without having to worry about anything?
Civ remembers the game options of your last game (the options you can see in the custom game screen). It doesn't remember them by name or something, just by ID. It also stores them globally, not on a per-mod basis. So here's what can happen.

Say you play a game of some mod with lots of game options, say C2C, and you enable option #27 (or whatever). Then you start a custom game of FfH. Option #27 in FfH is (say) an option that's only used in a specific scenario and breaks the game when used in a custom game. Importantly, option #27 is set to be hidden, so you cannot enable it in the custom game screen, but you also cannot disable it. So it's automatically enabled and breaks your game.

Play Now resets all game options to their defaults, including the hidden ones.
 
I literally never knew about this before today. :eek:
 
Me neither, hence my like - thank you!
 
Civ remembers the game options of your last game (the options you can see in the custom game screen). It doesn't remember them by name or something, just by ID. It also stores them globally, not on a per-mod basis. So here's what can happen.

Say you play a game of some mod with lots of game options, say C2C, and you enable option #27 (or whatever). Then you start a custom game of FfH. Option #27 in FfH is (say) an option that's only used in a specific scenario and breaks the game when used in a custom game. Importantly, option #27 is set to be hidden, so you cannot enable it in the custom game screen, but you also cannot disable it. So it's automatically enabled and breaks your game.

Play Now resets all game options to their defaults, including the hidden ones.
Thank you, this was the exact answer I was looking for.

Incidentally, do you even need to actually start the Play Now game, or do you just have to go through all the options until right before the end where you begin map generation?
 
Last edited:
Thank you, this was the exact answer I was looking for.

Incidentally, do you even need to actually start the Play Now game, or do you just have to go through all the options until right before the end where you begin map generation?
Probably not, but better safe than sorry.If map generation is slow for you just set the size to duel.
 
Personally, I create a separate copy of CivilizationIV.ini for each mod that I install. That's the file where the most recently used game settings get stored. Then I set the Mod= string in the ini so that it'll load the respective mod and create a shortcut to Civ4BeyondSword.exe that loads the ini through the ini= command line argument. A little paranoid? Some may say. I never clear the XML/ file cache, I disable it through the ini – although at least the XML cache doesn't seem to get read in any case when using a mod. Screenshot attached; this assumes that the copy of the ini is placed in the same directory as Civ4BeyondSword.exe. If I decide that I want to change some ini setting regardless of the mod I play – then I'm in trouble because I'll have to change it in each copy.

Edit: When a (DLL) modder decides to hide a game option, it's probably a good idea to add code that sets the hidden option to its default value – to avoid the issue that lfgr described.
 

Attachments

  • RI_ini.jpg
    RI_ini.jpg
    278.6 KB · Views: 33
Last edited:
Alright, another question. Is there a way to make it so that forts can be built next to one another instead of needing the dumb 1 tile distance?

Also when I add new civicoptions they don't show up in the interface?
Anyone? This is actually my top priority right now.
 
Anyone? This is actually my top priority right now.

I can build forts right next to each other in regular BTS. Have you modded something about cities? The only XML I can see related to Forts is the ActAsCity.

For your civics, do they show up in the Civilopedia? If they do, then I think you just have to modify CvCivicsScreen.py.
 
I can build forts right next to each other in regular BTS. Have you modded something about cities? The only XML I can see related to Forts is the ActAsCity.

For your civics, do they show up in the Civilopedia? If they do, then I think you just have to modify CvCivicsScreen.py.
The civic thing is important. Basically I have added two new categories but they don't show up in the game. And Python is the one programming language I am not that good in. Yet.
 
The civic thing is important. Basically I have added two new categories but they don't show up in the game. And Python is the one programming language I am not that good in. Yet.

I looked at the CIV4 Reimagined mod that adds an extra civic category. I didn't see anywhere that the number of civic categories needs to be defined anywhere, so I think all you should have to do is adjust the civics screen. I attached a copy of the CvCivicsScreen.py file from that mod. If you look at where the numbers are changed because the old numbers are commented out with # you should be able to adjust to what you need. This file is set up for only 6 categories and you said you need 7.
 

Attachments

  • CvCivicsScreen.py.txt
    15.1 KB · Views: 9
I looked into that and am investigating. Thank you. Meanwhile here is another quick one. In CIV4BonusInfos.xml the iAITradeModifier is related to the AI wanting to trade the resource, right? If so, is higher more or less likely? Like if I wanted to make sure the AI newer trades the resource can I just set it to like 10000 and be done?

Also can a project produce resources like wonders can or do I need to make it a wonder?

Also, I tried adding a new resource and it needs a new art define. So I copied over the CIV4ArtDefines_Bonus.xml from BTS into my mod folder. But even without any changes at all, just including that file makes the mod crash. Any ideas what is going on?
 
Last edited:
I looked into that and am investigating. Thank you. Meanwhile here is another quick one. In CIV4BonusInfos.xml the iAITradeModifier is related to the AI wanting to trade the resource, right? If so, is higher more or less likely? Like if I wanted to make sure the AI newer trades the resource can I just set it to like 10000 and be done?

Also can a project produce resources like wonders can or do I need to make it a wonder?

Also, I tried adding a new resource and it needs a new art define. So I copied over the CIV4ArtDefines_Bonus.xml from BTS into my mod folder. But even without any changes at all, just including that file makes the mod crash. Any ideas what is going on?

I haven't been on the boards lately, so I didn't see your questions until now.

You should be able to make the AI much less likely to trade a resource by setting a high iAITradeModifier. If you look at the values in the basic Civ4 game, health/happiness resources have a value of 0 while strategic resources go higher and Uranium is the highest at 30.

Projects can't produce resources without DLL modding. The RFCEurope mod implements various colonies as projects, but you'd have to implement the tags and that would require DLL work.

As far as the art file goes, did you copy over the schema file as well? That's the only thing I can think of at first.
 
Hi team, hope you can guide me.

I'vegot an issue with the GameFont file, or should I say how the game interprets it... I read what I could on the forum and I think I get it more or less :

Symptoms
- My Icons "Shift" by 25 ranks compared to before. So for exmaple, the "happy" character was slot 8675, now it's slot 8700.
- My GameFont.tga & GameFont_75.tga don't change (anymore). I've isolated that this is not the issue. I've got tons of extra icons in there that I don't even use, it's not because I've added or reshuffled some of them that it breaks.
- It Triggers when I had just ONE new entry in "Civ4BonusInfo.xml". So I can totally keep playing/modding if I remove this last entry and keep the pictures as is in the .TGA file(s).

First analysis
- If I use the Gamefont files of other MODS, I can see that their file is usually much larger. If I threw that file randomly in my MOD, I can see that the way the "pointers" of "HAPPY_CHAR" are still acting as if I had a "small" .TGA file.
- I gather there is someting in the game that says "look at my TGA file has if it's a bigger size", I'm happy to redo my .TGA files with much bigger matrixes (just copy paste a lot of icons...); but where do I tell C++/Pythong/XML /whatever to search for "larger' .tga ?

PS - I use this to track my Icons and it's indeed quite useful : https://forums.civfanatics.com/threads/gamefont-display.648571/
 

Attachments

  • Capture.PNG
    Capture.PNG
    92 KB · Views: 19
  • 1691529920635.png
    1691529920635.png
    117.9 KB · Views: 34
Last edited:
Is it possible to make units survive the first attack? Usually one always dies, I found some modifiers like 'COMBAT_DAMAGE=20', 'RANGE_COMBAT_DAMAGE=30' in global defines
 
@Luís Felipe Silva Pinto: They'll still fight to the death if the combat damage per round is lowered, it'll just take a higher number of combat rounds, meaning that stronger units get higher victory odds. The only non-lethal outcomes of combat resolution involve damage limits (iCombatLimit in Civ4UnitInfos.xml), e.g. Catapult being unable to damage units with 25 or fewer hit points, and withdrawal chance (iWithdrawalProb). Ranged attacks (iAirRange, iAirCombat on a non-Air unit – not used by the original game) work much like air strikes. I think RANGE_COMBAT_DAMAGE is the maximal amount of damage per ranged attack.
 
I'vegot an issue with the GameFont file, or should I say how the game interprets it
Not sure I can be a lot of help as the game's treatment of these files is still a bit of a mystery to me. But I'm very curious and maybe whatever explains what you posted could help me figure out what I've been seeing.

Have you solved this since you asked? If not, what causes the index to shift like you described, just adding an additional bonus resource to that XML file? Have you modified the `FontSymbols` enum in CvEnums.h in the game DLL?

I'm not sure I totally understand what you're describing. I've had trouble using GameFontDisplay in the past and not sure why the indexes start in the eight thousands. There could be good reasons, I'm still new to this. Also the images you attached look identical so I might be missing something?
 
Hi - thanks for answer. No I haven't found the answer yet and am still patiently waiting, I guess it's a tricky one to ask but equally I think anyone adding quite a few resources as faced this.

All I've done (since I've isolated the issue) is add ONE extra entry in Civ4BonusInfo.XML
There are 35 base entry
As of now I've added 13 (and it's working)
If I add a 39th one, it doesn't work anymore.

The HAPPY_CHAR things the "start" of index is 8700, not 8675 anymore. (Images are identical indeed, sorry my mistake, I don't know what else to show^^)
I've not touched the CvEnums.h and I've just check it stil starts with "HAPPY_CHAR = 0,"
 
All I've done (since I've isolated the issue) is add ONE extra entry in Civ4BonusInfo.XML
Yeah unfortunately I don't know a lot about how the game responds to those entries. And In the earlier post I read...

I'vegot an issue with the GameFont file, or should I say how the game interprets it
...
My GameFont.tga & GameFont_75.tga don't change (anymore). I've isolated that this is not the issue.
So I think I was a bit thrown off by this. What I can add is, since my last post, I'm fairly certain now that that some cells or indexes in the GameFont need to be transparent white, rgba 0xffffff00. If they are filled in, the index in-game past the letters starting at around 256 for the icons can shift. Icons for HAPPY_CHAR shift also but I don't think any indexes or numbers change, only the icons. (But I also don't really understand why the script you're using uses those indexes in the eight thousands so that could be throwing me off as well.)

Attached is an example of what I mean (from Realism Invictus). The GameFont.tga has one cell filled in while GameFont_75.tga has that cell transparent. The GameFont_75.tga (first pair of icons) are in correct position, but GameFont.tga (last two columns) are shifted because more icons because it seems like more icons have been loaded into the game than exist in the tga files and every icon after those extra are shifted to be placed in greater numbered indexes. So that innocuous alteration to GameFont.tga can cause the icons for those 32 FontSymbols to change.

But if changing GameFont.tga file doesn't affect what you're seeing then I'm not sure I can be much help. Sorry! :p
 

Attachments

  • 1692737450759.png
    1692737450759.png
    329.6 KB · Views: 15
Top Bottom