Another attempt at getting the AI to use artillery

Predator145

Prince
Joined
May 22, 2020
Messages
448
Hi, I've been reading on past attempts of people trying to mod around the broken artillery strategy flag where the unit does nothing but fortify in the city it's built and only hit units within range.I've tested them in the WWII Pacific scenario and have found them to be unsatisfactory. My goal is to have the AI use arty in both sieging cities and supporting in the open. This is gonna be long a detailed.

So here's the TLDR: Use Quintillus/Steph editor to assign artillery units to air bombard and land units.

Here are some attempts and their results:

1.) Glass Cannon: The 2 previous Civ games have artillery line be glass cannons with the last unit having the "ignore walls" ability. Civ3 doesn't have that ability. So you'd need your artillery to have 40 attack to even have a decent chance of breaking a metropolis. This is broken vs anything in the open. But the main reason this solution doesn't work is that once the attack stat is that high, the Civ3 AI builds NOTHING BUT ARTILLERY in their offensive unit slot and uses them unescorted like they use longbows. This cripples them. I'm not sure how civ1 and civ2 handles this. From memory they build a mix of fast offensives and slow glass cannons. Even if you give mono unit civ3 AI 40/10/1 artillery they'd be better off making tanks. And having the offensive/defensive strat means they will never use the bombard function. Only artillery, cruise missile, sea power and air bombard strats can use it. Which brings us to:

2.) Cruise missile: It's just as broken as the artillery strat. The unit will just fortify in the city and bombard those within range, never moving.

3.) Sea Power: With the Quintillus/Steph editor you can put your artillery units sea power strat. Have them still be land units. This confuses the AI and it will not build the unit because the artillery line's stats will always be less than that of contemporary warships. So auto build is a must. The AI will either assign the artillery unit as "defensive sea power" or "offensive sea power". The defensive one is just as broken as the artillery and cruise missile strat, not relocating at all. But the offensive one will move out to bombard enemy cities. They do so unescorted and will only go for enemy cities. And even then they march right up to the city to bombard despite having 2 range. Most of the artillery will be assigned as defensive. So while looking good for a screenshot, this solution offers little to gameplay.

That leaves us with the last solution I've yet to see anyone post:

4.) Air bombard. As with Seapower you need autobuild as all bomber units will out range artillery and thus the AI will never build them. Have the unit be a land unit so that it can provide defensive bombard support. Do not assign it to air unit with stealth as they AI will futilely try to make fighters. The AI will actively move their pieces into the front cities but NEVER STEP OUTSIDE. The movement of these artillery pieces is not shown by the game somehow but they do move. How they'd behave without rail roads I'm not sure as they're very reluctant to be out of a city. But I'm sure they moved out as not all of the Chinese cities have rail connection but their artillery pieces managed to arrive at Nanning and Foochow.

The AI will then bombard enemy units within range. This accomplishes far more than the previous solutions. I gave them 5 bombard range to compensate for them not stepping out of the city (do not animate battles on the first turn as this could crash the game). But then I noticed once their are no more enemies in the open to bombard they'd just fortify instead of bombarding the cities within their 5 range. The bombardment function seems to ignore cities unless they're up close. The goal is to have the AI siege cities as well.

So I added a bombing attack with an operational range of 5. The AI promptly bombs any city within reach but then ignores the enemy units at its doorstep. Bombing ignores units in the open and will always go for cities. Even though now the AI has both bombard and bombing at 5 range, it's not able to switch up. It will ALWAYS HITS CITIES if there are any within range.

This means the AI needs 2 separate artillery units: one for sieging cities and one for supporting in the open. I have them auto produced with 2 small wonders. The siege one has both 5 range bombard and 5 range bombing. The support one however has 5 range bombard and only 2 range bombing so that they can't reach enemy cities and will hit the units up close instead. The reason for retaining the 2 range bombing I will explain below.

The AI though never stepping out of cities will do so in the case of TRANSPORTING VIA SHIP. It will land them often unescorted next to cities and then fire at them. That's why I retained the bombing function as bombard would only hit units. And with no army to back it up, it's not much use. Once the city is taken it will move into that city. Being ill guarded means they need defense stats and a capture flag. Having a defense stat also helps them defend border towns better as the AI does not focus defensive units where it needs them.

Offensive "Field Guns"

