modmod

Warlord
Joined
May 2, 2021
Messages
228
This topic intented to collect:
Existing XML files in Civ4Col modded version

Explain what the different tags/ lines intented to do in them.
And how those tags CONNECTED TO different XML files/ tags.

Treat this as modding resource for XML modders.
By the way it helps to personalize the version (as modmod) for minor (usually balancing) changes.

Please use attached files (MS word/ excel or similar) for the new XML files which are added to this list
-> there are many files which are too long for simple comments.

This is not always an easy task, because many XML files get greatly expanded with TAC/ RAR/ WTP.
So the (anyway few) references/ modding tutorials for vanilla are deeply outdated.
 
Last edited:

modmod

Warlord
Joined
May 2, 2021
Messages
228
As for starting:

GlobalDefinesAlt.xml


File includes all defines which are CHANGED or ADDED since vanilla (with TAC/ RAR/ WTP).

In overall there are more entries in GlobalDefinesAlt.xml -> then in the original GlobalDefines.xml.

BUT the basic GlobalDefines.xml file still includes the ones which are/ were present in vanilla game (with their default values). NOT all of those get included in GlobalDefinesAlt.xml some remained as default -> big mods like TAC/ RAR/ WTP DID NOT changed them (but sometimes overwrite with new entries as it happened with for example the whole REF system.)

FROM GlobalDefines.xml TO -> GlobalDefinesAlt.xml can added any existing entry (to overwrite base values) which is present in the original basic file, but NOT JET present/ appear in the Alt version.

Just be careful -> some of those are dangerous to change.
Some is the do not mess with it. Example: save version.

Advised to put them in separate manner, like: in the end of existing entries, and start the newly included ones with:
<!—Extra GlobalDefines from original file into this modmod to overwrite begin -->


In this document:
Attached File!
Mainly for defines name.
Sometimes for values also -> in the meaning.
Especially the % confusing sometimes, which tend to change between 100 = 100% or 1000 = 100%. In many cases not sure which exchange ratio true for that entry…

</DefineTextVal> certain units defined here: how the unit/ bonus/ yield called in game.
OR how changed it in the mainmod VS. vanilla, example: culture yield WAS bells in vanilla, BECAME culture itself with mainmod -> as culture system implemented.
Text values are NOT in this list.

Often units displayed because they are part of: one or more recurring event. Or you can buy them only in Port Royal or Africa or by diplomacy.

Unit price not clear -> in most cases TRUE only for events, and UnitInfos.xml can have a different number for their price (overwrites OR determine) Europe/ Africa/ Port Royal default.

What is marked with RED
Attached File

Means I am:
- in case of ? have not much clue at all (at most prefered direction of values)
- not sure about effect (probably just disabled when 1 or 0)
- not sure about values (like % 100=100% or 1000=100% or that is % or multiplier, or fix number)

