[Done] Evolution Factors Display

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[Done] Evolution Factors Display

Post by TheSAguy »

Hi,

There are 3 things that affect evolution, Time, Base Destruction and Pollution (In Vanilla)

I’d like to get a way to show the amount of evolution added by each of these factors.

Would that be possible?

Thanks
Last edited by TheSAguy on Tue Jun 04, 2019 3:35 pm, edited 2 times in total.

Hiladdar
Fast Inserter
Fast Inserter
Posts: 214
Joined: Mon May 14, 2018 6:47 pm
Contact:

Re: Evolution Factors Display

Post by Hiladdar »

Console command of /evolution gives you that information.

So probably a rather sort of mod that performs performs this console command say once every 60+ ticks, stores the result in variable, and displays the result someplace on the screen, similar to how some of the clock based mods which display the time would do it.

Hiladdar

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Evolution Factors Display

Post by steinio »

EvoGUI is made for that; https://mods.factorio.com/mod/EvoGUI

But as the OP states (s)he plays vanilla there is no way to show the partial amount of each evolution factor.
Image

Transport Belt Repair Man

View unread Posts

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Evolution Factors Display

Post by TheSAguy »

Hiladdar wrote:
Sun May 19, 2019 5:50 pm
Console command of /evolution gives you that information.

So probably a rather sort of mod that performs performs this console command say once every 60+ ticks, stores the result in variable, and displays the result someplace on the screen, similar to how some of the clock based mods which display the time would do it.

Hiladdar
I know the command to show the combined evolution factor, but not the split out values.
steinio wrote:
Sun May 19, 2019 6:10 pm
EvoGUI is made for that; https://mods.factorio.com/mod/EvoGUI

But as the OP states (s)he plays vanilla there is no way to show the partial amount of each evolution factor.
I had a typo in my OP. I meant "In Vanilla", since there are mods that tweak the formula a bit. I'm actually using Next Gen Evolution that increases evolution from pollution only when absorbed.

I agree EvoGUI is perfect. It just needs the values split by type.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Evolution Factors Display

Post by darkfrei »

TheSAguy wrote:
Sun May 19, 2019 5:34 pm
Hi,

There are 3 things that affect evolution, Time, Base Destruction and Pollution (In Vanilla)

I’d like to get a way to show the amount of evolution added by each of these factors.

Would that be possible?

Thanks
I've made this display for Evo, but this thing is for normal evolution only. But it's not too complicated to adapt the code for more than one evolution factor or whatever.

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Evolution Factors Display

Post by Qon »

TheSAguy wrote:
Sun May 19, 2019 9:50 pm
Hiladdar wrote:
Sun May 19, 2019 5:50 pm
Console command of /evolution gives you that information.
I know the command to show the combined evolution factor, but not the split out values.
When was the last time you tried /evolution?

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Evolution Factors Display

Post by Qon »

You were talking about the vanilla factors, but you are using my mod Next Gen Evolution. So is this for another world without NGE or?
Because since NGE changes the evolution number directly the /evolution command shows the split factors just for how the game thinks it was calculated based on what it has done to evolution. Which means the splitted factors will show incorrect values for how the evolution was reached. That's just for the displayed splitted values though, the combined evolution factor is still calculated correctly.

AlFara
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 25, 2019 4:14 pm
Contact:

Re: Evolution Factors Display

Post by AlFara »

for vanilla:


-get total evolution:

Code: Select all

game.forces.enemy.evolution_factor
will give you the total evolution factor.


-get map settings:

Code: Select all

game.map_settings.enemy_evolution.time_factor
will give you the map settings's time factor.

Code: Select all

game.map_settings.enemy_evolution.destroy_factor
will give you the map settings's destroy factor.

Code: Select all

game.map_settings.enemy_evolution.pollution_factor
will give you the map settings's pollution factor.


-get required information:

Code: Select all

game.tick
will give u the number of ticks the round is running (edit: not sure about MP here)

Code: Select all

game.player.force.kill_count_statistics.get_input_count('big-worm-turret')
will tell you how many big worms the 'force' killed. also works for

Code: Select all

