[MOD 0.12.x] Rescaled Evolution Factor
Re: [MOD 0.12.x] Rescaled Evolution Factor
i get this error with test version 1.4.1
and how i can change how much spawners i have to kill to reach 30% in 1.3.1 version
and how i can change how much spawners i have to kill to reach 30% in 1.3.1 version
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
I've fixed that. Thanks for your response.XBBX wrote:i get this error with test version 1.4.1
In line 54 to 56 of the control.lua there stands this:XBBX wrote:and how i can change how much spawners i have to kill to reach 30% in 1.3.1 version
Code: Select all
if global.pollution_spawner < 60 then
pollution_spawner_anzahl = global.pollution_spawner / 20
end
For example:
Code: Select all
if global.pollution_spawner < 90 then
pollution_spawner_anzahl = global.pollution_spawner / 30
end
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Code: Select all
function spawnertot(event)
if (global.pollution_spawner < 60 and (event.entity.name == "spitter-spawner" or event.entity.name == "biter-spawner")) then
global.pollution_spawner = global.pollution_spawner + 1
end
end
Would be preferable if you had variables for each part at the top of the file instead, so you could just change the values quickly.
Also, in that case, it doesn't work if you have a mod that adds custom spawners, like bobs mod. compare type to "unit-spawner" instead.
Edit:
Made a few changes. Added config stuff, english translations for the minor comments, and Applied the unit-spawner logic.
The values are different tho, since its for my game.
Side note: I suggest that pollution and maybe even the spawners have the same square-root curve as Time does, so it ramps up slowly. Or perhaps for pollution, the inverse. Goes up fast and slows down fast after that. Not sure. Pollution is always really easy to max out as is, and I am unsure how it is diluted by revealing more chunks. That doesn't really make much sense to me.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: [MOD 0.12.x] Rescaled Evolution Factor
Any chance this is getting an update? Spent some time digging around in the factorio mod server and didn't see it
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Here.
I have modified it however. Added config options, altered formulas and balance, and so on, but it should work at least.
Spawner kills cap at 120 intead of 60 or 40, whatever it was originally, and decay every 12 minutes, instead of each hour, and it is continous.
Pollution has a square root equation, so it goes up fast, then slows down massively. Also caps at 30 million, or rather 240 million. Kinda. The equation was already a bit confusing.
Time is unchanged.
I have modified it however. Added config options, altered formulas and balance, and so on, but it should work at least.
Spawner kills cap at 120 intead of 60 or 40, whatever it was originally, and decay every 12 minutes, instead of each hour, and it is continous.
Pollution has a square root equation, so it goes up fast, then slows down massively. Also caps at 30 million, or rather 240 million. Kinda. The equation was already a bit confusing.
Time is unchanged.
- Attachments
-
- Rescaled-Evolution-Factor_1.3.3.zip
- (5.37 KiB) Downloaded 151 times
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
First: Thanks Ranakastrasz for your changes! I like it, you cleand up the code. (By the way: The only reason why I mostly use German words for variables etc. is to be sure to never have any conflicts. )
I will work at this mod again in the future. But at the moment I don't have any time for Factorio (or any other computer game...). Life can be so time-consuming. I hope to be able to make a new release when Factorio 0.13 will come out. Until then: Ranakastrasz made some nice changes. With the 1.3.3 you can easily customise the mod if you change the values in the first lines of the control.lua.
I will work at this mod again in the future. But at the moment I don't have any time for Factorio (or any other computer game...). Life can be so time-consuming. I hope to be able to make a new release when Factorio 0.13 will come out. Until then: Ranakastrasz made some nice changes. With the 1.3.3 you can easily customise the mod if you change the values in the first lines of the control.lua.
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Planning on adding a config setting for the power factor. So you can set it to front loaded, rear loaded, or linear. Also thinking of increasing kill based factor to 80% so that cutting your power for less pollution can't get rid of behemoths or something, if you have been fighting a lot.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: [MOD 0.12.x] Rescaled Evolution Factor
Hey there, is it possible or make even sense to use this mod with misanthrope? I like the way misanthrope handles expansion ect. but i like the scaling of the evolution factor from this mod. Because of that i would like to use them together. ^~^
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
It SHOULD work, but only partially. The extra functionality at high evo factor should work, as should the altered expanstion mechanics. Anything that mod does to alter the evolution factor will be blocked, or rather overwritten constantly, so no increased decay factor.Kitsune wrote:Hey there, is it possible or make even sense to use this mod with misanthrope? I like the way misanthrope handles expansion ect. but i like the scaling of the evolution factor from this mod. Because of that i would like to use them together. ^~^
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: [MOD 0.12.x] Rescaled Evolution Factor
Seems like the processing this does once a second eventually takes longer than a tick.Ranakastrasz wrote:Here.
I have modified it however. Added config options, altered formulas and balance, and so on, but it should work at least.
Spawner kills cap at 120 intead of 60 or 40, whatever it was originally, and decay every 12 minutes, instead of each hour, and it is continous.
Pollution has a square root equation, so it goes up fast, then slows down massively. Also caps at 30 million, or rather 240 million. Kinda. The equation was already a bit confusing.
Time is unchanged.
If i had to guess the long processing time is probably looping through all the chunks?
Code: Select all
local s = game.surfaces["nauvis"]
for c in s.get_chunks() do
summe = summe + s.get_pollution({c.x *32,c.y *32})
anzahl = anzahl + 1
end
Maybe a strategy could be used to check the same amount of chunks still, but staggered so you only check a percentage every tick. Like 1/3 every 20 ticks. Or calculate pollution in a way that does not visit every chunk on the map...
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
@Peppe:
You are totally right with your analysis. Yet I did not think that would be a problem but I like your solution and that should be made easily, so I integrate it probably the next release.
You are totally right with your analysis. Yet I did not think that would be a problem but I like your solution and that should be made easily, so I integrate it probably the next release.
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
No, that just applies to the spawner kill decay, not to the counting how many chunks for pollution.Peppe wrote:Seems like the processing this does once a second eventually takes longer than a tick.Ranakastrasz wrote:Here.
I have modified it however. Added config options, altered formulas and balance, and so on, but it should work at least.
Spawner kills cap at 120 intead of 60 or 40, whatever it was originally, and decay every 12 minutes, instead of each hour, and it is continous.
Pollution has a square root equation, so it goes up fast, then slows down massively. Also caps at 30 million, or rather 240 million. Kinda. The equation was already a bit confusing.
Time is unchanged.
If i had to guess the long processing time is probably looping through all the chunks?Makes the game slow down for the one tick it processes every chunk once a second, so you don't get 60/60 FPS/UPS.Code: Select all
local s = game.surfaces["nauvis"] for c in s.get_chunks() do summe = summe + s.get_pollution({c.x *32,c.y *32}) anzahl = anzahl + 1 end
Maybe a strategy could be used to check the same amount of chunks still, but staggered so you only check a percentage every tick. Like 1/3 every 20 ticks. Or calculate pollution in a way that does not visit every chunk on the map...
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Why do you think so?Ranakastrasz wrote: No, that just applies to the spawner kill decay, not to the counting how many chunks for pollution.
Looping through all the chunks is much more work to do than decrease an integer value. And even if you remove all the spawner features, the 59.9 FPS/UPS is still there.
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Oh, I thougt you were refering to the change I made, which did not touch that part. Yes, that occurs each second, but so far as I can tell, that doesn't cost much.BenediktMagnus wrote:Why do you think so?Ranakastrasz wrote: No, that just applies to the spawner kill decay, not to the counting how many chunks for pollution.
Looping through all the chunks is much more work to do than decrease an integer value. And even if you remove all the spawner features, the 59.9 FPS/UPS is still there.
Still, I am not sure why that was added in the first place. Doesn't really add much.
Also, there is no way around the loop. You still NEED to count the global pollution count for the mod to work. No other way to have Evo factor scale by global pollution without counting it. If you increse the tick delay, it might help some, or if there is a way to stagger it, but It isn't really avoidable.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- Ranakastrasz
- Smart Inserter
- Posts: 2171
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Anyhow, Updated.
Increased Config options significantly. should be far more customizable now.
Can apply the exponent part however you want, mainly. Also, there is overlap now, so it is actually quite possible to hit 100% Evo factor, even if you were to turn off your factory to cut pollution, if you attacked enough enemy bases.
Increased Config options significantly. should be far more customizable now.
Can apply the exponent part however you want, mainly. Also, there is overlap now, so it is actually quite possible to hit 100% Evo factor, even if you were to turn off your factory to cut pollution, if you attacked enough enemy bases.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Thanks! Looks very nice!
One thing I noticed:
"-- Currently disabled. I can't see any reason to have your exploration reduce how much biters hate pollution."
I used the explorated chunks as a way to indicate the size of a factory. The intention was to simulate that, over time and intensity of the factory's pollution, there is a little bit of evolutionary adaptation. A big and old factory should be allowed to produce more pollution than a small one. And the number of explored chunks seemed to be a better indicator than time is. In the new system I plan this will maybe be obsolet.
One thing I noticed:
"-- Currently disabled. I can't see any reason to have your exploration reduce how much biters hate pollution."
I used the explorated chunks as a way to indicate the size of a factory. The intention was to simulate that, over time and intensity of the factory's pollution, there is a little bit of evolutionary adaptation. A big and old factory should be allowed to produce more pollution than a small one. And the number of explored chunks seemed to be a better indicator than time is. In the new system I plan this will maybe be obsolet.
Re: [MOD 0.12.x] Rescaled Evolution Factor
Ranakastrasz wrote:No, that just applies to the spawner kill decay, not to the counting how many chunks for pollution.Peppe wrote:Seems like the processing this does once a second eventually takes longer than a tick.Ranakastrasz wrote:Here.
I have modified it however. Added config options, altered formulas and balance, and so on, but it should work at least.
Spawner kills cap at 120 intead of 60 or 40, whatever it was originally, and decay every 12 minutes, instead of each hour, and it is continous.
Pollution has a square root equation, so it goes up fast, then slows down massively. Also caps at 30 million, or rather 240 million. Kinda. The equation was already a bit confusing.
Time is unchanged.
If i had to guess the long processing time is probably looping through all the chunks?Makes the game slow down for the one tick it processes every chunk once a second, so you don't get 60/60 FPS/UPS.Code: Select all
local s = game.surfaces["nauvis"] for c in s.get_chunks() do summe = summe + s.get_pollution({c.x *32,c.y *32}) anzahl = anzahl + 1 end
Maybe a strategy could be used to check the same amount of chunks still, but staggered so you only check a percentage every tick. Like 1/3 every 20 ticks. Or calculate pollution in a way that does not visit every chunk on the map...
That loop is affecting performance.
Code: Select all
--[[
for c in s.get_chunks() do
summe = summe + s.get_pollution({c.x *32,c.y *32})
anzahl = anzahl + 1
end
]]--
summe = 1000
anzahl = 1000000
With it in I get 58-59 meaning it always skips one tick a second and sometimes has to skip 2.
full zoom out
I commented out and get 60/60 FPS/UPS on this same map standing in the same spot doing the same action.Re: [MOD 0.12.x] Rescaled Evolution Factor
any updates planed for 0.13.X?
- BenediktMagnus
- Inserter
- Posts: 29
- Joined: Wed Mar 09, 2016 11:04 pm
- Contact:
Re: [MOD 0.12.x] Rescaled Evolution Factor
Yes. As soon as 0.13 will be stable and I will have the time to update the mod.
Re: [MOD 0.12.x] Rescaled Evolution Factor
cool thx for the infoBenediktMagnus wrote:Yes. As soon as 0.13 will be stable and I will have the time to update the mod.