Player position affects biter attacks

Post all other topics which do not belong to any other category.
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Player position affects biter attacks

Post by SteelGiant »

Now, I have seen the fact that biters seem to attack more around where the player is mentioned on the forums, and I had felt it was the case myself, but I also seem to recall seeing the devs say that this was not the case. I don't just mean biters chasing the player, but being well outside aggro range triggering more aggressive attacks on parts of the base the player is in. If this is actually a known, obvious and intended thing, then I've wasted some time, but if not then this could be interesting.

I decided to do an investigation into this phenomenon in order to determine if I and others were just crazy. I have tried to be as scientific as possible here. I'll give a short description of the tests I performed, and then present the full methods and data afterwards. I hope, that by setting out exactly what I did and how I did it, the transparency will allow anyone else to perform the same test and confirm my results, or suggest improvements to the methodology (just like actual SCIENCE!).

My setup was to create a custom map which was exactly symmetrical, consisting of two identical outposts at opposite ends of the map containing mining drills (to attract biters) and laser turrets (to kill the biters). Each outpost had an identical biter base next to it, from which it would suffer regular attacks. The intensity of attacks is measured by observing the amount of power drained from that outpost's accumulator banks, each biter killed taking approximately the same number of shots and thus the same energy drain.

The test was to position the player either in the left outpost, the right outpost or leave them in the centre, and measure the remaining energy in each outposts accumulators after 30 minutes in game. I did 16 trials, 4 in the centre, 6 at the left outpost and 6 at the right outpost. The trials at each outpost each had 2 replicates standing just inside the closed gates, on the gates and just outside the closed gates. In all situations the player was at least 3 chunks from the biters, with the bases only just coming on screen at maximum zoom out.

Left outpost setup:
Image

Results:

The short answer is that it makes a massive difference. The player being located near a base increased the number of attacking biters by a factor of 3 (approximately). The player being in the centre caused neither base to suffer particularly strong attacks.

The statistical analysis shows that this result cannot be a fluke.


Raw Data:

This table shows the position of the player (L = left outpost / R = right outpost / C = centre) and the energy remaining (in MJ, out of a max possible 500MJ) in each outpost's capacitor network after 30 minutes.

Code: Select all

Position EnergyL EnergyR
L        321     443	
R        392     141
C        439     440
C        439     439
L        294     409
R        444     136
L        398     451
R        371      93
C        439     440
C        439     440
L        420     403
R        449     229
L        357     462
R        426      77
L        363     421
R        443      72
Graphical representation of the data:
The symbol (L/R/C represents what the player position was, and the x and y values are the remaining energy in each base for that single trial. From this picture it is clear what the statistical analysis will show: if the player position had no effect, then all the results should be clustered together, and have the same values as the C's (but they certainly don't). Note: The variance on the Centre trial is very low, so all the C's are basically on top of one another.

Image


Statistical analysis:

I performed a pair of one way ANOVA tests on the data.

Energy remaining in Left outpost accumulators:
Image

Code: Select all

            Df Sum Sq Mean Sq F value  Pr(>F)   
Position     2  18784    9392   7.587 0.00656 **
Residuals   13  16094    1238     


Energy remaining in Right outpost accumulators:
Image

Code: Select all

            Df Sum Sq Mean Sq F value   Pr(>F)    
Position     2 360848  180424   116.1 5.11e-09 ***
Residuals   13  20202    1554                     
the P-values we see here are very significant, there is only a tiny (0.6% or 0.0000005% chance for Left and Right energies, respectively) chance of getting this result by chance: Player position has some effect.

I then performed a Tukey's Honest significant differences test to establish what effect player position has:

For Left energy:

Code: Select all

         diff         lwr       upr     p adj
L-C -80.16667 -140.135560 -20.19777 0.0096332
R-C -18.16667  -78.135560  41.80223 0.7096269
R-L  62.00000    8.362191 115.63781 0.0234878
For Right energy:

Code: Select all

         diff        lwr        upr    p adj
L-C   -8.2500  -75.43793   58.93793 0.943949
R-C -315.0833 -382.27126 -247.89541 0.000000
R-L -306.8333 -366.92804 -246.73863 0.000000
which showed that again there was a very significant difference, specifically: if you go left, the left base suffers more attacks, go right and the right base suffers more attacks, and stay in the middle and neither base suffers more attacks.Additionally, going right does not make things worse or better for the left base, and vice versa.

A multivariate-ANOVA might be appropriate, but I don't think it is necessary.

Conclusions:

It is impossibly unlikely that biter attacks are independent of player position.

Have I just wasted my time here? Would anyone like to repeat my experiment? Did anyone even read through this?

I'm happy to answer any questions anyone has about the methods or results, so please ask if there is something unclear.

Full details:

The energy in the accumulators is provided by independent bank of steam engines for each outpost, which have boilers containing 1GJ of fuel, thus providing 500MJ, exactly enough to fill the 100 accumulators in the outpost. There is also a single steam engine with unlimited fuel (at least 90 minutes worth) which provides a base output (510kW) exactly equivalent to the drain of the 85 laser turrets in the outpost. Without attack, the energy stored for each base remains constant after the few minutes it takes the main generators to exhaust their fuel supply.

The two electricity networks are certainly separate, but I brought power lines from both networks to the gates of both bases so I could check the energy levels in both simultaneously.

Comments:

I did note that when I originally had actual walls (as opposed to the destroyed walls it now starts with) as distance markers the biters would attack a couple of the walls when the map started, but then not do anything to them thereafter. If I walked to an outpost, however, then as soon as I could see the walls nearest their bases the biters would start attacking them. This is perhaps an easier test than what I actually did, but harder to statistically analyse...

I used laser turrets and energy as opposed to gun turrets so that I could look into each network at the same time. I suppose I could have used logistic network and gun turrets and been able to do the same thing if the main ammo stores were in logistic chests.

Deficiencies:

The map is not actually perfectly symmetric, as I didn't check chunk boundaries when making it. The miners in the right base are half a chunk closer to the biter bases, which would explain why that base suffers stronger attacks.

The Centre player position runs are very consistent in terms of energy use. This may be because they suffer the fewest attacks, or it might be due to the deterministic nature of the game meaning the very minimal player input leads to very small divergence over the 30 minutes between trials. I'm not sure exactly what is going on as I didn't look at energy use over time, just the total used, and obviously from the centre I can't see the bases properly. I did record use every 60 seconds for two runs, but after that soul destroying exercise I just watched TV and recorded after 30 mins. It might be possible to use the warning icons to judge this, but again it requires actually sitting through it all.

The mini-map and the full map don't work properly, and you can't see terrain outside of the starting chunk or biters. This is probably because in the editor I made the map 1 by 1 tiles originally, then expanded it out in the editor with a big brush, so presumably as far as the map is concerned all that space doesn't exist.
Attachments
AttackTest.zip
(almost) symmetric test map used
(120.75 KiB) Downloaded 192 times
User avatar
Khyron
Fast Inserter
Fast Inserter
Posts: 178
Joined: Fri May 30, 2014 5:47 pm
Contact:

Re: Player position affects biter attacks

Post by Khyron »

Overkill much? haha. Ok, I'll admit this is interesting and no, I didn't know about this bias. I can't say knowing this will impact my play style either way. Having said that, yes, I read your post :) and only a couple of questions jump out at me:
  1. In the Full Results graph, why are the L results clustered in the top right instead of the top left?
  2. Which base was built first and how much game time elapsed between the bases being built? I get that the test was conducted over a 30 min period after both bases were constructed, but just wondering about the testing methodology if building one base before the other could introduce a bias.
  3. What was the evolutionfactor at the beginning of the test (and at the end)?
I can read a graph but I'm not going to check your math, repeat the experiment or pretend I know what an ANOVA test is. :p
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

Khyron wrote:Overkill much? haha. Ok, I'll admit this is interesting and no, I didn't know about this bias. I can't say knowing this will impact my play style either way. Having said that, yes, I read your post :) and only a couple of questions jump out at me:
  1. In the Full Results graph, why are the L results clustered in the top right instead of the top left?
  2. Which base was built first and how much game time elapsed between the bases being built? I get that the test was conducted over a 30 min period after both bases were constructed, but just wondering about the testing methodology if building one base before the other could introduce a bias.
  3. What was the evolutionfactor at the beginning of the test (and at the end)?
I can read a graph but I'm not going to check your math, repeat the experiment or pretend I know what an ANOVA test is. :p
Hooray someone cares!

Good questions, I'll try and give satisfactory answers.

Your first question is an interesting one. Results for the left outpost not being as extreme as the results for the right outpost is due, I believe, to a slight asymmetry in the map. While both outposts are equally far from the biter bases (40 tiles from the nearest spawned to the outer walls) the right outpost has half it's drills across a chunk boundary. my understanding is that pollution spreads and dissipates on a per chunk basis, not per tile. This means the right bases are exposed to more pollution, driving the biters to attack harder. I could redo the map to fix this, but it is not necessary: although the severe attacks are not of the same intensity, whether or not a base suffers severe attacks is what I'm interested in, and we clearly see that player position influences that.

Your next two questions I think are answered by the fact that this test was performed on a custom map. So, both outposts were fully constructed at the beginning of time. Additionally, this means biter evolution started at 0. The final value is unknown, but probably not very high as I never saw any medium biters massing to attack after the 30 minutes walk done. Both biter bases were identical and made of a line of 5 biter spawners, again placed in the editor.
NotABiter
Fast Inserter
Fast Inserter
Posts: 124
Joined: Fri Nov 14, 2014 9:05 am
Contact:

Re: Player position affects biter attacks

Post by NotABiter »

SteelGiant wrote:The map is not actually perfectly symmetric, as I didn't check chunk boundaries when making it. The miners in the right base are half a chunk closer to the biter bases, which would explain why that base suffers stronger attacks.
I think you should correct this error and rerun all of the tests to confirm. :lol:

Anyways, I'm guessing this effect has been fairly obvious to most people who have played the game for any amount of time with non-peaceful biters. And I've seen it mentioned here with regard to what happens when you build rocket defense. (I.e., if you have a large base, to avoid any biter attacks at all just stand right in the middle of your base so you're quite far from any spawners.)

Personally I find the current biter behavior to be fairly silly. (What you describe here, plus the way spawners magically make wave after wave of new biters when you are near them.) Hopefully it gets fixed in 0.12. (I'd like to see some smarter biters. Give them some behaviors and capabilities that make having and defending outposts, rails and "exterior" power poles a good idea rather than the way things are now where "one big base" tends to be optimal.)
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

NotABiter wrote:
SteelGiant wrote:The map is not actually perfectly symmetric, as I didn't check chunk boundaries when making it. The miners in the right base are half a chunk closer to the biter bases, which would explain why that base suffers stronger attacks.
I think you should correct this error and rerun all of the tests to confirm. :lol:

Anyways, I'm guessing this effect has been fairly obvious to most people who have played the game for any amount of time with non-peaceful biters. And I've seen it mentioned here with regard to what happens when you build rocket defense. (I.e., if you have a large base, to avoid any biter attacks at all just stand right in the middle of your base so you're quite far from any spawners.)

Personally I find the current biter behavior to be fairly silly. (What you describe here, plus the way spawners magically make wave after wave of new biters when you are near them.) Hopefully it gets fixed in 0.12. (I'd like to see some smarter biters. Give them some behaviors and capabilities that make having and defending outposts, rails and "exterior" power poles a good idea rather than the way things are now where "one big base" tends to be optimal.)
Yeah remaking the map and rerunning the tests isn't going to happen any time soon :lol:

I find this effect strange, but the stranger thing was I swear I had seen the devs saying on the forums that your exact example of the hiding during rocket defence couldn't work and the effect wasn't real. I couldn't find the relevant quotes, so it could simply be I'm insane, (as evidenced by the testing anyway)
But if someone could find the relevant discussions that would be great.
albatrosv13
Long Handed Inserter
Long Handed Inserter
Posts: 80
Joined: Wed Apr 30, 2014 5:36 pm
Contact:

Re: Player position affects biter attacks

Post by albatrosv13 »

deleted
Last edited by albatrosv13 on Thu May 19, 2016 4:29 pm, edited 1 time in total.
User avatar
Khyron
Fast Inserter
Fast Inserter
Posts: 178
Joined: Fri May 30, 2014 5:47 pm
Contact:

Re: Player position affects biter attacks

Post by Khyron »

SteelGiant wrote:Your first question is an interesting one. Results for the left outpost not being as extreme as the results for the right outpost is due, I believe, to a slight asymmetry in the map. While both outposts are equally far from the biter bases (40 tiles from the nearest spawned to the outer walls) the right outpost has half it's drills across a chunk boundary. my understanding is that pollution spreads and dissipates on a per chunk basis, not per tile. This means the right bases are exposed to more pollution, driving the biters to attack harder. I could redo the map to fix this, but it is not necessary: although the severe attacks are not of the same intensity, whether or not a base suffers severe attacks is what I'm interested in, and we clearly see that player position influences that.
Makes sense. Yep, pollution is per chunk. Watch pollution on the map and you see it flicker-fill an entire chunk as it spills outwards.
SteelGiant wrote:Your next two questions I think are answered by the fact that this test was performed on a custom map. So, both outposts were fully constructed at the beginning of time. Additionally, this means biter evolution started at 0. The final value is unknown, but probably not very high as I never saw any medium biters massing to attack after the 30 minutes walk done. Both biter bases were identical and made of a line of 5 biter spawners, again placed in the editor.
That makes sense too. I haven't played around with custom maps so I didn't consider how you might have started with structures on the map.

The reason I asked about the evolution factor is I've noticed some nests have only small biters even when the evolution factor is high. I can't remember exactly what causes it, it's something like either when a chunk is first explorered/generated or when a nest has not been agitated of the player yet (eg: revealed by radar, untouched by pollution, player has not triggered guards). I think that can be ruled out due to the way you set up the test.

Are the biters attacking the bases in response to pollution? Or is it because they occasionally wander near enough to the base that they attack? You can differentiate by observing the guards - if they stay at the nest, attacks are in response to pollution. If they attack, its because of proximity. 40 tiles is close enough that I couldn't guess and would have to check.
NotABiter
Fast Inserter
Fast Inserter
Posts: 124
Joined: Fri Nov 14, 2014 9:05 am
Contact:

Re: Player position affects biter attacks

Post by NotABiter »

SteelGiant wrote:I find this effect strange, but the stranger thing was I swear I had seen the devs saying on the forums that your exact example of the hiding during rocket defence couldn't work and the effect wasn't real. I couldn't find the relevant quotes
I don't know of the dev quotes you speak of, but I found these:

There has to be spawners near rocket defense, or no attacks.
Ditto.
Even a mod was unable to change that.

And if memory serves I saw a video where someone had rocket defense going and there were no attacks... unless they walked near the edge of their base, in which case they got attacks in that area only. (But my memory is not to be trusted.)

And the one time I actually activated rocket defense I had no attacks (again, going by that memory thing), and me and my rocket defense where deep in my base.

On the topic of biter smarts: It was noted here that somehow biters are smart enough to recognize rocket defense as a threat, so they are currently inconsistent in their dumbness/smartness. (I'd like them super smart. They should analyze a base for weaknesses, find paths that have the least walls and guns in the way, and attack the points where they can do the most costly damage to your base. {You better guard that chest full of level 3 modules you're saving up for rocket defense!} Maybe "biter smarts" could be a scenario-knob like the current resource and biter settings are so I can play with it all the way up while people who like dumb biters can keep their dumb biters.)
Gravitas
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun May 18, 2014 5:45 pm
Contact:

Re: Player position affects biter attacks

Post by Gravitas »

Nice test, I'll show it to my stats class that I'm teaching.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Player position affects biter attacks

Post by cube »

Nice post!

Here are some problems I see with it (some of these have already been mentioned):

1) The chunk thing. Pollution spreads per chunk and if the setup is symmetrical on tiles level, but not on chunks level this could cause problems

2) Physics in Factorio is not isotropic. Stuff generally happens from west to east and from north to south, with various consequences (try measuring exact liquid flows in different directions :-) )

