Page 1 of 2

Re: Target prioritising of turrets

Posted: Mon Sep 28, 2015 4:27 pm
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.

Re: Target prioritising of turrets

Posted: Thu Mar 03, 2016 5:13 am
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.

Re: Target prioritising of turrets

Posted: Thu Mar 03, 2016 11:29 am
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.

Re: Target prioritising of turrets

Posted: Thu Mar 03, 2016 5:04 pm
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.

Re: Target prioritising of turrets

Posted: Fri Mar 04, 2016 12:27 am
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.

Re: Target prioritising of turrets

Posted: Fri Mar 04, 2016 12:59 am
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. ;)

Re: Target prioritising of turrets

Posted: Fri Mar 04, 2016 1:02 am
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.

Re: Target prioritising of turrets

Posted: Sat Mar 05, 2016 8:03 pm
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.

Re: Target prioritising of turrets

Posted: Sun Mar 06, 2016 3:39 am
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.

Re: Target prioritising of turrets

Posted: Sun Mar 06, 2016 5:55 am
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...

Re: Target prioritising of turrets

Posted: Mon Mar 07, 2016 4:43 am
by ssilk
Hm.

We are here at the same question as with the priorities for the electricity (accus have lowest priority, laser have highest), which was often been suggested - and also by some global changeable slider...
Despite from the fact, that it wouldn't bring anything good for the handling of the electricity (and I think also for the handling of this), I think this is really not a way we should think of.

Cause - and I think that is something important - how should that change be transmitted? How will the information come from that global configuration screen into the turret? I mean: Other games do that of course. Cause it is possible, it's a computer program. Everything is possible. :)
We are so used to that form of "magic global changing spreads throughout the game-world", that nobody cares. But for Factory I think this way should not be walked!

Cause if such a global changeable GUI really would exists I would say: Where are the radio stations to transmit that signal to the turrets.

Well. And here we have closed the circle: The answer to hook up that nightmare of 3000 lasers or more, is not to plug it into a circuit network, but to connect it to some wireless signal. And - as you might have read - that might come with 0.13. https://www.factorio.com/blog/post/fff-123

So that is in my opinion the way to do it right. If needed. What I doubt. :)

Re: Target prioritising of turrets

Posted: Mon Mar 07, 2016 11:52 am
by MeduSalem
ssilk wrote:We are here at the same question as with the priorities for the electricity (accus have lowest priority, laser have highest), which was often been suggested - and also by some global changeable slider...
Despite from the fact, that it wouldn't bring anything good for the handling of the electricity (and I think also for the handling of this), I think this is really not a way we should think of.
Well... I guess for electricity it wouldn't work anyways because the reason people would like to change priority of power production/consumption is basically to shut down the Steam Engines if they don't need them. Which would basically require to adjust the priority on-the-fly, so a "global" one-time adjustment of priorities probably wouldn't be able to deal with the problem.

But yeah, the upcoming power switch will probably eliminate the problem anyways...

ssilk wrote:Cause - and I think that is something important - how should that change be transmitted? How will the information come from that global configuration screen into the turret? I mean: Other games do that of course. Cause it is possible, it's a computer program. Everything is possible. :)
We are so used to that form of "magic global changing spreads throughout the game-world", that nobody cares. But for Factory I think this way should not be walked!

Cause if such a global changeable GUI really would exists I would say: Where are the radio stations to transmit that signal to the turrets.
Well with that attitude one could ask:
  1. How do the Gun Turrets detect any enemies and rotate the guns in the right direction when they don't even require a little amount of energy for their targeting systems?
  2. How do splitters work when they don't require energy?
  3. How do belts work when they don't require energy?
  4. How do accumulators/laser turrets don't deteriorate slowly over time due to continuous charge/discharge?
  5. The list goes on and on...
Space Magic? Probably.

But truth is some of the systems have been implemented exactly the way they are for the sake of convenience. No matter how much some of us might dislike it, including myself.

Though I could provide simple solutions even for the above examples which would satisfy the need for realism and still be interesting to play with, rather than tedious:
  1. Make gun turrets require electricity (just a little bit to power their motors and detectors and to push the trigger, not anywhere near as much as laser turrets - don't worry)
  2. Make the splitters require electricity as well.
  3. Make belts require a "belt-control item" you plop down somewhere along a belt that is either powered with fuel (early stages) or electricy (later on, which can be equipped with modules to increase belt speed, rendering fast/express belts superfluous, and which could also be used to access the current contents of the entire connected belt with circuit logic)
  4. Make accumulators/laser turrets require swapping of eventually deteriorated batteries to maintain performance of the energy storage
And I would have even more concepts like these on the backburner, some of which nobody else has ever proposed on the forum, but what are they good for if the playerbase and the dev-team decided "nope, not going to happen because convenience takes priority over realism" on some of the topics a long time ago, pretty much sealing the coffin for them when it comes to improvements/additions/changes?

ssilk wrote:Well. And here we have closed the circle: The answer to hook up that nightmare of 3000 lasers or more, is not to plug it into a circuit network, but to connect it to some wireless signal. And - as you might have read - that might come with 0.13. https://www.factorio.com/blog/post/fff-123
Using wireless signals wouldn't really reduce the amount of combinator contraptions, because even with wireless signals you would have to segment the perimeter into sections covered by individual sensors with turret batteries attached to them, and each section needs to be controlled with its own individual combinator contraption. So if you output the combinator contraption's signal with wireless signal to the turret battery or with a circuit network wire doesn't matter thaaat much anymore.

It would only be a matter of taste if you would like to have all the Priority-Control contraptions "centralized" somewhere on the map... then you use wireless signals. But if you prefer to have the Controller decentralized, located behind each individual section then you could go with wires as well.

So at least I wouldn't see any way to make the priority system any easier. I might be able to live with that way, but that doesn't mean everyone would be able to live with it.

ssilk wrote:So that is in my opinion the way to do it right. If needed. What I doubt. :)
Well currently it is not really needed because there is no diversity in enemies or turrets for that matter. From mid to late game defense is nothing but a bagatelle currently. Just enclose your base with walls and a line of laser turrets and be done with it. Only difficulty about it being to get that far, that's all. :roll:

Re: Target prioritising of turrets

Posted: Fri Mar 11, 2016 4:54 pm
by Lallante
This isnt a balancing issue - its the downside of using turret creep to kill biter spawns (which IMO should be made much harder anyway)

Re: Target prioritising of turrets

Posted: Mon Mar 28, 2016 3:43 am
by Requia
I like the choosing priorities option, because while other people are talking about going biggest first, my though is spitters first. Walls are a lot harder to destroy than turrets and cheaper to replace, but spitters can ignore them if the turret is in range. Once big spitters start showing it becomes enough of a problem that rather a lot of turrets are needed atm to ensure they die before the first turret does.