- don`t know exactly the connection with:
Other files/ other xml tags/ / modifiers (what modify that)/ what is the base value (which modified by this)/ connection with events.

But also better to check the simple ones -> there is a chance includes wrongs/ missing other affected XML files/ tags as well.
 

Attachments

  • GlobalDefinesAlt.doc
    248.5 KB · Views: 65
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
And how those tags CONNECTED TO different XML files/ tags.
There ususally is no connection between 2 different XML tags.
XML tags just configure a feature in the DLL (or sometimes in Python - e.g. for the Trade Quests).

To simplify:
  • The configuration tags (in XML) are completely independent of each other.
  • The features (in DLL and Python) might however be deeply dependent.
-----

Example:

You could e.g. configure that Treasures (a Unit) needs 7 cargo slots. (Yeah of course nobody would do it.)
No other XML tag would really be influenced by it.

But you would automatically break the feature "Treasure Transportation by Galleon".
(Nothing else in XML would tell you that and nothing else in XML could prevent that.)

-----

The logic is in DLL and Pyhton.
XML is just the configuration.

The "real magic" thus happens in DLL and Python.
So the interesting question are mostly:
  • In which DLL / Python logic is that specific XML tag used ? (Where is it used?)
  • If I change that XML tag, how will it affect that DLL / Python logic ? (How is it used?)
  • What are the dependencies to other DLL / Python logic it may affect ? (What could go wrong?)
  • What is hardcoded in that DLL / Python logic that I can not configure by XML ? (What is not possible to change?)
-----

Looking forward to this collection. :thumbsup:

-----

GlobalDefinesAlt.xml

That is really the best place to start. :)
(It is still easy to discuss.)

Already offered to give a WTP Academy Training on it.
Might offer it again, after we have finished and published Release 2.9.1. :thumbsup:
 

modmod

Warlord
Joined
May 2, 2021
Messages
228
I meant connection between XML files/ tags not as logic (on what that rely on in Python/ DLL), which is de facto programming and too advanced for XML modding -> but definition/ additional modifiers elsewhere.

Examples:
1. Connection with different XML file(s)/ tags in those:
EDUCATION_THRESHOLD (in GlobalDefinesAlt.xml) have a connection with Unitinfos.xml because:To educated into what options are determined in Unitinfos.xml by <iStudentWeight> and <iTeacherWeight>
Same true for various prices of goods, which usually determined/ have connection with Yieldinfos.xml

2. Connection with different XML tags in the same file:
USE_TAC_EDUCATION_COST_SYSTEM (in GlobalDefinesAlt.xml) -> Use it, or not, 0 makes null the following levels (ranks) and their cost to acquire (professional/ educated) units. If you turn to 0 the next 3 entries will have no effect.
Eg. connects with: TAC_EDUCATION_RANK1 (RANK2, RANK3).

(Nothing else in XML would tell you that and nothing else in XML could prevent that.)

Or with a different tag and example (what anno made by you if I know well):
PRICE_DIFF_MAN_TO_RAW in GlobalDefinesAlt.xml WILL prevent raw materials to be more expensive than finished goods, even if someone messing up with the prices in Yieldinfos.xml :mischief:
 

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
PRICE_DIFF_MAN_TO_RAW in GlobalDefinesAlt.xml

PRICE_DIFF_MAN_TO_RAW itself does nothing. :)
It is simply used as config by my DLL feature "Price Differences between Manuafctured and Produced goods."
(Actually a sub-feature of a bigger Price System Overhaul from TAC and RaR.)

So you always need to:
  • Know the feature which uses the XML configuration.
  • Also understand how the feature uses the XML configuration.
  • And which side effects the feature might have in case you mess up the configuration.
----

In this case it is simple because this feature is very simple to understand.
But in other cases - e.g for Learning by Doing and its XML config - it gets much more complicated.

----

Summary:

You need to understand the features and their dependencies to really understand how to use the XML config.
(Some features are so simple of course that understanding how to use the XML config is also simple.)

----

However, you are on a good way. :thumbsup:
 
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
USE_TAC_EDUCATION_COST_SYSTEM
This just activates the TAC Education algorithm in DLL for the Education Cost Calculation.
(It uses the Teach Levels in Units that match the "Education Tier" - e.g. Farmer: Tier 1 and Statesman: Tier 3.)

Simply never change / deactivate it, the Vanilla algorithm for the Education Cost Calculation is crap. :)
(It is boring as hell and e.g. does not differentiate between "Higher Education" and "Lower Education".)

Need to go back modding now though ... today is a bit wild. :crazyeye:
@Nightinggale just commited again new changes so I can pick up and impelement my part.
So much stress and modding this weekend ... I love it !!! :lol:

----

By the way:

TAC Education algorithm wa coded by these 3 TAC modders.
koma13, KingMB, Netbandit

All 3 true legends and pioneers of Civ4Col modding that I will never forget.
Even though most community members might not even have heard their names - those guys (and people like Dale) actually started Civ4Col modding !

Today's Civ4Col community was built on the shoulder's of their first achievements ... :worship:
 
Last edited:

modmod

Warlord
Joined
May 2, 2021
Messages
228
It starts to be a wizard (programmer) vs. witchmaster (pure XML). :lmao: :crazyeye:

The wizard (programmer) knows the background rules/ logic in DLL/ Python -> all the "hidden" misteries in magic.
The witchmaster is an experimental user of magic on something existing (XML configuration)/ pure trial and error (because not aware of certain background rules)

So (hope in finally this is a correct form): :mischief:
One XML tag which is in CONNECTION with another XML tag (in a same OR different XML file)
where both are just configration (of programmed logic)
but affects (enable/ disable, modify numbers, etc...) in each other.

So configure some mysterious logic.

But sure even a witchmaster better to know in general terms:
So you always need to:
  • Know the feature which uses the XML configuration.
  • Also understand how the feature uses the XML configuration.
  • And which side effects the feature might have in case you mess up the configuration.

After all just the general terms included in the meaning/ what it does -> sometimes other XML configurations which affected by any way.

Hope the "correct by programing" definition do not makes it harder for the witchmasters to understand. :crazyeye:

Like in psychology:
Impulse-control Disorder
1. Professional book: 2-4 page definition
2. The easy way (the witchmaster way):
- "What do you do when you are angry?"
- "Search an ungly face and punch it!"
-> if he do not find one -> makes one (by punch it) :lol:
 
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
EDUCATION_THRESHOLD
That is simply the base value of "Education Yield" you need to produce for a Student to graduate - value used for Profession Student in Education System.
But again, it is only the base value - other stuff like e.g. GameSpeed, Handicap, ... will be calculted in there.
  • Increase it and Students will graduate slower.
  • Decrease it and Stundes will graduate faster.
Simple as that. :)
(Don't worry about the rest of the logic.)
 

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
Hope the "correct by programing" definition do not makes it harder for the witchmasters to understand.
Nope, just trying to tell you a bit in which features they are used and how.
That might give hints to the risks and dependencies they have.

The wizard (programmer) knows the background rules/ logic in DLL/ Python -> all the "hidden" misteries in magic.
The witchmaster is an experimental user of magic on something existing (XML configuration)/ pure trial and error (because not aware of certain background rules)
Sorry, I am a "wizard" then, I try to avoid "try and error". :)
Maybe the 2 tags I explained a bit will avoid some of that "try and error". :thumbsup:

Which ones do you want to know next? :dunno:
 

modmod

Warlord
Joined
May 2, 2021
Messages
228
Sorry, I am a "wizard" then, I try to avoid "try and error".

No problem.:thumbsup:
Just try to keep the "explain part" as simple as possible (for the non-wizards).
Even if it not fully correct by programming terms.

Maybe the 2 tags I explained a bit will avoid some of that "try and error".

True -> but those were just examples here.
Already explained similarly in the attached .doc ( well for education the affected XML files/ tags in gamespeedinfo + handicapinfo not (missed connection) -> will include -> thanks).

About ranks: does it proper enought as just refer to unitinfos.xml <iTeachLevel> ?
Originally was intent of a full list -> instead of just examples there.
But with new tought that sound overreaction/ too much text which can be changed anyway. :undecide:

Which ones do you want to know next?

What is marked with RED
Attached File

Well to be clear: it is a reference/ explanation what XML tags do: for the community/ XML modders (actual/ future).
Which includes ALL -save textvalues/ unit prices- (known and unknown/ not sure what it does) tags/ lines.

The ones where I personally interested in (or used in the past) in GlobalDefinesAlt.xml is a far lesser number. ;)
Probably modified about 60-70 from the 260, and don`t know some another (red/ partly red) but probably will use (modify) another 10-20 from the RED ones.
So where I personally interested in is a lesser number -> than all which are included in the .doc

So the doc needs to explain ALL -> because someone may interested to change them.

I provided what I know without help with black texts (still worth a check).
The ones with RED needs mainly help. -> to have a proper list which includes all.
 
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
About ranks: does it proper enought as just refer to unitinfos.xml <iTeachLevel> ?

Yes, teach level is used to create the different Costs for "Low Tier" / "Mid Tier" and / "High Tier" Professions.
It is simply a multiplicator to the base Education Cost in the formula for Education Cost.

Many of these values are used for balancing in mathematic algorithms / formulas.
So better not change too wildly if you do not know the mathematic algorithms / formulas.

So whenever you see an "i..." in front that is an integer (number).
Chances are high that it is used in an mathematic algorithms / formulas.

And whenever you see a "b..." if front that is a boolean (true / false).
Those usually activate and deactivate something or switch between paths in a logic tree.
 

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
Let us make a deal:

I will explain a few (2 or 3) of them each day that I am active. :thumbsup:
Thus simply always post some XML tags that you do not yet understand and I will explain. :hug:

I spent almost all day helping @Nightinggale to implement and balance a really great concept for Buildings and AI.
I am tired now and not motivated anymore to read a Word document ...

But of course other modders can and should answer your questions as well. :)
The things you could ask about XML should be easy to answer for any of us.
 

