AI and Finite Resources Bug

Program aborts? Network configuration? Graphic errors? Bugs? Post your question here.
1, 2
posted on January 14th, 2014, 7:42 pm
If you make a series of finite resource objects (with any one type of resource), and give those objects different amounts of that resource, the AI will go straight to the object with the highest amount of that resource.

For example, in the STA2 classic mod, with the default map, the Borg will go to the nearest D-Class planet because the D-Class planet has the highest concentration of metal of any other map object. Then they will go straight for the center of the map because it is there where the infinite Dilithium resource is. And that, by definition, is the highest concentration of Dilithium of any other map object.

This means that the player will be able to have the strongest ships with most (if not all) of the upgrades before the AI even advances past the basic shipyard. So, the player has fleets of battleships going up against the handful of cruisers (if not destroyers) that the AI have. And it doesn't take that much number-crunching to figure out who will win that match.
posted on January 14th, 2014, 8:06 pm
I believe that's how it was programmed? Have a look ineach AIP file in the AI folder. Like exploration, defense, aggressive and very_aggressive down near the bottom of each one there is this:

// How likely are we to build resource bases far from our main base
// ACTUALLY, this is how IMPORTANT it is that a base be close to our main base
// This gets multiplied by the inverse of the distance...
double resource_distance_multiplier = 10000.0;

// How likely are we to prefer resources with more health
// Since this looks at the actual value of how many units of resource something has, we need to scale this down. A planet having 32000 resources vs. a planet with 8000
double resource_health_multiplier = 0.0001;

I've never actually adjusted those values, but try it and see if it actually does affect the AI's preference for higher vs. lower resources vs. distance from start position.
posted on January 14th, 2014, 9:03 pm
Found the problem. And it was with the STA2 Classic mod. Oops!
posted on January 14th, 2014, 9:57 pm
Excellent! Thank you for uploading that patch Chapman, as I was having the same bloody trouble with KA2, and given the lower speeds and larger maps in KA2 it hamstrung the AI even more than STA2 Classic.
posted on January 14th, 2014, 10:23 pm
I haven't posted the AI resource bug fix yet. But I fixed it by replacing the A2 Classic AIP files with the stock A2 AIP files. Or did you do that as well?
posted on January 14th, 2014, 11:30 pm
I haven't. What is the line I should be looking at exactly?
posted on January 14th, 2014, 11:39 pm
Just replace the whole batch with the stock A2 AIP files.
posted on January 14th, 2014, 11:45 pm
I'm working on my own AIPs in KA2. I can't do that. What lines seem to affect this?
posted on January 15th, 2014, 12:37 am
I don't know.
posted on January 15th, 2014, 1:57 am
This is interesting. My original Classic Mod is v. 1.2b and in comparing the files in the AIP folder to a stock install some of the date stamps are different. Some by one day, some by 1 hour and some by 2 months.

No idea what would cause that? So are you saying that by putting the stock files back into the Classic Mod the AI doesn't exhibit any behavior whatsoever in preferring a moon with more resources over one with less? Did you test different distances to a moon with more resources? And it's behavior is consistently repeatable?

For one example here's something I found. In the A2-aggressive.aip for Classic mod under Resource Tendencies:

// how likely are we to build resource bases far from our main base
double resource_distance_multiplier = 1000.0;

Now in stock it's:

// how likely are we to build resource bases far from our main base
double resource_distance_multiplier = 10000.0;

Stock has a larger distance multiplier so that's probably part of the explanation? With the larger # it's less likely to prefer further away resources that are higher in metal/dilithium.
posted on January 15th, 2014, 2:04 am
I used ExamDiff to compare them, and found the same thing rifraf. The note on that particular setting is rather vague. It seems it works backwards then? (the larger the number, the LESS it prefers further distances, sort of like the penalty increases by a value of that much)

I'll do a little experimentation and see what I find
posted on January 15th, 2014, 3:46 am
I think that's how it works SquireJames. Though all of these entries will play a role I believe depending on distance from home, amount of resources and distance to enemy:

// How likely are we to build resource bases far from our main base
// ACTUALLY, this is how IMPORTANT it is that a base be close to our main base
// This gets multiplied by the inverse of the distance...
double resource_distance_multiplier = 10000.0;

// How likely are we to prefer resources with more health
// Since this looks at the actual value of how many units of resource something has, we need to scale this down. A planet having 32000 resources vs. a planet with 8000
double resource_health_multiplier = 0.0001;

// what is the penalty for building near an enemy resource
double resource_enemy_penalty = 100.0;

I am wondering now if the original version of the Classic Mod was started using the Demo version of the game and then later was perhaps updated to the full files in the full version when it was released and some got missed? Reason I say that is because some files in the Classic Mod are earlier than the files in the stock full version game.

Maybe Blade can chime in as to whether he used the full version game all along or started with the Demo originally?
posted on January 15th, 2014, 3:59 am
Actually, I started the A2 Classic mod. But I had problems with the UI and Blade took over from there. As far as I know, the AIPs were from stock A2 when I was making it. What happened after that I don't know as I pretty much gave-up on it. But from the dates, I would say that the AIPs were modified before release. Either by confusing AIPs from another mod or from Fleet Ops AIPs. When I started the mod, the FO mod manager was not yet in place. So I may have been responsible for the mix-up, but I'm very sure that I deleted all of the Fleet Ops AIPs. Anyways, I have the fix and will release it shortly as a full update of the mod.
posted on January 15th, 2014, 4:17 am
I'm sorry TChapman500. I knew you started the Import thread, but I just assumed you and Blade started work at the same time and then everyone just went with his version. My bad. :blush:

I seriously think some of those files must be from the demo version as they predate the files in my full version stock A2. Unless you, Blade or someone edited them in 2001?
posted on January 15th, 2014, 3:04 pm
Well, the stock A2 v1.1 AIP files date as early as November 2001, but no earlier. And that's from a fresh Armada 2 install plus the patches.
1, 2
Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests