As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Modding Discussion Thread

I have some question about AIResearchGroup? Does it has any hardcoded aspect to it? I notice that most of them follow pattern in some way but some spells occupied their own slot, and some slots are mix up of several spells of different categories such as.....
Mindstorm stay mixing within group of single-target save-or-die spell (AIResearchGroup=24) although its category should be single target curse.
Earth to Mud/Disrupt/Mass Healing are stay in the same group with slot of situational buff/debuff combat enchantment (AIResearchGroup=17)
Animated Ammo/Mass Invisibility both occupied the same research group (AIResearchGroup=33) although they have completely different role. The same could be said to annihilate/massacre/entangle (AIResearchGroup=60), Mystic Surge/Life Force (AIResearchGroup=63), Cracks Call/Sanctify (AIResearchGroup=71), Time Stop/Disillusionise/Dispelling Wave (AIResearchGroup=84), Fairy Ring/Great Unsummoning (AIResearchGroup=85), Final Wave/Tree of Knowledge (AIResearchGroup=86)

Why they shared slot with one another? Would it better for something like Great Unsummoning stay in same research group with Final Wave? Or Life Force stay with other powerful global enchantment (AIResearchGroup=80)? Or Mass Invisibility and Entangle stay with other combat enchantment (slot 17, 36, 82)? Etc?

Some of AIResearchGroup slots (6, 20, 26, 27, 30, 31, 38, 40, 42, 43, 45, 48-50, 66-68, 72, 73, 75, 76, 87, 91-98) are not uses. Do they hold any hardcoded value?
Reply

AI research group is a leftover value from the DOS version. Many of those numbers come from nearly 30 year ago.
There is no hardcoded effect.
They are used in AIRes.CAS and nowhere else. Any number that does not appear in that script is meaningless.
Reply

Thank you. This would make me able to reorganized them without worry.
Reply

May I request table of hardcoded combat spell priority as reference?
Reply

It's not a table. It's roughly 1600 lines of source code that calculates the value based on combat state, units present, etc.

In general there is a base value of -10 to +50 depending on whether the spell type is appropriate for the combat situation. For example most direct damage spells are preferred if any side is clearly ahead while buffs only when the AI is the stronger one.
There is RND(20) added for variance.
Then each spell has their own modifiers like web against a flying target, flame strike against multiple enemies, that sort of thing, generally adding up to another 0-50 so the end result is almost always in the range of 0-120 tho in particularly bad cases it can be below 0.

If you turn on debug mode, you can see the final priority of each spell the AI has available in log.txt. Experiment with how the value changes for each spell in various combat situations.

Alternately, there was a thread about spell AI somewhere a long time ago, probably in the CoM I part of the forum. It's about 90% the same in the windows version, just with even more details.
Reply

Thank you for explanation.
Reply

IN buildings.xxx, there are entries for Tree=1 and OnShore=1, which I assume are requirements for forest and shore tiles. Are there other options for hills, mountains, etc?

Also, would it be much work to add in a few extra requirement slots for buildings, which look for values in a script? That might allow modders to put turn number, or number of a type of tile, or state of diplomacy or whatever else might produce interesting differences in gameplay. Always building the same buildings in more or less the same order isn't all that much fun. Having to search for proper sites to settle to be able to build cathedrals or mechanicians guilds might be interesting.

If that's easy to do, it could also be added to unit requirements or even spell research or casting. Just another way to provide more variety between games.
Reply

I think Tree is for the Tree of Knowledge spells.

If we do add a building requirement script, there is no need for values in the table.
You can code all the special requirements in the script itself which you would need to do anyway.
Reply

(June 23rd, 2022, 18:44)JustOneMoreTurn Wrote: IN buildings.xxx, there are entries for Tree=1 and OnShore=1, which I assume are requirements for forest and shore tiles.  Are there other options for hills, mountains, etc? ...

This is how far I got in figuring it out:

buildings.ini
Requirement1=110         < shore tile needed
Requirement1=101         < forest tile needed
OnShore=1                    < places building on the shore in the city screen
Tree=1                          < building unlocked by casting Tree of Knowledge

UNITS.INI
Building1=110    < shore tile needed

I think there might be a number for hills & mountains, but I don't know which one. Requirement1=100 or 102 and Building1=101 didn't work,  ...
Reply

(June 24th, 2022, 01:06)Slingers Wrote:
(June 23rd, 2022, 18:44)JustOneMoreTurn Wrote: IN buildings.xxx, there are entries for Tree=1 and OnShore=1, which I assume are requirements for forest and shore tiles.  Are there other options for hills, mountains, etc? ...

This is how far I got in figuring it out:

buildings.ini
Requirement1=110         < shore tile needed
Requirement1=101         < forest tile needed
OnShore=1                    < places building on the shore in the city screen
Tree=1                          < building unlocked by casting Tree of Knowledge

UNITS.INI
Building1=110    < shore tile needed

I think there might be a number for hills & mountains, but I don't know which one. Requirement1=100 or 102 and Building1=101 didn't work,  ...

Have you tried 200? That's what hill/mountain req is in the original (Miner's Guild). There's also 104 for grasslands, but IIRC it's not fully implemented even in DOS.
Reply



Forum Jump: