Special failings of the combat AI

These are old bug reports that have been closed.
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Reminds me a little bit of what Atarlost setup those Foomerian ships to do. If you blow one up, even if its just a little yacht flying around out in the middle of nowhere minding its own business, they sent a big nasty Huntress ship after you to blow you out of the sky for it.

I say if you blow up a station, they should sent a big nasty fleet after you. You've seen what happens on the preview screen when it spawns 20-30 little ships against one big nasty ship...

But yeah, gotta fix something otherwise you can just hide behind the Ringers or Taikon until said fleet is dead.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

George,
what about giving us some access to AI scripting ?

I don't have a good idea how to do it (probably some xml attributes in a new shiny <GLobalAIBehaviours>), but this will let us to create some custom AIs for various kinds of enemies. (like you said, bunch of dumb enemies, single smart enemies, etc...)

What I would like is some access to modify the combatstyle themselves. The closest thing we have now to tinker with are the perception, ignoreShieldsDown, and aggressor attributes in <AISettings>.

This will also speed up the game balancing.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I suspect fully scripted AI would be too laggy.
Warning: Rambling ahead.


There are a bunch of AI behaviors, though, that could be enabled or disabled.

Chase has velocity matching and enables the AI to actually take advantage of a non-turreted fast weapon.

The standard AI is harder to hit because of its circling behavior.

Then there's the Sir Robin mode.

Then there are the random loops. Increasing the chance of random loops is a cheap way to make an enemy harder to hit, though probably at the cost of not hitting you.

And there's flyby and standoff which change the desired range. Let us dictate the standoff range manually for the benefit of ships whose primary weapon isn't their longest ranged.

Let us change the loop chance and switch between modes in the onAIUpdate event. Let, for instance, the dragonslaver start off in standoff mode. Switch to standard AI when some percentage of the earth slavers are killed, then switch to chase mode if the fight goes too long because that's a sign that it's not hitting you and needs to focus on that instead of avoiding fire. Complex behavior without the performance hit of an interpreted AI on every one of the scores of ships in the largest Huarnica battle.

Arena opponents could dynamicly adjust their random loop chance depending on the circumstances of the fight and switch to chase mode if the battle goes long.

Arco probably doesn't need much change. He's too early to throw an AI curveball at the player. I can't think of any other named opponents that aren't in ships so slow AI is meaningless (ie the Antarctica)

This is everything I can think of that might be useful.
randomDodgeChance = "0<=i<=100" (the frequency of those random little loops)
desiredStandoff = "i>0" (the desired range for standoff mode, defaults to current behavior)
missileStyle= {"shieldBuster" "armorBuster" "standard" "none"} ("shieldBuster" only uses missiles on shielded targets. "armorBuster" only uses missiles on unshielded targets. "standard" uses missiles on any target. "none" does not use missiles)
combatStyle = {"chase" "standoff" "standard" "flyby" "randomWalk" "flee"} ("flyby" may need some work, it sometimes seems too close to standard. "randomWalk" would be exactly what it says on the tins and would be a high dodge mode for omni-weapon users, approproate for the freighters in the arena and for some freighters to shift into temporarily when attacked. "flee" is the current run away code.)
shieldThreshold = "0<=i<=100" (dicates at what percentage of shield damage a ship should engage in desperate behavior)
armorThreshold = "0<=i<=100" (dictates when a ship should engage in desperate behavior if it has no shield or a shieldThreshold of 0. If both are 0 it replaces noRetreat. If both are nonzero desperation will be triggered twice and allow two state changes)
shieldThresholdRandomization = "0<=i<=100" (the degree of randomization of the shield threshold, so that enemies can be non-uniform)
armorThresholdRandomization = "0<=i<=100" (as shieldThresholdRandomization, but for armor)

These would all be defaults and should be adjustable in script events except possibly the thresholds and threshold randomization chances. Inheritance should probably be used to make one or a small number of defaults.

There would also be a new event <onAIDesperation> that would be triggered by the thresholds. In most cases it would switch behavior to "flee" but for certain ships might make them become more agressive, eg switching missileStyle to universal.

This keeps most of the processing in the compiled code, but fancy stuff can be done on individual opponents, and with the onAIDesperation event replacing the flight code greater flexability in general is possible in general with only a few lines of scripted code being run and only when a ship actually needs them run.
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Would you just be able to change a threshold value to "10d5" for example to give it a random value for each opponent? Other than that I like the ideas.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I did suggest seperate attributes for threshold variance, but that's probably a better way to do it. The code's already in place after all since stuff like fragment count takes ranges or dice as well as integers. That would mean two fewer values to worry about.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

very nice idea with onAIDesperation but I would make it 3 thresholds where the extra one is first time they get attacked. So you can have groups that attack if you attack one of theirs or run away and leave the attacked one as a sacrifice.
Crying is not a proper retort!
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

With the ability to set object data that becomes redundant with onAttacked.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

we would need to know what the current combat styles are in script. For example in onAIUpdate we could do a check for targets of opportunity if the ship is just sitting there guarding the base.
Crying is not a proper retort!
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Also, for the clumping problem consider http://www.red3d.com/cwr/boids/

Ships could be grouped without a single squad leader using the boid concept. This would be appropriate for Dwarg, Ferians, Luminous, and any situation where there is either no chain of command or the chain of command is disrupted (eg a marauder raid after the raid platform is destroyed)
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

one idea that came up in IRC is make AI and combat styles types where many ships can have the same AI type and many AI's can have the same combat style.

I am not sure what attributes combat style would have though.
Crying is not a proper retort!
Locked