Page 1 of 1
Modded Research and AI?
Posted: Fri Jan 22, 2021 4:34 pm
by CaesarAug
Well, I am like a little boy playing with the editor. [:D]
And so far, I think my adjustments warrant sharing a mod...
Question: there appears to be three tech slots that are available but not used by the game.
I’ve modded the default (unused) Trench Warfare to Carrier Operations whereby a 10% per level improves the Carriers’ defensive Loss Evasion in naval engagements.
I’ve activated the new tech research for certain countries. Will the game’s AI recognise and use this new modded tech?
Or are further adjustments necessary elsewhere?
RE: Modded Research and AI?
Posted: Sat Jan 23, 2021 5:03 pm
by BillRunacre
Unless the Majors already start with research invested or achieveed in these new categories, you will need to add a chance of the AI investing in these categories, and that can be done by adding/amending RESEARCH scripts.
I think that is it, at least for Automatic Research categories (the ones on the right on the Research tab in game).
If you have also activated a previously unused Manual Research category then you will need to set units to have the ability to upgrade with it, and that applies not only for the AI to be able to upgrade units with it.
RE: Modded Research and AI?
Posted: Sun Jan 24, 2021 7:17 am
by CaesarAug
Thanks. Looking at that Research script... appears to be somewhat complicated, at first.
Will look into it further.
Though indeed, it is far easier to give certain Majors a Carrier Operations tech level(s) to begin with.
Easily enough done with the editor.
Another way could be in-game, to switch from AI Allies or AI Axis to player, and vice-versa,
and begin research with that tech, and switch back from player to AI.
But that would disclose the Fog, of course... [:D]
Another even easier method would be to just incorporate the Carrier modifications in a pre-existing tech,
like Naval Warfare: i.e., no need to modify the Research script.
We’ll see about the Research script, though.
By the way, a simple name change for pre-existing techs should not affect the Research AI, I presume?
For instance, changing the default name of Long Range Aircraft to Advanced Bombers, or changing the default
name of Naval Warfare to Naval Warfare Doctrine?
RE: Modded Research and AI?
Posted: Sun Jan 24, 2021 1:58 pm
by BillRunacre
You're right, changing the name of a tech won't affect how anything works at all.
RE: Modded Research and AI?
Posted: Sun Jan 24, 2021 3:22 pm
by Elessar2
An observation, and the devs can (finally-hint [8D]) confirm this: the tech and unit builds are read from the top down. Which based on some tests that I've run means that the techs/units at the top will get chosen by the AI before those at the bottom (if the die roll succeeds-note some are "forced" with 100% values). Which means if the AI runs out of MPP's, then the lower ones will not have any chance of getting chosen.
There is a toggle tho called "#SKIP_FUNDS_CHECK=" which may obviate the MPP check (which means that the AI may get "overdrawn" on its account...?).
I did find out that by cutting and pasting entries that they can be moved around without bugging things all up. This is an issue mainly for those powers who have to build a lot of ships (US/Japan, UK to a lesser extent), since the AI will usually be buying out the top entry items first, and ships are all at the bottom.
RE: Modded Research and AI?
Posted: Mon Jan 25, 2021 5:35 pm
by BillRunacre
You are right, the scripts are read in descending order, which is why ones due to fire later in the war are placed above those due to fire earlier in the war. They won't be read until their date in the war has arrived, so are ignored until then.
RE: Modded Research and AI?
Posted: Mon Jan 25, 2021 11:37 pm
by Elessar2
Yes, I know that. I meant the individual elements in a given single script. So HQ's are at the top, carriers towards the bottom, so HQ's get first crack at being bought, unless I misunderstand how said scripts work. Likewise with Infantry Weapons vs. say Industrial Tech.
RE: Modded Research and AI?
Posted: Tue Jan 26, 2021 4:20 pm
by Hubert Cater
Hi Elessar2,
No, the individual elements within a script are randomized each time the event is run, so there is no advantage to techs at the top over the ones listed further below. Same goes for unit purchases within an event and so on.
For the skip funds check, this is a limited way (via the scripts) where we can force the AI to make a purchase on a tech, or unit etc., even if there are insufficient funds. It won't overdraw its account, just go to 0 without any extra cost. Otherwise it would skip it if it couldn't afford it, and this way we can ensure certain items are purchased by the AI for a better game experience.
Hope this helps,
Hubert
RE: Modded Research and AI?
Posted: Tue Jan 26, 2021 10:35 pm
by Elessar2
Ok thanks-that will save me a LOT of work. But also require new scripts to ensure that capital ships have a decent chance of getting built (up to and including 100% "forced" builds).