Target prioritising of turrets

Place to discuss the game balance, recipes, health, enemies mining etc.
Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Target prioritising of turrets

Post by Boogieman14 »

Current behaviour of turrets appears to be to lock onto a target and keep firing at it until it's gone. In the vanilla game, this doesn't matter much because most biters and spawners vaporise instantly with sufficiently researched turrets. When you're using modded enemies however, this can lead to potential issues. For instance, with bobenemies, new spawners exist that have 3500 hitpoints so they take a while to blow up. In the time this takes, several new biters or spitters can spawn and eat away at the turrets. It would probably be more sensible if the turrets would switch to a new target if they detect something that poses a bigger threat than their current target. Or perhaps somewhat simpler logic: prioritise the enemy object with the lowest amount of hitpoints.

All this of course assumes turret creeping isn't considered an invalid tactic (but if it is, I think new tools need to be introduced to push back against the biters in mid game; the tank doesn't seem well equipped to handle big biters).
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

SirRichie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Feb 25, 2015 4:50 pm
Contact:

Re: Target prioritising of turrets

Post by SirRichie »

I do not think this is a balancing issue, it is much more an issue about turret AI.
I see the problem you outline. The problem with your approach is that if I had a mod which puts in spawners which spawn a lot of small enemies at a high rate, the turret would only fire on the biters, not the true threat.

In short, what is the biggest threat very much depends on setup parameters and it is very hard to come up with a "one-size-fits-all" strategy.
What might work is to support some turret-AI-profiles, which the user or the mod can select.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: Target prioritising of turrets

Post by Boogieman14 »

Well, there already is some intelligence built into turrets in that it seems they don't fire any more than is required to kill the target (with a distant enemy, they'll stop firing well before the target actually dies, while the last projectiles are still in flight). That appears to be communicated to neighbouring turrets too. So provided each turret could pick a different target in that big, weak swarm, that should still be ok. Then again, if a mod adds that kind of swarms, it would in my opinion also be responsible for providing the means to deal with those swarms (ie: flamethrowers :twisted: ).

But yeah, I'll agree the correct approach requires some more thought. Perhaps turrets could have a selectable firing profile. Or different turret types could have different profiles. Perhaps there could be a globally applicable list where you define target priorities manually (so you could order those swarm type mobs below their spawner, but all other moving enemies above all spawners)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Target prioritising of turrets

Post by ssilk »

I can see the following (and that is taken from the tower defense games I know):

- A turrets fire to the biggest target (that with the most HP) in range.
- A turret fires to the weakest target (lowest HP) in range.
- A turret fires to a target, that is possibly not targeted by another turret.
- A turret fires to targets, which are over 50% of their max HP.
- A turret fires to targets, which are under 50% of their max HP.
...

... more possibilities of course. I think option 3 is CPU expensive and it is also a bit complicated to find the HP's of all targets.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Target prioritising of turrets

Post by orzelek »

Having only first two and current mode (which I think is the nearest enemy) would be a big improvement.

DaemosDaen
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat May 16, 2015 4:39 am
Contact:

Re: Target prioritising of turrets

Post by DaemosDaen »

If your only having the issue when using Bob's mods, then you may want to be protecting your sniper turrets with normal (or upgraded) gun turrets kept out of range of spawner your are having issues with. (this tactic also work with vanilla turret creep.)

I personally like having dumb turrets, something unnerves me when the machines get too smart.

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Target prioritising of turrets

Post by bobucles »

Bob's turrets, huh? A full line of sniper turrets is totally impenetrable. With enough turrets prioritization is pointless.

Turrets are already smart enough to use the proper number of shots and not waste overkill.

Kane
Filter Inserter
Filter Inserter
Posts: 666
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: Target prioritising of turrets

Post by Kane »

bobucles wrote:Bob's turrets, huh? A full line of sniper turrets is totally impenetrable. With enough turrets prioritization is pointless.

Turrets are already smart enough to use the proper number of shots and not waste overkill.
But Bob! Jimmy Said Else! So Jimmy is Right!

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Target prioritising of turrets

Post by Ranakastrasz »

Main thing I would want is for modded sniper-type turrets to be able to prioritize targets with armor that their damage is able to largely bypass compared to allied turrets, and not open fire on weak enemies that other turrets can kill, setting off a cooldown and wasting somewhat more expensive ammunition.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Target prioritising of turrets

Post by bobingabout »

