Jump to content

AI Research Event Questions


Recommended Posts

The Research Event scripting options are flexible in that you can

1. Select a % that a research area will be researched and set the max chits in this area.

Example: INFANTRY=10[3] - 10% chance, subject to a maxiumum of 3 chits

2. You can set a CANCEL_POSITION that will cancel the research event if enemy units are closer than X tiles to a specified tile.

Example: If enemy units are close to Manchester you probably want the UK AI to cancel researching and focus on building new units.

3. You can also set an ACTIVATE_POSITION that allows you to activate a research strategy if a selected number of units are within a specified position(s).

Despite this power I do not see how to do five things:

1. Research ADVANCED_SUBS only if the AI player has Submarine units. If the AI player has no subs I probably don't it want to research subs.

I would probably handle this by adding a third parameter to the research instructions: Units of that type on the map.

New Parameter = [Country, Unit Type, units of that type min, units of that type max]

Example:

#HEAVY_BOMBERS= 10[3][5,1,2,99] = Russia (type 5) has 10% to research HEAVY_BOMBERS if have at less than 3 chits in HEAVY_BOMBERS and Russia (country 5) has at least two units (min 2, max 99) of bombers (type 1) on the map.

If the AI does not have any Bomber units it will not research HEAVY_BOMBERS if the third parameter is [1], it will if the third parameter is [0].

2. Research ANTI_AIRCRAFT_RADAR only if taking city and resource damage from enemy air units or research ANTI_SUBMARINE if taking damage from Submarines.

Example: If Germany bombs UK ports and cities the UK AI should probably research Anti-Air. If Germany does not bomb UK ports and cities the importance of researching ANTI_AIRCRAFT_RADAR is reduced.

Perhaps a new counter for Infrastructure Damage from Air Attacks during the prior turn and a bomber damage condition.

CITY_AIR_DAMAGE= number of prior turns, [country code][min dam, max damage]

The computer would track infrastructure damage received from air attacks during the prior 4 turns.

The condition would activate if over prior X turns infrastructre damage from air attacks exceeded the minimum and was less than the maximum.

Example:

CITY_AIR_DAMAGE= 2[5][10,99]

If infrastructure damage to German cities and resources exceeded 10 over the prior 2 turns then this research event is triggered.

CITY_AIR_DAMAGE= 1[5][15,99]

If infrastructure damage to cGerman cities and resources exceeded 10 during the prior turn then this research event is triggered.

3. Link the AI Research Event activation to a Production Event. Example: Say that I want the AI to pursue a battle for the Atlantic 10% of the time. This means that I want to Research ADVANCED_SUBS and Build Subs. I don't see how I can ensure that the AI does both at the same time.

4. Reclaim tech chits if a) a maximum level has been reached in one area or B) a key city is threatened.

Example: Germany has launched a Sealion and taken London. Manchester is threatened. How can I have the UK reclaim tech chits for 50% of the original MPP cost so they can purchase more corps and reinforce damaged units.

Example: The Allies have launched Overlord. Germany needs more forces in the West. How can I have the AI reclaim tech chits for 50% of the original MPP cost so they can operate a greater than expected number of units West.

This could probably be handled by adding a command for RECLAIM= (number of chits to be reclaimed) and having the AI automatically reclaim chits once the maximum research level has been achieved in a tech area.

Thus Germany might reclaim all chits if the Allies are close to Berlin.

#NAME=German Reclaims Research to Defend Berlin

#POPUP=

#FLAG=1 (Default event)

#TYPE=2 (Recoccuring check until end of game)

#COUNTRY_ID=5 (Germany)

#TRIGGER=100 (occurs 100% of the time when conditions are met)

#LEVEL=4 (Expert Level AI does this)

#RECLAIM=5 (To reclaim 5 research chits)

#ACTIVATE_POSITION= x,y [1,5],[10,99][2] (Between 10 and 99 allied units are within 5 tiles of Berlin)

Of course, you would have to put a corresponding Cancel_Position parameter into all research events else you might end up purchasing and reclaiming chits in the same turn. :eek:

5. Adjust AI research priorities based on the force composition of the enemy.

Example: If the Russians do not have many tanks I may want to reduce the chance of the Axis AI investing in ANTI_TANK.

Example: If the Germans have lots of subs in the Atlantic I may want the AI to give a greater priority to researching ANTI_SUBMARINE.

There are two ways that games handle this;

