Freyr and AI/AIP's -1 reply

Please wait...

Freyr Advanced Member

A2Files Staff

46,876 XP

6th February 2005

11 Uploads

4,275 Posts

0 Threads

#11 8 years ago

My view personally is that Intrinsic Value should be reserved for targets of strategic value only, and never for a ship or station of purely tactical value. This means that while the stock AI considers a starbase surrounded by a screen full of torpedo turrets and a fleet of ships the most important target on the map my AI's will consider it to be a death trap and prefer to shoot up that undefended mining station with loads of freighters around it. =p

Ultimately, such decisions are simply driven by how you want the AI to behave.

My experience suggests that at some point the force matching calculations were completed, since they do appear to work correctly.




rifraf

Avid Gamer, Novice Modder

50 XP

24th July 2003

0 Uploads

180 Posts

0 Threads

#12 8 years ago

Thanks D_N, Freyr, you know far more about this than I and I don't want to come across like I'm doubting you I just am curious and want to know more.

So, in A2 before I really started changing any AI/intrinsic/attack values, I had all borg set with no shields. The game seemed to play good. I did notice when I was borg my base area was never really challenged by anyone (I don't think the AI had actually discovered it yet) though the AI did engage me other places on the map sometimes with more ships than me sometimes not.

In another game after I changed some of the AIP's to explore more and have higher base attack goals, I set the AI as borg and watched as other AI attacked them with single ships up to fleets of various sizes. The AI kept attacking the other AI borg base but seemed like it came with more ships each time. I'm not talking fleets of hundreds but one or more per increase. So is the AI just set to bring more ships if it looses certain amounts at a location or is it maybe recognizing the value of the threat that borg posed even though the borg had no shields? I know I need to test more just wanted your thoughts.




rifraf

Avid Gamer, Novice Modder

50 XP

24th July 2003

0 Uploads

180 Posts

0 Threads

#13 8 years ago

So Freyr, just so I might understand, we might do something like:

turrets=1.0 Attack but maybe .25 or .5 Intrinsic(as they're not that valuable) bases=1.0 A and 2.0 I (default) oribtal/mining/research/yards=.25 or .5 A (since they have no weapons) and 1.0 I (since they are valuable?)

Are ships then considered the same? Battleships 1.0I and 1.0A then maybe cruisers .75I and .75A and maybe destroyers .5I and .5A or would ships just use attackpower more since technically they aren't that important per se and have lower intrinsic value?




Dominus_Noctis

GF makes me horny

50 XP

2nd October 2010

0 Uploads

89 Posts

0 Threads

#14 8 years ago

It's never a problem to ask questions :).

If you set attackPower to 1.0 for battleships, 0.5 for cruisers, and 0.25 for destroyers, that just means that the AI (craft as well as the faction AI) is considering cruisers and destroyers to be a similar attack value as battleships, although destroyers will still be attacked first, as the attackPower is far too low to change that (as battleships have much higher shield hitpoints than cruisers and destroyers).

So basically you should determine what goal you want to set - do you want the AI to target battleships first? Or cruisers? Or destroyers? Etc. Note that attackPower also impacts your own control, as that's how your weapons choose which target to attack first when you don't command them :) .

I'm not sure how to answer part of your first posting's questions I'm afraid. As far as I know, the AI does try to outmatch threats when it loses units at a location (that's why it builds a threat map, which you can see with the debugger). As for why your Borg AI did ok, I am not sure - shieldless units should cause a great deal of problems for the AI in stock, as so many variables are based of the necessity of max shield strength. This is one reason why in Fleet Ops we had to build in hull HP into the algorithms, so that the AI could properly recognize threats :uhm:




Freyr Advanced Member

A2Files Staff

46,876 XP

6th February 2005

11 Uploads

4,275 Posts

0 Threads

#15 8 years ago

rifraf;5624105Thanks D_N, Freyr, you know far more about this than I and I don't want to come across like I'm doubting you I just am curious and want to know more.[/QUOTE]

Sure, ask away. It's good to see other people are taking an interest in AI's.

rifraf;5624342So Freyr, just so I might understand, we might do something like:

turrets=1.0 Attack but maybe .25 or .5 Intrinsic(as they're not that valuable) bases=1.0 A and 2.0 I (default) oribtal/mining/research/yards=.25 or .5 A (since they have no weapons) and 1.0 I (since they are valuable?)

Are ships then considered the same? Battleships 1.0I and 1.0A then maybe cruisers .75I and .75A and maybe destroyers .5I and .5A or would ships just use attackpower more since technically they aren't that important per se and have lower intrinsic value?

Ok. Hypothetical mod here

Battleship with a shield rating of 1000 cruiser with a shield rating of 200 destroyer with a shield rating of 100 Starbase with a shield rating of 6000

The AI sees a lone starbase and decides to destroy it. It looks at the starbase and sees a shield rating of 6000, which is then multiplied by the attack force. If it's less than 1.0 then the shield number is actually getting divided. IE; 6000 * 0.5 is a total of 3000, which the AI will consider to be the "strength" of the starbase. It then looks at the force matching code that says it should attack with 80% of the force required which means it will attack with 2400 worth of ships.

Big walls of text confuse people, so let's lay that out differently.

Starbase shield rating 6000 Starbase shield rating multiplied by the attack force multiplier of 0.5 3000 force matching strength of 80% 2400

2 Battleships 2000 2 Battleships + 1 Cruiser 2200 2 Battleships + 1 Cruiser + 2 destroyers 2400

The AI considers that 2 Battleships, a Cruiser and a couple of Destroyers to be adqequate to the task of killing a starbase. In reality the destroyers and cruiser will die from a single volley from the starbase, so 3 volleys later you only have 2 battleships, which leads to the sheilds being taken down to about 70% on the starbase with the loss of the entire attack force.

This is why you see the ludicrous force matching in the stock AI (and sadly in fleetops, last time I checked) where the AI keeps persistently throwing inadequate numbers of ships into defences.

In my opinion, it would be best if people just set everything to 1.0 and left them them alone. The AI will be far happier since it would then calculate that it needed 6 battleships to nuke the starbase, which is the actual figure I used to give as a guideline when I was playing online. While it won't be perfect, it'll be humanlike in attacking. I was quite interested to see one of my more recent AI's approach a wall of turrets, calculate it couldn't win the battle, then turn around and go around the wall of turrets and attack the base it was defending from the back. That sort of effect is caused by decent force matching!

Personally, I advocate a intrinsic value of zero for any unit or structure of tactical value. Ie, the things with guns on them. I would advocate leaving the values to things of real strategic value, such as research bases, shipyards, mining complexes etc.

This avoids the AI attacking isolated clusters of turrets because they are more valuable than base structures.

[QUOTE=Dominus_Noctis;5624407] I'm not sure how to answer part of your first posting's questions I'm afraid. As far as I know, the AI does try to outmatch threats when it loses units at a location (that's why it builds a threat map, which you can see with the debugger). As for why your Borg AI did ok, I am not sure - shieldless units should cause a great deal of problems for the AI in stock, as so many variables are based of the necessity of max shield strength. This is one reason why in Fleet Ops we had to build in hull HP into the algorithms, so that the AI could properly recognize threats :uhm:

As he says, this is one of those imponderables. Presumably the Borg AI did reasonably well since the other AI's couldn't figure out what was required to attack them with. I would be surprised if the AI in the stock game can actually see any of the ships or stations in your borg race on it's threat map at all.




rifraf

Avid Gamer, Novice Modder

50 XP

24th July 2003

0 Uploads

180 Posts

0 Threads

#16 8 years ago

Thanks for the info guys and great examples. Time to put in some numbers and do some testing.

One question on ships. I'll make intrinsic = 0 so attack power on battleships 1.0, should all ships be 1.0 or maybe closer like .9 for cruiser and .8 for destroyer? I'll have to test a range and see what plays better.




Freyr Advanced Member

A2Files Staff

46,876 XP

6th February 2005

11 Uploads

4,275 Posts

0 Threads

#17 8 years ago

I don't think the attack force should have a value under 1.0, frankly. Anything under 1.0 is actually dividing the starting number. Personally I would advocate just setting everything to 1.0, unless you have ships with a massive punch but a low shield rating, in which case you may want to consider a higher multiplier.




rifraf

Avid Gamer, Novice Modder

50 XP

24th July 2003

0 Uploads

180 Posts

0 Threads

#18 8 years ago

I've been looking at the "An Experiment" thread on page 3 and saw this:

// Added for each enemy base in a grid cell for ATTACK_BASE goals. // NOTE: Increase this value to make the AI more likely to attack enemy bases, // or decrease to make the AI less likely to defend bases. // (valid values: -99999 to 99999) // int attack_enemy_base_priority = 1500;

// Added for each unit of enemy intrinsic value in a grid cell for ATTACK // and ATTACK_BASE goals. // NOTE: Increase this value to make the AI more likely to attack // valuable targets, or decrease to make the AI less likely to attack // valuable targets. (valid values: 0 to 99999) // int intrinsic_value_bonus = 500;

This is from the "example" AIP in the stock game. Should this be incorporated into the AIP's we use or am I jumping the gun?




Freyr Advanced Member

A2Files Staff

46,876 XP

6th February 2005

11 Uploads

4,275 Posts

0 Threads

#19 8 years ago

Yes, you should have both of those in your personality files.

In fact, you should have all of the priorities in there.




rifraf

Avid Gamer, Novice Modder

50 XP

24th July 2003

0 Uploads

180 Posts

0 Threads

#20 8 years ago

I'm wondering if a certain change would screw up the equation? The stock game bases have maxHealth=6000 so that's how your getting sheild strength.

If I change mine to be maxHealth= say 5000 and input the line maxShields=6000 would the game get the shield strength of 6000 from that new line or should I configure my game to leave only maxHealth?