With all their artillery being in border towns the invading AI army still doesn't have defensive bombard support. During testing I've discovered that the AI when building an Offensive strat unit will take bombard value into consideration. So it ended up mixing in some 6/6/1 artillery with 12 bombard. This class of "field guns" will escort the AI's offensive army (which often sorely lacks defensive strat units). Tweak the stats carefully however, as too high and you'll up with the AI ceasing to build fast attackers. I've never found a lackluster attack stat on a high defense unit with offensive strat to be a problem with the AI as it will never suicide into bad odds. A very scary army to face is the Javelin Thrower+Longbow stack because the JT too is of offensive strat and will escort the LBs.

In order to have the AI build mix of units, the stats have to be just right. A good example is the Light Tank+Combat Engineer mix. This line of idea is still untested largely. So I'm not sure.

I hope some people can tests these ideas and develop more on them.
 
One more strategy that worked well for me was producing artillery units through enslavement. The AI actively uses such artillery in the offense. Drawbacks are that it allocates lots of it's units to protect this artillery and that sooner or later to many artilleries make AI turns insanely long.
 
One more strategy that worked well for me was producing artillery units through enslavement. The AI actively uses such artillery in the offense. Drawbacks are that it allocates lots of it's units to protect this artillery and that sooner or later to many artilleries make AI turns insanely long.

Do you give every combat unit in the game enslave into a catapult and delete yours? Or is there a way for the AI to auto build foreign artillery pieces?
 
First off: W:eek:W!

Questions:

During testing I've discovered that the AI when building an Offensive strat unit will take bombard value into consideration.

Can you elaborate? - For starters, when building, does the AI consider a unit's Attack value to be a direct combination of its {Land Attack value } + {Bombard value}? Example: is a unit with a {Land Attack value of "4" + a Bombard value of "4"} the direct equivalent of a unit of either (1) a Land Attack value of "8", or (2) a unit with a Bombard value of "8"?

Second:

This class of "field guns" will ESCORT the AI's offensive army.

Do you mean "Escort" in the same way that a Naval unit can be flagged as needing an escort? Also., what, precisely, do you mean by the, "AI's offensive army"?

In order to have the AI build mix of units, the stats have to be just right. A good example is the Light Tank+Combat Engineer mix.

"Light Tank+Combat Engineer mix" ... ?

I hope some people can tests these ideas and develop more on them.

:cooool:
 
Do you give every combat unit in the game enslave into a catapult and delete yours? Or is there a way for the AI to auto build foreign artillery pieces?
I have allowed some (it was somewhere about 7 years ago, I may not remember all the details) of the land units to produce various artillery units by enslaving them. Did not delete units enslaved by me. I suppose that AI MAY occasionally build "captured" artillery piece in case producing artillery costs population and there are foreign citizens in the city of origin, but that would be a very rare occasion.
 
First off: W:eek:W!

Questions:



Can you elaborate? - For starters, when building, does the AI consider a unit's Attack value to be a direct combination of its {Land Attack value } + {Bombard value}? Example: is a unit with a {Land Attack value of "4" + a Bombard value of "4"} the direct equivalent of a unit of either (1) a Land Attack value of "8", or (2) a unit with a Bombard value of "8"?

Second:



Do you mean "Escort" in the same way that a Naval unit can be flagged as needing an escort? Also., what, precisely, do you mean by the, "AI's offensive army"?



"Light Tank+Combat Engineer mix" ... ?



:cooool:

The Light Tank+Combat Engineer example is that of the AI of the WW2 Pacific Scenario building both fast offensive unit and a stronger slower one if the stats of those 2 are balanced vs each other. Once Medium Tanks (13/8/2 with blitz) are available it will build nothing but that as its offensive flag unit.

I'm not sure how much worth the bombard strength is. We know that the longbow with bombard strength of 2 will not be built as long as the AI can still make Medieval Infantry. I know from testing that by having Artillery with 12A/1D/1M and its usual bombard strength of 12, ROF of 2 and 2 range would result in the AI building nothing but Artillery instead of Combat Engineers (11/6/1) and Light Tanks(8/5/3 with blitz). I also just managed to get the AI to mix in an offensive flag 7/10/1 with 8 defensive bombard Artillery before Medium Tanks were available. It will build a few along side Light Tanks and Combat Engineers.

Unfortunately the "Requires Escort" flag does not work at all on land. But since the AI will only bring a couple of defensive flag units along with its offensive stack it benefits from having offensive flag units with high defense as they will travel in the same stack, bolstering its defensive bulk. Afterwards its back to the usual incompetent trickle.
 
Long ago ( :old: ) , I started a thread about AI unit build choices. It went on for 6 years, well over 500 posts, dozens of test cases, and thousands of iterations - And then tom2050 really picked up the ball and ran with it, delving into the various effects of Flags.

Early on, I stumbled across a formula by a fellow called Oystein, stating that the AI would choose equally, between two ground units, if the sum result of each was, "(((3*A)+(2+D))*HP + Bombard)," meaning that a (2 AF, 2 DF, 2 HP, 0B) - total value = 20 - should be built with equal frequency as a unit with the values (4 AF, 4DF, 1 HP, 0B) - total value likewise = 20.

Notes:
  1. We ignored Bombard throughout, as we knew how broken Artillery was, and remains, so the actual formula we used was, "(((3*A)+(2+D))*HP)"
  2. The results were ... interesting.
And, ultimately, none of realized how close we were to so much more detailed. information.

To be continued ...
 
Long ago ( :old: ) , I started a thread about AI unit build choices. It went on for 6 years, well over 500 posts, dozens of test cases, and thousands of iterations - And then tom2050 really picked up the ball and ran with it, delving into the various effects of Flags.

Early on, I stumbled across a formula by a fellow called Oystein, stating that the AI would choose equally, between two ground units, if the sum result of each was, "(((3*A)+(2+D))*HP + Bombard)," meaning that a (2 AF, 2 DF, 2 HP, 0B) - total value = 20 - should be built with equal frequency as a unit with the values (4 AF, 4DF, 1 HP, 0B) - total value likewise = 20.

Notes:
  1. We ignored Bombard throughout, as we knew how broken Artillery was, and remains, so the actual formula we used was, "(((3*A)+(2+D))*HP)"
  2. The results were ... interesting.
And, ultimately, none of realized how close we were to so much more detailed. information.

To be continued ...

Wow, lots of info that thread.

I wonder how much speed is taken into the AI's calculation. We know it undervalues it. It builds horsemen over archers but I don't know if it still does that if it has access to 2/2/1 offense like Bowmen and Javelin Throwers. It certainly doesn't even mix in horsemen and even mounted warriors if it has access to swordsmen and longbow. I think any unit added must not have more attack and defense than the fast offensive unit you want it to primarily build. The 6/4/1 Grenadier totally replacing 6/3/3 Cavalry is a good example of what not to do.
 
One thing about artillery that was discovered some time ago is that 4+ range makes they AI use artillery better but I'm so out of touch I can't remember how. Maybe makes the AI bombrad units when it doesn't normally or something like that? I forget what the problems with artillery even are exactly.
 
One thing about artillery that was discovered some time ago is that 4+ range makes they AI use artillery better but I'm so out of touch I can't remember how. Maybe makes the AI bombrad units when it doesn't normally or something like that? I forget what the problems with artillery even are exactly.

With the broken artillery flag on 1 range bombard units won't even bombard units next to the cities they're stuck in. 2 range and above bombard units will bombard those within that range but will remain stuck as if there was an immobile flag on them. As long as you keep the artillery or cruise missile flag on, there is no hope for same nationality artillery units to move anywhere.
 
:D



From all of my testing - Not at all.

I'm sure it does but in a very undervalued way. On an offensive unit 1 speed is probably worth the same as 1 defense. The AI however loves blitz, amphibious and all terrain as roads. I've tested an attack helicopter as an offensive flag air unit. This automatically gives it the capture ability and will behave and be treated like a ground unit that can walk on water. It fully benefis from rails. There is no way to replicate a civ2 air unit. With 2 less attack than the highest offensive flag unit, 1 defense and 3 movement with all terrain as roads, blitz, radar and amphibious the AI mixes quite a few of them in. But I'm not sure I'm gonna keep it as it forces the human player to spread defenders too thinly. There is no way to turn the capture ability off. The moment you check the offensive flag it will activate regardless whether you check the capture flag or not.
 
The AI does used Bombardment from inside Cities even with 1 tile distance. In my EFZI2 Games, Any Zombie Unit that has Bombardment uses it against the Human Factions from inside a Building.

The AI will use Bombardment outside on the Map IF a Bombarding Unit is Pre-placed with a Defensive Unit. This is because the AI did not build the Unit and the AI follows the Settings you set. Same thing with Any Pre-placed Unit... the AI will use the Unit with Multiple settings, changing each turn for what is wanted. Offense, Defense, Build Road, Irrigate, Clear Pollution, etc...
.
The programing for the AI basically forces it to decide on One setting when building a Unit that has multiple settings. There are exceptions to this such as the Legionnaire or other Units you can set to Attack and Build Road or Irrigate without flagging all Worker Actions. The AI can and does build Units with different settings each time it builds a Unit that has multiple settings to choose from but IF you pre-place a Unit with Multiple settings on the Map or in the Game, the AI will use that Unit as a Human Player does. It will use all settings varied from turn to turn as it chooses what it wants from all settings each turn.

