Jump to content

Queries about AI purchasing


Recommended Posts

I have been testing a scenario and found that the US seemed to have more MPPs than I expected after running the game AI v AI for about 8 turns. As far as I can tell it was because the AI has not been purchasing all the units that it could. I had preloaded quite a lot of purchases such as BBs for later years into the production queue - is it likely that this is what has confused it although there is room left in the build limits?

For example if I have this as the purchase script

#DIVISION= 50 [2]

and there are already 2 Division units in the queue for delivery next year does the [2] mean that the AI will only ever have a max of 2 Division units in the build queue at any point in time even if the ones in the queue are for delivery, say, a year later and the build chance at 50% is pretty high and it has MPPs available?

One other question about purchasing - does the AI apply any priority between minor and major country purchases? For example if Canada has a script for purchasing divisions as well as the UK will the AI buy UK ones first because they are cheaper due to production bonuses or are the chances effectively equal that the AI might build UK or Canadian units if both are available?

Regards

Mike

Link to comment
Share on other sites

That script you put up means there is a 50% chance the AI will build 2 units.

AI 1st repairs units

2nd the AI goes down the list rolling random #s for what it can build until it doesn't have enough MPPs. It cycles itself until it builds at least 1 unit.

3rd it invests in technology similar to how builds are done

How it allocates resources I do not know between production and tech I don't know.

Best thing is to change the #s and test your mod. That's what I do until I get the correct mix of units and tech. But if you want something built ASAP over anything else give it 100%. The A.I. should automatically build that when it hits it until its out of that type of unit.

if you want to set something like "hey build everything but ships, but if you run out of stuff then build a ship" you set something like #BATTLESHIP= 1 [1]. This makes it @ 1% chance. But if there is nothing left to be built the engine will build the battleship. It just keeps rolling until it hits 1%. If there is something to be built and you give it a chance eventually it will. Of course with 1% there is a tiny chance it will be built anyways. The rest of the units have to miss and you have to roll the 1%

Link to comment
Share on other sites

Hi Al

Thank you for the answer. Can I just confirm that the command I used means the AI will build 2 units if its die roll is successful but will it still build one if it has only enough MPP for that or will it result in a failure. Really I am asking if including multiple numbers of units effectively increases or decreases the chance of at least one being built.

I had thought that it might mean that the AI rolls its dice twice and will build 0, 1 or 2 depending on the success or failures of the two rolls.

Regards

Mike

Link to comment
Share on other sites

Ok lets take this as the only units on the build list on the script just as an example.

#DIVISION= 50[2]

#CORP= 25[1]

#ARMY= 1[2]

The game engine goes down the list.

Rolls %100 die.... 51% nope doesn't build a division

Rolls %100 die.... 99% nope doesn't build a corp

Rolls %100 die.... 5% nope doesn't build an army

it missed everything so it restarts the whole list

Rolls %100 die.... 45% yes we build a division. How many? Do we have enough for 2? yes so do it

MPP check... we got enough MPP to build more? Ok do so.

Rolls %100 die.... 99% nope doesn't build a corp

Rolls %100 die.... 1% Ok build army, how many? 2? Well we only have enough money for 1, so we build 1.

MPP check... we got any more MPPs? Nope next section.

I believe this is how it goes. How it determines research build I am not sure and how it interacts with unit builds. But if you feel something is important for a country to build for the AI just make it #UNIT= high%[high #]

Like for Germany I do this during the time I need them to build up for Barbarossa to make sure they get all their corp out. or I can do 90% for a but of variance.

#CORP= 100[3]

You can set up many scripts at different time intervals to choose different sets of units. Just be sure the later date scripts are before the earlier ones. That way when the date comes it takes the newest later date one and ignores the other. The engine reads the script files top down.

Link to comment
Share on other sites

Hi Al

I am not sure about the routines cycling through the chances again if no build is picked because I have this situation in my test scenario where the US has a surplus of funds although there are things it could have built. I have found this text as an aid in the purchases script:

; Note: Even if the % chance is successful the #COUNTRY_ID in question needs sufficient funds to make the

; final purchase. If no unit type is successfully determined to be purchased then the AI will make no

; purchases for that particular event.

Also it is possible for a major country to have additional purchase scripts for its minors so it would need to check those and finally if it spent all the MPP how would it ever do any research?

I must admit I do not really understand when minor purchase scripts are required because most of the time there aren't any included but I presume the AI is still building some units for its minors. Until I saw the script for Canada in the AOD 1939 scenario I assumed that the major built its own units first and then switched to building minor units of that type. That would make sense because minor units are typically more expensive because they do not get the production bonus. I suppose building Canadian units would be sensible if the UK had been overrun.

Regards

Mike

Link to comment
Share on other sites

Hi Mike,

Al is mostly correct in terms of how the AI will handle a purchase script but it will only run through the purchase events one time per turn so that it will also have money for other things like Research and so on as you've suggested.

However, if the AI has built up an MPP reserve approximately 2X its normal per turn collection amount it will then cycle through the purchase event (much like Al described above) until it can purchase as many units as it can using up as much of its MPPs as it can.

For minor nations you'll have to set a specific script event for them otherwise the AI will not purchase for minors on its own.

The only exception to that are units that can be 'rebuilt' as the AI will automatically put a priority on that as the first things it will buy with or without a script including for minors.

Hope this helps,

Hubert

Link to comment
Share on other sites

Hi Hubert

Thanks for the answers. I have definitely seen the USA fail to build anything for 2 turns in succession which surely must mean it had built up twice its normal per turn collection. Of course it would depend whether the collection was calculated before any convoy transfers.

I was interested in your minor country answer. Certainly the Germans significantly ramped up their use of minor country forces in 1942 after their winter losses. I guess in your standard scenario this means that the forces have to be on the map or in the production queue if you do not have minor coubtry purchase scripts.

Is a minor script treated with equal weight to that of a major?

Regards

Mike

Link to comment
Share on other sites

I believe the AI will only attempt to exhaust its purchase scripts if it has more than 2X its per turn income at the beginning of the checks for the purchase scripts.

For minor scripts, it should be equal weight or more specifically the AI simply reads the scripts in listed order so if you place it after the major script then it will check if it has any funds left to the minor script after that.

Hubert

Link to comment
Share on other sites

Hi Hubert

Thanks for the answer. That is quite a useful way to handle minors as majors typically have several dated scripts but minors might only have one. The minor's one script could be ahead of some dated major scripts but behind others so the minor gets a brief period of priority but thereafter just gets the left overs. Thus the Axis European minors could enjoy a small period of priorty say in early 1942 to produce some cannon fodder but be superceded by further German purchases soon afterwards.

SC really does have some subtle features that can allow finely tuned results.

Regards

Mike

Link to comment
Share on other sites

×
×
  • Create New...