3) From what I remember from school tests like the ones you used generally expect random variables to be independent, right? Doesn't engine determinism break the assumption too much?

1) and 2) could be limited by repeating the experiments in all symmetrical variants ... But 4 rotations * 2 flips * 3 player positions ... that is a lot of work :-)
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

cube wrote:Nice post!
Thanks very much! Factorio is a great game, and I'm really looking forward to all the things you guys are working on. I searched through like 700 posts from kovarex (and my god I now appreciate even more the number of bugfixes you guys have to go through!) looking for what I recalled he had said about player position not making a difference to things, but I couldn't find it. It would be great if you guys could confirm if this effect is supposed to be there, or if I have hallucinated the whole thing.
cube wrote: Here are some problems I see with it (some of these have already been mentioned):

1) The chunk thing. Pollution spreads per chunk and if the setup is symmetrical on tiles level, but not on chunks level this could cause problems
Yep, I agree that this has affected the results, the right outpost being the same tile distance, but half a chunk closer to the spawners does appear to have a large effect on the magnitude of the biter attacks. However, the results indicate that biters do not actually perform concerted attacks on the outposts unless the player is nearby. I'm not too concerned by this asymmetry, as obviously a real base would not be perfectly symmetric, and we already know more pollution means more attacks; the important effect to examine was player position, and I think that effect clearly shows through.
cube wrote: 2) Physics in Factorio is not isotropic. Stuff generally happens from west to east and from north to south, with various consequences (try measuring exact liquid flows in different directions :-) )
I don't think this has had a significant effect on the test. The pollution would spread differently, again leading to a difference in the behaviour of the two bases, but the effect of player position can still be seen.
cube wrote: 3) From what I remember from school tests like the ones you used generally expect random variables to be independent, right? Doesn't engine determinism break the assumption too much?
Now this one is a major potential problem. I think the determinism of the game has indeed had an effect on the trials where the player is left in the centre. The variance in energy usage there is much much lower than in the variance of the energy usage of the outpost the player is not at when the player is placed at the left or right side. Looking at the analysis without the control the result is still highly significant differences in distributions. I do have two 60 second sampled time series of energy use, which shows that for those two trial the timing of attacks was quite different, so the simulation is diverging quickly enough when the player is at a base despite no significant player intervention.

I could presumably force a much faster divergence by spawning the player with a small biter next to them and then running around for a randomly determined length of time at the start of each trial, which should be enough to absolutely guarantee that the biter AI behaviour had diverged?
cube wrote: 1) and 2) could be limited by repeating the experiments in all symmetrical variants ... But 4 rotations * 2 flips * 3 player positions ... that is a lot of work :-)
Yeah, I'm not toooooo keen to do the whole analysis again with even more symmetries... I'm not sure it is entirely necessary though, as I had both the left and right outposts existing at the same time in the same map.

Thanks for the feedback!
tjmonk15
Inserter
Inserter
Posts: 26
Joined: Fri Jun 20, 2014 9:23 pm
Contact:

Re: Player position affects biter attacks

Post by tjmonk15 »

Just thought I should point out a potential "reason" or answer to this from the game's programming point of view. (In general game programming, not this one specifically.)

But, it is likely that the farther an entity is from the player, this slower it "ticks" or "thinks". This would obviously be to help keep your PC from overheating and/or exploding while playing on an infinite map! Lol.

Taking this into account, I think the devs would be correct in saying that biter behavior is not affected by player position..... directly. Indirectly however, this would mean that biters closer to the player would inherently be more active.

I think this could lead to the results you observed. Add in that another limit the devs might have put in that only some many biters tick per update, and the fact the updates likely happen from north to south, and west to east, and I think we can also explain the bias/weirdness in your original graph (L being clustered at top right instead of top left)

Just some thoughts after reading his thread, take them with a grain of salt...

- Monk
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

tjmonk15 wrote:Just thought I should point out a potential "reason" or answer to this from the game's programming point of view. (In general game programming, not this one specifically.)

But, it is likely that the farther an entity is from the player, this slower it "ticks" or "thinks". This would obviously be to help keep your PC from overheating and/or exploding while playing on an infinite map! Lol.

Taking this into account, I think the devs would be correct in saying that biter behavior is not affected by player position..... directly. Indirectly however, this would mean that biters closer to the player would inherently be more active.

I think this could lead to the results you observed. Add in that another limit the devs might have put in that only some many biters tick per update, and the fact the updates likely happen from north to south, and west to east, and I think we can also explain the bias/weirdness in your original graph (L being clustered at top right instead of top left)

Just some thoughts after reading his thread, take them with a grain of salt...

- Monk
I agree that more updates conducted closer to the player is a potential reason for the observed effect, but we can't really say anything without the devs commenting. I haven't heard them say anything about such a system ever, though.

I really don't think that the order of updates being performed matters, especially as that would favour the left base, which in fact suffers fewer attacks. The difference in outpost attacks is almost certainly due to the fact that half the miners in the right outpost are a chunk closer to the spawners (2 chunks as opposed to 3).

I was hoping that we could get some inside info from one of the devs, or at least ssilk could use his magical search skills to find the relevant quotes that I can't seem to dig up.
lusername
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Mar 31, 2015 4:18 am
Contact:

Re: Player position affects biter attacks

Post by lusername »

tjmonk15 wrote:Just thought I should point out a potential "reason" or answer to this from the game's programming point of view. (In general game programming, not this one specifically.)

But, it is likely that the farther an entity is from the player, this slower it "ticks" or "thinks". This would obviously be to help keep your PC from overheating and/or exploding while playing on an infinite map! Lol.

Taking this into account, I think the devs would be correct in saying that biter behavior is not affected by player position..... directly. Indirectly however, this would mean that biters closer to the player would inherently be more active.
This is basically what happens. You can see it in action if you turn on the "Active Chunks": The vicinity around the player is always more active. If the active chunks contain biter nests, they will spawn biters, while biter nests not in active chunks will go mostly inert. Since the player brings a radius of active chunks with him everywhere he goes, being in an area will appear to provoke biter activity.
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

lusername wrote:
tjmonk15 wrote:Just thought I should point out a potential "reason" or answer to this from the game's programming point of view. (In general game programming, not this one specifically.)

But, it is likely that the farther an entity is from the player, this slower it "ticks" or "thinks". This would obviously be to help keep your PC from overheating and/or exploding while playing on an infinite map! Lol.

Taking this into account, I think the devs would be correct in saying that biter behavior is not affected by player position..... directly. Indirectly however, this would mean that biters closer to the player would inherently be more active.
This is basically what happens. You can see it in action if you turn on the "Active Chunks": The vicinity around the player is always more active. If the active chunks contain biter nests, they will spawn biters, while biter nests not in active chunks will go mostly inert. Since the player brings a radius of active chunks with him everywhere he goes, being in an area will appear to provoke biter activity.
Interesting. This would explain some things, if true. Do people think this is a desirable behaviour?

