Biter joining-attack mechanics

Post all other topics which do not belong to any other category.
grimdanfango
Inserter
Inserter
Posts: 40
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Biter joining-attack mechanics

Post by grimdanfango »

I'm trying to get a better understanding of exactly how the game builds attack-groups, so I can tweak a mod I'm trying to make.

I understand what's written on the wiki's Enemies and Pollution pages, but a couple of points don't seem entirely clear.
  • Do spawners "create" biters specifically to add to attack groups, in addition to the local passive group that hangs around them? Or is their only task to generate that local passive group, and as they absorb the required pollution, tell already-existing individuals to go off and join an attack, and subsequently replace them with newly generated passive biters?
  • The part that mentions "With 1350 absorbed pollution at the time of attack the following wave consists of 6 small biters and 1 medium biter..." (emphasis mine)
    - I take that to mean that the numbers of small/medium/large/behemoth are independantly tracked? So if a particular spawner has totaled up 1000 pollution, it will have "spent" that on 5 small, but still have it available to spend on 1 medium?
  • Probably linked to the first point - if biters are selected from the available group, and the evolution level has moved past the point where small biters get spawned, according to the probability table, then do small biters stop getting added to attack groups entirely? If so, that would seem slightly at-odds with the previous point, as if there's a separately tracked "budget" for each class, then the small-biter-budget would end up effectively going to waste after a certain level of evolution... you'd just end up at a point where instead of 5 small biters, you just get 1 medium one, which isn't really much more of a threat
  • I'm assuming that each individual spawner tracks its own unique pollution total (unless that's actually tracked as a total per-chunk or something?).
    Where the attack-group timer is set randomly to 1-10 minutes by default... say a spawner has accrued 390 pollution, and spends 200 of that to send a single small biter to join the attack... after that attack-group leaves, would I be right in thinking that the spawner will retain the 190 it had left, rather than resetting to zero, and add another small biter to a new attack-group once it's accrued an additional 10?
I've searched around to see if there are already posts that go into these details, but I can't find anything. It'd be great to have dev input on the matter!
grimdanfango
Inserter
Inserter
Posts: 40
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Re: Biter joining-attack mechanics

Post by grimdanfango »

Hehe... anyone?

Surely it's not *that* much black magic? :)
User avatar
Lav
Filter Inserter
Filter Inserter
Posts: 384
Joined: Mon Mar 27, 2017 10:12 am
Contact:

Re: Biter joining-attack mechanics

Post by Lav »

This is a small hive (only a single spawner) which is getting pollution from across the sea. Biters cannot path, but they still get ready for attack.
Forces of Evil Mustering
As you can see, there's plenty of them, much more than a single spawner hive will normally maintain. Also most of the attacking group is higher tiers, while there's still plenty of basic biters milling around. This makes me think that biters are indeed spawned specifically for the attack, instead of being picked from the already existing group.
grimdanfango
Inserter
Inserter
Posts: 40
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Re: Biter joining-attack mechanics

Post by grimdanfango »

Neat, thanks for that! That's actually not a bad idea for a way to set up an observable test... create an isolated island with a single spawner, and a test factory to pump out some fumes, switch into god-mode and observe what appears to be happening over time. I might give that a try at some point.

It does at the very least appear that the information on the wiki is somewhat wide of the mark at this stage. Even the probability tables are out - I've definitely seen medium biters appear around 0.25 evolution, despite the tables saying they shouldn't turn up until after 0.3, and after the first spitters at 0.25

It would really be useful to have some dev insight into what the latest mechanics actually are in 0.15... it's very difficult to make meaningful tweaks to a system that there's no current information on. Now we've got map preset settings to easily play about with the pollution spread settings, it'd be really good to have some insight into what precise effects pollution is actually having.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Biter joining-attack mechanics

Post by Oxyd »