a. Human Way: The AI maintains a table that tracks all enemy units he is aware of and enemy losses. This will give the AI a rough approximation of the enemy forces to the extent that each enemy has been spotted or attacked the AI at some point in the game. This number can be used to trigger or deactivate research and production events.

b. AI Cheat: The AI knows the exact number of enemy units by country and type deployed by the human player. Not where they are, just the quantity deployed on the map. If the AI were to do this I would probably have it only occur at Master Level (one level above Expert) OR have the AI maintain two tables - one for the Human Tracking Method and the other for the AI Cheat. The scriptor can decide to use data from either table in his parameters.

Then I would use this in a fourth Paramter for setting research priorities.

[Enemy Nation, Unit Type, Min_units, Max_Units]

#ANTI_TANK= 50[3][4,1,2,99][5,4,5,9] - i.e. if Germany (5) has tanks (4) and they number from 5 to 9 then research ANTI_TANK 50% of the time if the Russia (4) has Infantry (1) units in quantity of min (2) to max (99).

Thus Russia will assign a 50% priority to research anti_tank if it knows it is facing 5 to 9 German tank units.

Note: For maximum AI flexibility you may want to maintain tables for 1) Allied/Axis Units in Total and 2) Units spotted by Cooperative Allies.

I.e. Scripts can use data stored in either of the following tables:

Allied Table - All units spotted by Allied Units, on the eastern or western fronts.

Russian Table - All Units spotted by Russian Units or its cooperative allies. This allows the Russian AI to base its decisions on the enemy units that only it encounters. This table will not include counts of units spotted by non-cooperative allies, the USA and UK.

USA Table - All units spotted by USA or its cooperative ally the USA.

UK Table - All units spotted (and not destroyed) by UK or its cooperative ally the USA.

[ April 08, 2006, 07:18 PM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

Question - is there any way to give the AI, and only the AI, a randomly selected bonus tech level or bonus research chits bonus in a tech area?

It appears not, so here is another idea for improving the AI Script:

Research Script

Format: % chance assigned to this purchase [max chits][bonus Research Chits][bonus Tech Level]

Example:

Level=4

AI= 1(Script activated for Axis AI player)

Trigger=25 (25% to occur at Expert level)

#Advanced_Subs= 100[0][][1]

In the above example the AI nation would receive a 1 level increase in his Advanced_Sub tech level

Level=4

AI= 1 (Script activated for AI Axis)

Trigger=10

#Advanced_Subs= 100[0][1][0]

In the above example the AI nation would receive an increase of 1 in the research chits allocated to Advanced_Subs.

--------------------------------

For a random starting tech levels you might have:

Country_ID=5

Level=4

AI= 1 (Script activated for AI Axis)

Trigger=100

#Advanced_Subs= 10[0][0][1]

#INTELLIGENCE= 10[0][0][1]

#PRODUCTION= 10[0][0][1]

#ROCKETS= 10[0][0][1]

#MOTORIZATION = 10[0][0][1]

#JETS= 10[0][0][1]

This example shows how the German AI at Expert Level would have a 10% to start the game with a higher tech level in one or more of the above areas. Thus making each game played against the Expert AI slightly different.

Perhaps HC will consider adding a command line for AI script condition and the suggested research bonus parameters? ;)

[ April 09, 2006, 06:57 AM: Message edited by: Edwin P. ]

Link to comment
Share on other sites

Wow. So many ideas. So little time.

There *should* already be some % bonuses in there for AI difficulty level. And some AI enhancements could at least handle reclaiming chits at some point. Easy adjustments here and there need to be considered first, before any wholesale revamping of the scripts are attempted. And let's first see what we can actually do with what we have, yes?

It *would* be nice to somehow link different AI scripts together based on a common strategy theme. Right now, planning, research and production are all independent of each other, and this could lead to some odd executions. The more important issue is how to best do this, and how much effort would be required. Only Hubert knows, and he's the lone programmer! And there's a lot of other stuff on the wish list besides the AI.

Link to comment
Share on other sites

'pzrgndr' ...only you guy's and 'Hubert' can possibly decrypt what 'Edwin P.' is expounding!,...sound's like he has a million idea's, and i like almost all of them!.

My uneducated/uniformed appraisal of the above situation is 'To Go For It' and try to implement at least some of those idea's of Edwin's as can be done!.

Link to comment
Share on other sites

×
×
  • Create New...