One thing that struck me as odd was that in my tests if I went to the other biter base, there would be several large groups waiting to attack, but they wouldn't actually be attacking. It seems that both bases were spawning at a similar rate, but only the nearby one was launching regular attacks.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Player position affects biter attacks

Post by Adil »

lusername wrote:This is basically what happens. You can see it in action if you turn on the "Active Chunks": The vicinity around the player is always more active. If the active chunks contain biter nests, they will spawn biters, while biter nests not in active chunks will go mostly inert. Since the player brings a radius of active chunks with him everywhere he goes, being in an area will appear to provoke biter activity.
That active radius is quite big, and chunks with pollution are active irrespective of player position. You can see this taking effect when player sets out with a crusade and the desolation zone around his base becomes bigger than pollution cloud.
This is the reason behind the rocket defence being dull, since the game only draws biters from active chunks to attack.
This is hardly an explanation for biter anisotropy at the scale of maximum zoom out described in th op.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

Adil wrote:
lusername wrote:This is basically what happens. You can see it in action if you turn on the "Active Chunks": The vicinity around the player is always more active. If the active chunks contain biter nests, they will spawn biters, while biter nests not in active chunks will go mostly inert. Since the player brings a radius of active chunks with him everywhere he goes, being in an area will appear to provoke biter activity.
That active radius is quite big, and chunks with pollution are active irrespective of player position. You can see this taking effect when player sets out with a crusade and the desolation zone around his base becomes bigger than pollution cloud.
This is the reason behind the rocket defence being dull, since the game only draws biters from active chunks to attack.
So if it was the player's active chunk radius having this effect, then if we were to repeat the test with vastly greater pollution output in the outposts saturating the biter bases with pollution, and ensuring that any chunks flagged as active due to player position would already be active due to pollution, we should see no difference between the player/empty outposts.

Anyone keen to try it themselves?

This would indicate that in a real game situation this effect is only worth worrying about when your pollution doesn't reach some biters, but your player area can.
Adil wrote: This is hardly an explanation for biter anisotropy at the scale of maximum zoom out described in th op.
I'm pretty sure the anisotropy observed in the OP is due to the outposts not being perfectly chunk aligned and half the pollution sources in the right outpost being a chunk closer to the biter base.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Player position affects biter attacks

Post by daniel34 »

I always wanted to try out the map editor and thought I could do that and at the same time try this experiment.

So I set up this map:

Complete map:
Image

One of the four outposts:
Image

This map is exactly 256x256 tiles (8x8 chunks) big. In the center are four biter spawners, one in each chunk. To the north/south/east/west is one outpost each. This map is completely symmetrical. You could flip it horizontally, vertically or even diagonally and it would still result in the same map.

Description of each outpost:
The middle two rows of steam engines (2x3 engines) are charging up the accumulators. Each boiler for these steam engines is filled with 10 coal. The accumulators (100 of them) can hold 500 MJ, but the boilers have only enough coal to charge them up to 312 MJ. To the right are 40 laser turrets. Because these turrets combined consume 240 kW when idle (40x6kW = 240kW) I've added 4 solar panels (4x60kW = 240kW) to negate that consumption (in daylight). If you let that setup run for 1 hour without attacks, the accumulators still have 312 MJ.

The 10 steam engines + 16 radars on the top and bottom are on a different electrical network and are there to cause pollution. They are fuelled by steel chests between each 2 boilers, each chest containing 500 coal.

My intention was to set the spawn point of the player to one of these outposts, let it run for 1 hour and then check how much charge the accumulators still had.
After loading the scenario I set game.alwaysday to true for the solar panels.
So I tested this with the outpost on the west. The biters always grouped themselves in one direction from the spawners and then later attacked in that direction, time between the attacks being 5-10 minutes.
The order was: south - west - south - east - south - north - north
The remaining accumulator charge:

Code: Select all

West: 286 MJ
East: 268 MJ
North: 221 MJ
South: 191 MJ
After repeating this test, the results were exactly the same.
At first I was baffled, but then I came to the obvious conclusion: Of course it has to be this way, because Factorio is deterministic and loading a scenario and not doing anything for one hour will always give the exact same result.

So I changed the spawning point of the player, and tested again.
However, no matter where I put the player on the beginning of the scenario (well, out of range of the biters of course), I still got the same exact result.

So I went and introduced some "randomness" by spawning in one spot and then running around on the map, first just around one outpost, in later tests even around the map.
But the results were still the same. No matter where I ran around on the map (out of biter range), I always got the same result.

My conclusion: Player position is not related to biter attacks.
I could have made some mistakes during testing, but I didn't notice any. It actually looked pretty convincing, even running around all the time and still getting the same outcome. Maybe some of you can comment on my testing method and the results I got.
Because Factorio is deterministic and therefore the pollution calculated for each chunk is always exactly the same, I suspect that even small changes in pollution might have bigger effects on the behavior of the biters. But I didn't test that theory as of yet.

All the tests were done in v0.11.19 and I've attached the map so you can experiment with it yourself, just copy it into the scenarios folder of your Factorio install.
Attachments
biters_west.zip
(60.96 KiB) Downloaded 161 times
quick links: log file | graphical issues | wiki
SteelGiant
Inserter
Inserter
Posts: 48
Joined: Thu Sep 11, 2014 12:14 pm
Contact:

Re: Player position affects biter attacks

Post by SteelGiant »

This is really great, thanks for doing some more testing. Your test map is a lot better than mine in terms of symmetry.

Interesting that in your example you did not see any evidence of player position.

When you say the results were always the same, do you mean that they were deterministically identical, or that there were small differences, but the ordering of which base was attacked most stayed the same? Do you have your full results recorded? (Of course if they were deterministically identical then there is no point in looking at replicates.)

I see two key differences between your tests and mine:

One pool of bases instead of separate ones for each base: Here we have a single pool of biters being presented with 4 targets, and they have to pick one to attack. In my test there were individual pools of biters, and each pool of biters was able to make the decision to attack or not independently. It could be that the player position affects the biter decision process for 'launch an attack', but not 'where does an attack go'.

Radars: If the issue is that the player brings an 'active chunks' zone with them, and this is what causes more biter attacks, and the radars have their own 'active chunk' area around them, then the effect of the player would be washed out. If the radars have already kept the chunks active irrespective of the player activity, then we wont see that effect. I think this is likely to be a significant effect, as I have heard talk of radars drawing attacks in the same way as players do. My recommendation would be to repeat the tests, but using something other than radars as an energy sink for the pollution makers.

A third factor, which I'm not exactly sure about is the fact you seem to have a lot less variability. In my results, I didn't get a single repeat for the runs where I was at a particular base. The ones where I was sat in the middle were probably all identical, but I can't be exactly sure. I think in order to be sure about things we need to find a way to make the simulations diverge so that we have independent simulations to look at. This might be achievable by starting the player with a biter next to them which you have to kill at your leisure, which should hopefully be impossible to do identically in multiple simulations.

When I get some time I'll try running some tests on your map. I think the radars-having-active-zone is going to be the thing... :ugeek:
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Player position affects biter attacks

Post by ssilk »

A stupid thougt: the devs try to optimize the game as much as possible. From that sight the question "will the character influence the biter behavior, even if it is 'behind some limit'?" must be answered clearly with "no". Because such calculations are always expensive, if made with hundreds of biters, that might be around you factory. And another "no", because the pollution already does exactly this. And a third "no" because even if they made such stuff, they would use another layer of pollution, calling it "players smell" and show that smell on map with another color.

(But what a cool idea, player smell, hmmmmmm, tasty)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Post Reply

Return to “General discussion”