Page 1 of 1

[0.17.71] Evolution Factor by Time/Pollution

Posted: Thu Oct 17, 2019 8:31 am
by Schallfalke
I start a new game, and see how the evolution factor increases.
And I looked into the three quantities, as mentioned in Lua API:

Code: Select all

evolution_factor_by_pollution :: double [RW]
evolution_factor_by_time :: double [RW]
evolution_factor_by_killing_spawners :: double [RW]
My Tests:
  1. I used "Default" setting, and start new game doing nothing. So I expected only the "by_time" value increases, while "by_pollution" stays 0. Results are opposite, it shows "by_pollution" increases, "by_time" is 0. ("by_killing_spawners" is 0 as expected.)
  2. Then I tried with "Death World" setting, and start new game doing nothing again. The results are like above, except "by_pollution" value increases faster.
  3. Then I tuned with the start new game panel 3rd tab "Enemy", went into "Evolution" section. Max out "Time factor" to 1000, remove "Pollution factor" to 0. Guess what I got? Like 1 and 2, although "by_pollution" value increases even faster.
  4. Then I tuned with another setting: remove "Time factor" to 0, max out "Pollution factor" to 1000. And stay in game doing nothing for like 10 min. Results are three "by_*" values and the total evolution factor all stay absolute zero.
  5. (This time not starting a new game.) I load my old megabase save, the "by_time" is non-zero and actually highest among the three "by_*" values.
My Conclusion:
  1. Starting new games, "by_time" value always stays zero, no matter what the setting is.
  2. The actual contribution by "Time factor", seems have been wrongly added to "by_pollution" value instead.
  3. Old megabase save proved I did not mistype variable names. (So I am looking into correct variables.)
  4. Seems this bug was made in some recent version(?).
PS: I used my own mod
Schall Endgame Evolution
to look into the values. This saved me a lot of typing work in console. Hope this maybe helpful to you in solving the bug. ;)

Re: [0.17.71] Evolution Factor by Time/Pollution

Posted: Thu Oct 17, 2019 8:56 am
by Rseding91
Thanks for the report however nothing around this logic has changed in over a year.

There is 1 place in the code where "by_time" is increased and it's called once per game tick so I know it's correct. There is 1 place in the code where "by_pollution" is increased and it's called from where pollution is created so I know it's correct.

I would have to see your code you're using to read out the game but I would guess that you've done the reading backwards in what ever mod you've created or you've made some bad assumption about values you're changing thinking they're somehow related to the evolution logic when they're actually not.

Re: [0.17.71] Evolution Factor by Time/Pollution

Posted: Thu Oct 17, 2019 9:00 am
by Klonan
I'm gonna take this bit by bit.
Schallfalke wrote: Thu Oct 17, 2019 8:31 am [*] Starting new games, "by_time" value always stays zero, no matter what the setting is.
Cannot reproduce:
Image

Re: [0.17.71] Evolution Factor by Time/Pollution

Posted: Thu Oct 17, 2019 9:02 am
by boskid
Not a bug (in Factorio itself)
Schallfalke wrote: Thu Oct 17, 2019 8:31 am PS: I used my own mod Schall Endgame Evolution;)
control.lua:256:

Code: Select all

  -- Frames : Evolution Factor Components
  t = frame.add { type = "table", name="table_evo_pol", column_count = 3 } ------ pollution
  table.insert(captions, t.add { type = "label", caption = {"description.Schall-evolution-factor-time"} } ) ------ time ?
  table.insert(stretches, t.add { type = "flow" } )
  table.insert(evo_numbers, t.add { type = "label", name="label_evo_pol", caption = "0%" } )
control.lua:260:

Code: Select all

  t = frame.add { type = "table", name="table_evo_tim", column_count = 3 } ------ time
  table.insert(captions, t.add { type = "label", caption = {"description.Schall-evolution-factor-pollution"} } ) ------ pollution?
  table.insert(stretches, t.add { type = "flow" } )
  table.insert(evo_numbers, t.add { type = "label", name="label_evo_tim", caption = "0%" } )

Re: [0.17.71] Evolution Factor by Time/Pollution

Posted: Thu Oct 17, 2019 9:48 am
by Schallfalke
I am sorry. Did not realize it is bug from my own mod... :oops:
Especially thanks boskid for debugging.

EDIT: A question though. Is killing trees not counting towards pollution? This is what happened to real-world Amazon...