As for the AI using Bombardment outside on the Map with Pre-placed Units, it tends to Go to some destination with the Defending Unit and Bombard a City each turn. Funny that the Enemy AI tends Not to attack the Bombarding Unit as if it cannot defend against it. Using Bombardment on the Map remains problematic but you can have the AI use Multiple Settings for a Pre-placed Unit, varied each turn.
 
I'm sure it does but in a very undervalued way. On an offensive unit 1 speed is probably worth the same as 1 defense. The AI however loves blitz, amphibious and all terrain as roads.

You're jumping ahead of me by (hopefully) about 1 week. There s much more info out there, including more AI tests for flag choices. I will forewarn you that simply testing non-artillery ground units - again, over the course of years - was exhausting, but not exhaustive. For instance, I'm piecing together what is known about the AI's flag preferences re:flags in unit builds.

There is no way to turn the capture ability off. The moment you check the offensive flag it will activate regardless whether you check the capture flag or not.

:confused: I'm going to invite the Unquestioned Masters of this, @Quintillus & @Civinator to weigh in on this

Insofar as Artillery goes, @Vuldacon - as posted above - knows far more about this than I.
 
From some more testing I've found out:

Artillery units set as land units and flagged as air bombard will have a "bombing" attack as a command option. But this attack is in fact a bombard attack and will only work if the target is inside that unit's bombard range. So if you have a bombard range 2 and operation range 5 artillery its bombing attack won't do anything to a target 4 tiles away. You can click but the command won't execute. Should the AI attempt doing that with battle animations on, which it will if there are no targets within the 2 bombard range it will result in the artillery being stuck in a firing loop, forcing you to close the game and restart the computer to boot up Civ3. Even with no bombing option and operational range, 5 range bombard attack could cause that crash. But it seems to go way if you don't animate battles for a couple turns. It's best to just leave animations off.

That means bombing is not an option on a land unit artillery despite what that extra button appears to be. It is only if you set it to be an air unit. That's a bummer as I dislike the "smart artillery" in C3C. Artillery is strong enough as it is. But those making the game decided to listen to people who didn't know how to use it:mad:. You can beat muskets with cats, rifles with trebs in C3C. Is there a way to revert bombard back to vanilla mode?

I've also tested land transports. My attempt at a a land unit, air transport flag train failed as the AI just transport the troops into enemy territory like an APC and then get killed there. Not remotely realistic for a train but perfectly ok for auto built trucks and APCs.

So I tried making trains immobile with re-base in the hope the AI would load units into it which it does and then re-base from city to city. But the trains would just just stick to the front cities once they get there. It will load the troops in but without airdrop or mobility it doesn't do anything.
 
Some more testing results:

Using the "king" ability, one can make a unit unbuildable but upgradable into. The AI will build "artillery" strat units and then upgrade them into "king" units with a different AI strat, one that it can make better use of.

On the WW2 Pacific scenario, I tested glass cannon offensive arty again. At 20/1/1 A/D/M with bombard 10, ROF 10 and zero range costing 80 shield they were meant to be cheap mass assault units. "Artillery" has the "artillery ai flag" and upgrades to "Artillery2" with the king abilty and "offensive AI flag". By adding inconsequential values like a ROF of 10 and things like "blitz" and "stealth" and the "Artillery build often" flag the AI builds these in sufficient numbers that would make a SW unnecessary if you only have 1 artillery line. And the best thing is it will still build its normal strongest offensive flag unit.

However, the AI is very bad at getting good use out of 1 movement glass cannons. It is highly unlikely that a human would let his cities be attacked. The human player would just need to wait 1 turn to lure all the AI artillery units into his territory, wipe them out before proceeding with his own escorted stack. With rail roads in the game, the AI is even more handicapped. The exception would be in landings on a different continent. The result is still that the humans can touch AI cities while the AI can't touch human ones.

And attack stats would be balanced on these glass cannons? There is no "ignore walls/bonuses" ability flag in Civ3. Nor can the AI do anything to reduce these bonuses with an offensive unit unless you attack successfully and cause collateral dmg to walls or civil defense. So vs Infantry with 10 def in an epic game, Artillery would need at least 20 or 24 attack. An infantry in a metro with civil defense receives 150% plus 10% to 50% terrain bonus. That could be up to 32.5 def on a fortified Infantry.
 
Top Bottom