i think the default should be to attack whatever has the least health. being able to select other logics (Probably definied in the data definitions, so you can't change it in game) such as most health etc would be good too.

Whatever comes into range first is okay on smaller things, but with those behemoth biters, they can take so long to die that all those big biters have eaten your wall and are chewing away at your turrets by the time the behemoth finally falls.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Target prioritising of turrets

Post by bobucles »

A good targeting algorithm is all about reducing the enemy's DPS as quickly as possible. Target priority is about taking down the glass cannons first, then the regulars, then the weak tanky types. Then you have to worry about maximizing AoE damage against enemy clusters, properly calculating enemy damage potential when enemy AoEs/DoTs/debuffs are involved, and taking armor types into account to assure best output.

Or you could just like not be a cheapo and build more turrets man. Quantity has a quality all its own.

User avatar
Nova
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Mar 04, 2013 12:13 am
Contact:

Re: Target prioritising of turrets

Post by Nova »

To be honest, I think the turrets should not be too clever. All we should have is:
- A turret attacks the "most threatening" enemy.
- A turret doesn't change the attacked enemy until it's dead or not in range anymore.

"most threatening" is more or less easy to define. If we stay with biters and spitters only (and I hope we don't do that) than we should say "All big, then all middle, then all small" units. Don't know if spitters or biters are worse, you decide.
Greetings, Nova.
Factorio is one of the greatest games I ever played, with one of the best developers I ever heard of.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Target prioritising of turrets

Post by bobingabout »

Biters increase in difficulty exponentially, where spitters increase linearly, so a small spitter deals more damage than a small biter, but a big biter deals more damage than a bit spitter. But Spitters have less health, as a trade off for an attack range.

As for your mentioned behaviours, shoot until dead, or out of range, that's how it works already, it just doesn't have a threat rating system, so it shoots at whatever comes into range first.
when it dies there and there's already lots in range already, I don't know how it decides. I have 3 possible guesses, there could be whatever is closest, whatever is scanned first on the global list as being in range, in which case it's whichever enemy spawned first, or whichever is scanned first within the range bounding box (if there is one).
Most likely option B, whichever as spawned first.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Nova
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Mar 04, 2013 12:13 am
Contact:

Re: Target prioritising of turrets

Post by Nova »

Turrets are already quite intelligent: They attack a biter, but only until there are enough shots fired to kill it, even if they didn't reach it yet. If a biter takes 4 shots, a turret will fire 4 times and then attack another biter while the shots fly to the first biter and kill it. That's quite impressive.
Greetings, Nova.
Factorio is one of the greatest games I ever played, with one of the best developers I ever heard of.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Target prioritising of turrets

Post by bobingabout »

Nova wrote:If a biter takes 4 shots, a turret will fire 4 times and then attack another biter while the shots fly to the first biter and kill it. That's quite impressive.
Unfortunately, that logic also has flaws. I've seen people posting complaints in the modding forum where they've modded in say, a shotgun turret, this logic kicks in, but the biter doesn't die, the turret moves onto the next target since it's fired the required shots to kill it, but that biter is then ignored by all other turrets because of that logic.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Target prioritising of turrets

Post by ssilk »

That is only possible, cause every shoot is a hit and it is calculated at the moment, before the gun shots. So it knows exactly if the biter dies now or not. :)

The rest of the "shoot" is drawing the bullets until it hits. Especially with the lasers you can really see - if a biter is fast - that the laser shots in curves, so he can't be missed out. ;)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: Target prioritising of turrets

Post by Supercheese »

bobingabout wrote:Unfortunately, that logic also has flaws. I've seen people posting complaints in the modding forum where they've modded in say, a shotgun turret, this logic kicks in, but the biter doesn't die, the turret moves onto the next target since it's fired the required shots to kill it, but that biter is then ignored by all other turrets because of that logic.
Huh, I've had great success with using Cannon Turrets + Bobwarfare Scatter Cannon Shells as shotgun turrets, but I do always tend to use them in conjunction with other turrets, so that might be why I don't encounter this issue.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Target prioritising of turrets

Post by MeduSalem »

Well... has anyone here ever played the game "Harvest: Massive Encounter"?

For a tower defense game it did a quite nice job in my opinion.

I always wished for Factorio to adopt the diversity of enemies like HME has and eventually to have many different types of turrets to counter them as well which can be set to different priorities like so:

Image

Each turret type has 4 priorites (High, Normal, Low, Ignore) which work on a global scale (every turret of a particular type is affected by the settings). All enemy types could be put to a priority level of your choice by drag&drop.

The game had also an interesting feature which allowed the laser turrets to focus on another laser turret, effectively daisy chaining them, to form an even stronger laser turret with more power and further reach. It's quite funny actually.

I really recommend people (also the Factorio devs) to take a look at that game. It has some interesting features that might actually be worthwhile to be ripped off and I wouldn't blame the devs because if there is one part Factorio definitely needs improvement on it is the variety of enemies, the variety of turrets and combat in general. And to look how other tower defense games do it might be worthwhile the effort in my opinion because trying to defend your factory from neverending hordes of bugs is nothing more than a tower defense game in that aspect as well.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Target prioritising of turrets

Post by ssilk »

I just had a idea: Take that above and add some new circuit sensors that enables us to measure the number of different aliens in range.

Now this: Depending on sensor input and calculations done in the combinators, change the priority of the weapons... that could be really fun to change the target priorities in real-time via circuits.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Target prioritising of turrets

Post by MeduSalem »

ssilk wrote:I just had a idea: Take that above and add some new circuit sensors that enables us to measure the number of different aliens in range.

Now this: Depending on sensor input and calculations done in the combinators, change the priority of the weapons... that could be really fun to change the target priorities in real-time via circuits.
While I like the "Factorio-like" approach with using circuit networks to change priorities etc... I have one concern... Wouldn't it be a nightmare to hook up... lets say 3000 turrets to multiple circuit networks? :roll:

One would have to split the defense into multiple sections along the wall because each sensor would obviously only be covering a limited area and thereby each single sensor could only control the turrets that are actually pointing to the area covered by said sensor. So each sensor and attached turret battery would require its own combinator contraption to do the calculations. Rinse and repeat for the entire perimeter.

It can be handled of course... with blueprints and stuff which would have my approval, but somehow there could be an easier, global way too for people who are not that much into micromanagement.

Right clicking on a turret to open up a window (like Power poles etc) to adjust priorities globally for all turrets seems somewhat easier and would get the job done as well...

Post Reply

Return to “Balancing”