grimdanfango wrote:Do spawners "create" biters specifically to add to attack groups, in addition to the local passive group that hangs around them? Or is their only task to generate that local passive group, and as they absorb the required pollution, tell already-existing individuals to go off and join an attack, and subsequently replace them with newly generated passive biters?
Spawning new units and sending them to attack are pretty much two independent things. Spawners spawn pretty much all the time they're inside the pollution cloud. Each spawner has a spawning cooldown and a unit is spawned when the cooldown goes below zero. After spawning, it's reset to a value that depends on the current evolution factor (see spawning_cooldown in spawner prototype) and the spawned unit's spawning_time_modifier. There is also a cap on the number of units that can be attached to a spawner. If a spawner is maxxed out, it won't spawn any more units. The cap is just a simple count of all attached units, it doesn't care whether it's small or big biters.

Each spawner randomly selects a unit to send to attack. The spawner absorbs pollution until it's absorbed more than the selected unit's pollution_to_join_attack. Once the spawner has absorbed that amount of pollution, it sends the unit away – that unlinks it from the spawner and therefore from the cap mentioned above. After sending it away, it simply subtracts pollution_to_join_attack from its counter of absorbed pollution.

Now, “sending a unit for attack” means that the game checks whether there are any gathering groups nearby. If there are, it adds the unit the unit group. If there is no suitable unit group nearby, the game creates a new unit group somewhere near the unit and adds the unit to it. Unit groups get a timer when they're created and they just sit around waiting for members to join them. When the timer runs down, the group selects a target and off it goes.
grimdanfango wrote:The part that mentions "With 1350 absorbed pollution at the time of attack the following wave consists of 6 small biters and 1 medium biter..." (emphasis mine)
- I take that to mean that the numbers of small/medium/large/behemoth are independantly tracked? So if a particular spawner has totaled up 1000 pollution, it will have "spent" that on 5 small, but still have it available to spend on 1 medium?
No, it doesn't track units independently.
grimdanfango wrote:Probably linked to the first point - if biters are selected from the available group, and the evolution level has moved past the point where small biters get spawned, according to the probability table, then do small biters stop getting added to attack groups entirely? If so, that would seem slightly at-odds with the previous point, as if there's a separately tracked "budget" for each class, then the small-biter-budget would end up effectively going to waste after a certain level of evolution... you'd just end up at a point where instead of 5 small biters, you just get 1 medium one, which isn't really much more of a threat
No, the spawning probability table really just affects spawning probabilities. Once a unit is spawned, it's just like any other unit.
Lav wrote:This is a small hive (only a single spawner) which is getting pollution from across the sea. Biters cannot path, but they still get ready for attack.
Forces of Evil Mustering
As you can see, there's plenty of them, much more than a single spawner hive will normally maintain. Also most of the attacking group is higher tiers, while there's still plenty of basic biters milling around. This makes me think that biters are indeed spawned specifically for the attack, instead of being picked from the already existing group.
Those aren't getting ready to attack. Sometimes, an attack group won't find a path (or a target or some other reason it can't go). In that case, the group is dissolved. Then you're left with a bunch of biters that are just out there, not a part of any unit group and not attached to a spawner. These biters then search for spawners near them and link themselves to it. When a unit links itself to a spawner like that, it goes to it and when it gets near enough it just hangs around. What happens in that screenshot is that the unit gets deactivated once it gets in the correct range, so they form that semi-circle you see.

Units that link themselves to a spawner like that do count toward the spawning cap – this way it's possible for a spawner to have many more units than its cap. But it won't spawn any new ones, obviously. :)
grimdanfango
Inserter
Inserter
Posts: 40
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Re: Biter joining-attack mechanics

Post by grimdanfango »

Oxyd wrote:-snip-
Much appreciated Oxyd, that clears the whole thing up perfectly for my purposes. It's actually a lot more straightforward than the wiki info seems to suggest.

You guys are awesome!

Grats on the million sales by the way. Well deserved.
HurkWurk
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Nov 14, 2016 4:55 pm
Contact:

Re: Biter joining-attack mechanics

Post by HurkWurk »

is it sad that im so used to games with devs that never post that when Oxyd posted, im just sitting here thinking, "darn that guy has really dug into the game!". it didnt even cross my mind to check if it was a dev post.
the other sad part is that i was able to follow what hes talking about because ive dug that far into the game for other items :?
Post Reply

Return to “General discussion”