game.player.force.kill_count_statistics.get_input_count('biter-spawner')
and tells you how many biter spawners the force has killed and so on.


idk how to get the pollution factor, the probably inefficient idea would be like
total_evolution-ticks*map_timed_evolution-all_nest_kills_by_all_forces_added_up*map_destroy_evolution
edit: about modded stuff, technically.... (*as long as total evolution stays below 1)
if the mod adds additional numbers to the pollution counter, it doesn't matter because you know time and destroy.
if the mod adds additional numbers to the time but not pollution counter, easy because you know the ticks and base map settings and you can rely on the pollution statistics not being increased by a mod.
if it adds extra pollution to multiple categories, it might get difficult unless you can get the pollution statistics directly (and not via my complicated method)

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Evolution Factors Display

Post by Qon »

AlFara wrote:
Wed May 29, 2019 4:35 am
idk how to get the pollution factor, the probably inefficient idea would be like
total_evolution-ticks*map_timed_evolution-all_nest_kills_by_all_forces_added_up*map_destroy_evolution
edit: about modded stuff, technically.... (*as long as total evolution stays below 1)
if the mod adds additional numbers to the pollution counter, it doesn't matter because you know time and destroy.
if the mod adds additional numbers to the time but not pollution counter, easy because you know the ticks and base map settings and you can rely on the pollution statistics not being increased by a mod.
if it adds extra pollution to multiple categories, it might get difficult unless you can get the pollution statistics directly (and not via my complicated method)
Pollution is in LuaGame.

Code: Select all

game.pollution_statistics
https://lua-api.factorio.com/latest/Lua ... statistics

evolution_factor is not linear. You don't add the different factors
https://wiki.factorio.com/Enemies#Evolution wrote: Computation of actual evolution factor
The actual EF can be computed as follow :

Code: Select all

1 - EF = (1 - E[t]) * (1 - E[p]) * (1 - E[s])
, where E[t], E[p], and E[ s] are the single-component values from the pollution, time, and spawner charts, in that order.

AlFara
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 25, 2019 4:14 pm
Contact:

Re: Evolution Factors Display

Post by AlFara »

thanks for the update but how would your command to call it look like? or does "input_counts" yield the correct number?

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Evolution Factors Display

Post by Qon »

"input" is the left side which lists the entity outputs.
And "output" is the right side which lists the entity input consumption amounts.

Yes, left is right and right is wrong. I'll go ahead and file a bug report.

My mod Next Gen Evolution uses the pollution statistics and does evolution combination calculations. It uses get_flow_count instead since it needs the values for the last minute instead of all time stats but is the best code example I know of ;)

AlFara
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 25, 2019 4:14 pm
Contact:

Re: Evolution Factors Display

Post by AlFara »

tx, i'll take a look into it.

-edit-
@Bilka's post below: thanks
Last edited by AlFara on Wed May 29, 2019 1:51 pm, edited 1 time in total.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Evolution Factors Display

Post by Bilka »

Just a note, OP got their answer here: 71114
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Evolution Factors Display

Post by orzelek »

Bilka wrote:
Wed May 29, 2019 1:41 pm
Just a note, OP got their answer here: 71114
That thread doesn't seem to be finished. And example from that thread with all three values doesn't really match formula given above.
We still need some answers :D

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Evolution Factors Display

Post by Bilka »

orzelek wrote:
Wed May 29, 2019 5:29 pm
Bilka wrote:
Wed May 29, 2019 1:41 pm
Just a note, OP got their answer here: 71114
That thread doesn't seem to be finished. And example from that thread with all three values doesn't really match formula given above.
We still need some answers :D
I replied to the other thread.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Evolution Factors Display

Post by Qon »

Qon wrote:
Wed May 29, 2019 1:26 pm
"input" is the left side which lists the entity outputs.
And "output" is the right side which lists the entity input consumption amounts.

Yes, left is right and right is wrong. I'll go ahead and file a bug report.
"Not a bug"
It's not documented, the words mean the opposite of what my dictionary says they mean for no good reason (at least Rseding91 didn't tell me any reason) and in some places, the meaning flips back again! But now we at least have a soon-to-be-buried bug report to reference...

Post Reply

Return to “Modding help”