modmod

Warlord
Joined
May 2, 2021
Messages
228
It is simply a multiplicator to the base Education Cost in the formula for Education Cost.

:rolleyes:
Wait a minute!
So by this I did explain it incorrectly... as it looks like. :hammer2:
In TAC_EDUCATION_RANK1 (and other ranks the same):
"+ fDefineFloatVal (in %) to get that profession player need to pay this % of the base price of that unit in gold."

Because your explanation suggests:
  • It have no connection AT ALL with unitinfos.xml <iEuropeCost> as base cost
  • But have connection ONLY (only?) with EDUCATION_BASE_TUITION ? (from Globaldefines.xml -> which entry/ tag is not included by base in GlobalDefinesAlt.xml )
  • OR are both included in the logic (like if <iEuropeCost>-1 (cannot buy in Europe at all) -> only then calculates with EDUCATION_BASE_TUITION?
multiplicator -> I usually use % eg. 0.3 = 30%for float.
Probably better to re-write those parts as well before someone misunderstands. :undecide:
I understand what I meant there -> someone else probably not. :crazyeye:

So whenever you see an "i..." in front that is an integer (number).
Chances are high that it is used in an mathematic algorithms / formulas.

And whenever you see a "b..." if front that is a boolean (true / false).
Those usually activate and deactivate something or switch between paths in a logic tree.

Will be more useful in future like when we get to unitinfos.xml.
In this file are int/ float/ text. No boolean (directly -> but yes as effect).
Also benefits the ones who are not jet familiar with the cheat engine program. :lol:
 
Last edited:

modmod

Warlord
Joined
May 2, 2021
Messages
228
Let us make a deal:

I will explain a few (2 or 3) of them each day that I am active. :thumbsup:
Thus simply always post some XML tags that you do not yet understand and I will explain. :hug:

What if I gone inactive? :dunno:
Sometimes real life calls (work/ business, family/ comrades) or vanish for different reasons (like: because different interest/ games/ mods/ just not using clearnet/ stay offline).
Both can be weeks-months.

So please do not wait for me/ no one else wait for posts - questions.

File is there, and plenty of RED / ? included in that.
Just as it (the XML tag) appears in the file (order in XML/ DOC is the same)

This is for everybody - who interested.
 
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
iTeachLevel is simply like this:

100: The Education Cost algorithm in the code will notice and decide "This Unit can not be taught."
1 / 2 / 3: The Education Cost algorithm will simply multiply the base Education Code with it.

It has nothing to do with EuropeCost and never had.
The formula for Education Cost does not even consider EuropeCost. Why should it? :confused:

As I said, all these XML attributes are basically independent. :dunno:
The only thing that connects them is the specific feature.

----

And yes, they use EDUCATION_BASE_TUITION for the Education Cost calculation. ;)

For the Education Cost it is just a multiplier.
But it has more effects than that. (see below.

----

The complete Education algorithm is of course bigger and more complicated then that.
(I heavily simplified the logic of that feature because you just asked about Education Cost so far.)

e.g.
The "Teach Level" of the Unit needs to match or be lower than the "Teach Level" of the Education Building so the Unit can even be trained in that Building.

----

See, that is the problem. :dunno:
You can not mess with such values without understanding the actual features.

----

If you put something stupid into iTeachLevel, you will break EducationSystem.
If I thus would not explain you the features, which you seemed to not want, your XML changes would most likely cause bugs ...

----

So please do not wait for me/ no one else wait for posts - questions.

I am not waiting because I am busy as well. :dunno:
However I am answering community posts and try to explain. :thumbsup:

My answers will just not always be as simple as some may expect or hope.
Thus I might need a bit of time to explain - which is still better than having momodders ruin their modmod.
 

modmod

Warlord
Joined
May 2, 2021
Messages
228
It has nothing to do with EuropeCost and never had.
The formula for Education Cost does not even consider EuropeCost. Why should it?

Well for me seemed logical:
Units which are more valuable/ expensive to get from Europe are also more expensive to be trained.
Turns out it is not considered, because:
All training have the same base value and only the ranks decide the actual cost.
So that makes possible you teach a rank 3 unit for 900 gold, while rank3 units to buy in Europe can range from X to Y gold, but regardless the price difference in Europe you can train them for the same expense.

So should or not is a different consideration - simple was my way of (turns out to be false) thinking/ assumption it is connected.

So actually it CAN be connected in the future, but NOT connected right now. :)
 
