[Request] onlyAutocastWhen - conditional autocasting conditions.

Amidst both modding and playing a couple large scale games, I've started to become increasingly frustrated by the games lack of an actually intelligent autocast ability. It seems to almost invaribly fire things too fast and too often, even when it's not actually needed. Of course, trying to program an AI to work out the myraid of situations it needs to keep in mind is very likely not worth it - thus, my suggestion is that a large chunk of the decision making process be built into the very entities themselves, through a simple scripting language that could make the choices infinitely more powerful.

Also while looking through the game code, I've come to notice that there's a strong odds that there's some sort of query layer that's able to be asked what to do and how to do it - even if it's just GetDamagePercent etc, it'd be nice to have access to it.

So what I'm suggesting is that the conditions - many of which are already present, and some which aren't - get put into a simple, .entity based scripting language. This would be usable for both autocast, targeting conditions and endconditions in Buff.entity files. (Heck, It would be a start if all the different Endcondition, StartCondition and Autocast Conditions were made global to begin with.) It needn't be complicated - all I'm really after is a small set of conditional commands, even if it's just a simple if-then (not even asking for an else!): OR, AND, and enough variables to make it intelligent.

The actual syntax below is largely arbitary; the capability matters more than the words in question, though I tried to keep it similar to the current entity writing style.

In terms of parsing, it cancels a line on the first FALSE it returns, and executes the first full line to return TRUE, skipping all the rest. Thus, you can prioritise orders by listing them first, and speed up queries that have a 'go condition' by listing the most obvious stuff first - if you've got a highly situational ability and don't want it to fire unless there's lots of antimatter spare, check that first. Hopefully the rest shoud make sense. Oh, and // is merely a comment. ;)
(Gosh, I'd love it if .entity files could accept comments...)

For this example, 'Target' refers to the previously checked item. So a CapitalShip condition1 AND Target condition2 means that 'check for a capitalship with condition1, and then if that same ship has condition2. Depending on how it's implemented, such a check may be superfluous, but I'm trying to make it clear here. Hopefully the other terms should make sense at first glance. :)

To start with, a nice simple one - the Kol Finest Hour. At present, it tends to trigger the moment the Kol shoots at a hostile ship; not exactly smart usage of a high value Ultimate Ability.
LastStand.entity: onlyAutocastWhen HullDamagePercent MoreThan 70 AND InCombat //Perhaps a better wording so you can say "When your hull is at 70% health or worse" or the like, but the basic idea stands - when you're damaged, and you're still fighting, amp up.

The Kol, meanwhile, has a powerful Rail Gun that you don't actually want to fire constantly, lest you run dry. All too often at present, a Kol will chainfire the Rail Gun, and leave itself spent right when it needed a Flak Burst or a Shield.
onlyAutocastWhen Hostile Anyship IsPhaseJumpingOut //One tends to want to go all out on retreating ships (to bring them down quickly).
OR Personal AntiMatterPercent MoreThan 50 //Otherwise, don't go running yourself dry on the ability - only fire if you've got more than half a tank of juice spare at the time.

Many AoE attacks, meanwhile, are only worthwhile when targeting multiple foes.

RadiationBomb.entity: onlyAutocastWhen Hostile AnyShip InAoe MoreThan 2; //To avoid computational complexity, simply measure the number of hostiles within the AoE of the currently targeted ship - not perfect, but at least saves it being wasted on single targets. This may require a stated AoE being listed in the .entity file.

Likewise, it'd be nice to command the Vasari's Reintegration to have some degree of sense when to activate.

Reintegration: onlyAutocastWhen Personal HullDamagePercent MoreThan 80 //When heavily damaged, go to repair mode. Even if you're still being shot at, it might buy allies enough time to bring the enemy down.
OR Personal HullDamagePercent MoreThan 20 and HostilesPresent LessThan 3 //And when you're alone, and it's safe, just fix yourself. Less than 3 (probably less-than-or-equals, but whatever) is so a single scout in-system doesn't stop matters.

Dunov Shield Restore:
onlyAutocastWhen CapitalShip ShieldDamagePercent MoreThan 50 //First order of buisness is healing allied capships. Given it's an instantaneous recharge, you can afford to let the shields drop down before helping them out.
OR Personal AntiMatterPercent MoreThan 40 AND Friendly Frigate ShieldDamagePercent MoreThan 90% AND Target InCombat; //If you've got a reasonable reserve of antimatter, and there's a frigate that's taking heavy fire, help 'em out.

HostilesPresent would be an interesting one - its intent is that you can cause a condition to trigger only if there's more or less than a certain supply of enemy warships in system. (I figure supply is probably the most intuitive way to measure threat level). It would include hostiles inbound on phase lanes - but only if you can see said hostiles, of course. So HostilesPresent 10 could mean that a ship doesn't waste an ability when there's just one or two scouts in-system. Or indeed, LessThan HostilesPresent 4 could ensure that something happens in relative safety.

Hell, let's go nuts on the Cielo's Embolden, an ability that's both useful to restore allies, but also boost them. This is a relatively 'conservative' build - it doesn't target allies yet to take fire unless there's plenty of juice spare.
onlyAutocastWhen Friendly CapitalShip ShieldDamage MoreThan 10 AND Target InCombat //First, help out any capital ship under heavy fire.
OR Friendly CapitalShipPercent InCombat //Then, given it boosts both shields and damage output, any capital ship that's being shot at or shooting at something is a good investment to buff - once the ones being shot at are helped first, of course.
OR Friendly Frigate ShieldDamagePercent MoreThan 10 AND Target InCombat //After your capital ships, heal any frigate that's taking damage.
OR Personal AntiMatterPercentPercent MoreThan 60 AND Friendly AnyShip ShieldDamage MoreThan 50 //Then, if you have spare, patch up allied craft who have lost shields - even if the combat is over, if you've got some AM spare, it's handy to accelerate the healing process.

You start to get the idea. Thoughts?

3,380 views 6 replies
Reply #1 Top

Would be great.

Smarter ship captains is something that the game would definatly benifit from, and ablities usage would certainly help that.  Something that kinda bugs me to hell is that I cant zoom in, turn on cimimatic, and hit ctrl+shift+z and watch my ships fight because I allways have to tell my frigates to run for your stupid life,  and tell my space egg that "hey, you just nanoed that ship... you dont need to keep attacking it since its going to be dead in 20 seconds anyway..."

Reply #3 Top

Cool ideas!

How about for flak burst and the Advent equivalent: onlyAutocastWhen enemy strikecraft are within X range

Where X would be a very small number.

Or

after first hit from enemy SC

or

if number X enemy SC are in range

 

Reply #4 Top

I'd imagine having some way to count hostile strikecraft - or at least, hostile squads in range would be entirely reasonable. Indeed, squads is probably the best way, especially if it counted as fractions (Because Advent squads have almost 3x the number of craft a Vasari one does, for example. And fractions would handily let it deal with "Six squads of one fighter each? Yawn. Wake me up when they're two fighters eac--oh there we go *KABOOM*).

A range feature would be nice too. So would a range of others (Actually a surprisingly small range, but still). The list I suggested wasn't exhaustive; merely showing the general idea, and just how powerful such a tool could be for letting an Autocast act intelligently. Heck, half of the ones I wrote are the mental heuristics I run when working out when to fire things anyway - which means if a computer could autocast as intelligently as my general 'rule of thumb' tactics (AKA: Not always applicable, but generally a good start), it could leave us to deal with the actual exceptions instead. Or just shrug and focus on something more interesting than ability micromanagement at all. :)

Reply #5 Top

Well,  you nail it : it wouldn't be that useful with caps as we almost all manage there abilities by ourselves but for support ships, it is a must have. Moreover, it would make the IA far stronger.

Reply #6 Top

Even for capital ships, it would have its uses.

The Kol's Guass Rail Gun is an excelent example - if it automatically targets Capships for preference, followed by other craft only if there aren't any handy, and only autofired when there was plenty of spare antimatter left (AKA 'got some to burn anyway'), you could afford to put it on autocast, because you wouldn't accidentally cripple the ship before you could pay attention to it.

As it stands, you manage their abilities partly because they're too precious to let go to waste. With them, the key is knowing when not to fire, letting humans do the rest. :P