Last edited:

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,135
Location
Stuttgart, Germany
Well for me seemed logical:
Well that is why I try to explain. :)

For a programmer it would be absolutely illogical if they were connected.
It would hurt most basic design principal as we have been taught.

So actually it CAN be connected in the future, but NOT connected right now. :)
It would be really bad design to abuse the XML configuration of one feature in another feature like that. :nope:
The features could then not be balanced anymore independently.

To simplify:


Expect that each feature / gameplay mechanic has its own balancing. (In 99% of the cases that is true.)
An XML tag should not be abused in two independent features - it sometimes (rarely) happened to save some time but it is not good design if it does.

see here:
There ususally is no connection between 2 different XML tags.
XML tags just configure a feature in the DLL (or sometimes in Python - e.g. for the Trade Quests).

To simplify:
  • The configuration tags (in XML) are completely independent of each other.
  • The features (in DLL and Python) might however be deeply dependent.

That is why I tried to tell you:

The XML configuration of one feature has to be independent of the XML configuration of another feature - otherwise you can not properly balance anymore.
The logic - the values they calculate and other logic they trigger in DLL - of these features themselves however may have dependencies (and very often actually do).
 
Last edited:

modmod

Warlord
Joined
May 2, 2021
Messages
228
If I thus would not explain you the features, which you seemed to not want, your XML changes would most likely cause bugs ...

This is the question of approach:

1. I tried to approach it: XML file by file, tag/ entry to tag/ entry. So talk about mainly that file/ that particular entry, and just put a short/ quick reference for a certain entry (entries) which is/ are in connection with another ones (probably in different files).
Planned to clear all entries/ tags first in GlobalDefinesAlt.xml -> when that is complete for example GlobalDefines.xml -> then Unitinfos.xml -> then another files

2. You approach/ explain it as a feature. In the manner: "if you want to modify that feature (education) then you look up certain XML tags in: GlobalDefines.xml, GlobalDefinesAlt.xml, Unitinfos.xml, Buildinginfos.xml . "
So you talked about a feature which have configuration (by XML tags) in 4 different XML files, and X different entries/ tags scattered in them, not just GlobalDefinesAlt.xml.
By features (like education system/ cost) you explain just about half dozen tags in GlobalDefinesAlt.xml, and all the others in that file neglected because they have nothing to do with that feature. But in the same time get into different files/ a few tags in them deeply -> because they configure that feature.

So in short it is:
1. Get trought files/ entries (explain them)
2. Get trought features (explain them)


So no -> you misunderstood:
explain you the features, which you seemed to not want

That is very much neccesary later on. :thumbsup:
But FIRST need to be clear about different files/ entries.
So before explain a feature (in deeply/ full) like education/ costs -> needs to explain all tags in XML files GlobalDefines.xml, GlobalDefinesAlt.xml, Unitinfos.xml, Buildinginfos.xml
When all important files/ tags in them are explained -> THEN explain the features themselves/ systems.

So first what are tags for -> later how to use them to modify systems/ logic (as a modding tutorial to modify features).
 
Last edited:

Nightinggale

Deity
Joined
Feb 2, 2009
Messages
5,031
It would be really bad design to abuse the XML configuration of one feature in another feature like that. :nope:
The features could then not be balanced anymore independently.
I looked into making transports allow a list of types (civilian, military, cargo, treasure..) and stopped because the existing two xml tags have been used for what seems to be somewhat unrelated. It can still be done, but it takes way more investigation before anybody should dare to touch the code when a tag controls more than one thing.

While it can sometimes make sense to use the same setting for multiple features, a one setting->one feature approach is more stable regarding future stability when the code is being modded.
 
Top Bottom