[MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Topics and discussion about specific mods
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

[MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Introducing my first mod

Scaled Alien Evolution
https://mods.factorio.com/mods/Telemak/ ... nEvolution

This mod limits the biter evolution up depending on your technological level.
It is compliant with other mods and should work in multiplayer as well.

Scaled alien evolution is based on the research you made.
It limits the biter evolution up so that you can beat their hives without worrying too much about biter evolution. It makes the game easier especially in mid game. It is ideal for beginners who want to discover the game or those who want to take the time to experiment (new mods ?) as if their production is stopped, the game would "wait" for them. It allows a better focus on base construction times. Beware a military technology research will raise twenty times more the limitation value than an equivalent other research (so that the more you get weapons, the more ennemy evolves). It is my first mod, feedback is appreciated.

0.13.9 - Same as 0.14.9 for factorio 0.13

0.14.9 - Evolution limitation is now strongly linked to the research science packs you have unlocked. In normal mode (without mods) the limitation will be 10% for science pack 1, 20% for science pack 2, 60% for science pack 3 and 80% for alien science pack. For a modded game it will be adjusted for all science packs added to the game by the other mods (like Bob's). for more information look at the discussion with Smoovious at the forum thread.

0.13.8 - Same as 0.14.8 for factorio 0.13

0.14.8 - The code is performed in a strategic position to work with old saves. Most of Config.lua parameters (well of of them except "displaylimit") are only read when a research has ended, it is a performance / API limitation.

0.13.7 - Same as 0.14.7 for Factorio 0.13

0.14.7 - Everything's configurable

0.13.6 - Same as 0.14.6 for Factorio 0.13

0.14.6 - Now when you achieve a higher science pack level research the limitation will raise so far :
- science pack 2 research : limitation can't be inferior to 25% (0.25)
- science pack 3 : limitation can't be inferior to 50% (0.50)
- alien science pack : limitation can't be inferior to 75% (0.75)
- removed the research weird numbers in display message

0.13.5 - Same as 0.14.5 for Factorio 0.13

0.14.5 - More complete military researches finder code.
The weight of military researches can now be configured.
Once you get the rocket silo researched, the mod will cease to apply a limitation to biter evolution.

0.13.4 - Added a version for Factorio 0.13.x

0.0.4 - Added MIT license file. Added a config file to mute the limit display. Changed the display message a bit (added "researched : ")

0.0.3 - Fixed a bug where the amount of total research was always increasing, limiting the spiter evolution up too much.

0.0.2 - Typo

0.0.1 - Core
Last edited by TelemakFactorio on Mon Oct 24, 2016 9:29 pm, edited 4 times in total.
Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by Smoovious »

So... with other mods, how is it limiting evolution?

I'm currently using around 190 mods, including all of Bob's, which adds more types of alien research.

I have a ton of technologies available to research still... so, is the limitation based on quantity of un-researched techs?

Will the science limitations, take into account the additional research items from Bob's?

50% at blue research, which I just unlocked, and am not even 5% through my research tree, seems to be quite a lot at the stage I am at now.

I honestly like the idea of this mod. It would be so helpful for those of us using many mods to make things harder on ourselves (like Toxic Jungle and Mountains, to name a couple I'm using), and evolution factor just gets out of control as we can't keep pace... but basing its minimum limitations on vanilla research, as described (and as I hope I am properly interpreting it), would still be a problem with some mod combinations...

I look forward to seeing how this mod evolves.

-- Smoov
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Smoovious wrote:So... with other mods, how is it limiting evolution?
Hi Smoovious,

First I would apologize for my english that is not my native language.

A/ This mod in version 0.13.5 / 0.14.5 is limiting the evolution based on the ratio (researches made / total available research ) but a military research (ex : grenades, walls, mines, turrets) count as 20 times a normal research (configurable in config.lua). Every second the mod will bring back the biter evolution to this ratio limit if it is greater. It will adapt to your 190 mods new techs in the calculation. Note that if you add / remove mods before you reload your game the calculation is updated only when a research has ended.
Smoovious wrote:I have a ton of technologies available to research still... so, is the limitation based on quantity of un-researched techs?
So basically with point A, yes it is.
Smoovious wrote:Will the science limitations, take into account the additional research items from Bob's?
Yes it will !

B/ In order to see a visible progression and not to be stuck at a 0% biter evolution for hours at early stages every completed research count as a 0.1% biter evolution at its minimum. (then at 1000 researches done will raise the limitation to 100% wich is the max)

C/ But, since version 0.13.6 / 0.14.6 I feared some "tech rush" from some players to get the rocket silo so I have added an increase in the minimum limitation to biter evolution to 25% as soon as you have researched a science pack 2 technology, 50% for a science pack 3 technology and 75% for an alien research technology. I am still no sure this is a good choice and I'm looking for advices like yours for a better balance. Maybe it's a mistake. This does not mean the biter evolution will be 25% 50% or 75% immediately as you get the mechanism in point A, it's just a max biter evolution.

D/ When you have researched the rocket silo, the limitation will cease (biter evolution is free to evolve up to 100%).

Maybe this last C point (the 25% 50% 75% mechanism) should be configurable in the config.lua file with three parameters available :
- minlimitationatsciencepack2=25
- minlimitationatsciencepack3=50
- minlimitationatsciencepackalien=75
so that you can set them to 0 to skip em and keep to live on the ratio explained in A and B.

And I should probably set the point B and D configurable too.

What do you think about this ?
For your specific 190 mods case and your needs, you should use version 0.13.5 / 0.14.5 for now.
Smoovious wrote:I look forward to seeing how this mod evolves.
Thank you
Last edited by TelemakFactorio on Sun Oct 16, 2016 10:29 pm, edited 5 times in total.
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Smoovious wrote:50% at blue research, which I just unlocked, and am not even 5% through my research tree, seems to be quite a lot at the stage I am at now.
You may consider the last release, everything's configurable in config.lua. Will not function for an already saved game (but I'm taking a look at migration scripts and/or on_config_changed event)
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Done ! But the config.lua parameters will be read
1/ when your mod set has changed
2/ or when you upgrade this mod
3/ or when a research has ended

This is an API / performance limitation
Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by Smoovious »

Ok, that was part of the confusion, in the way you originally described it...

'minlimitationatsciencepack2=25'

implies with the name, that evolution will be no lower than that... but when you described it, you were saying that evolution will be no higher than that, as it defines the upper limit, and not the lower limit.

Perhaps those variables would be more correctly named as 'maxlimitationatsciencepack2=25'

As for recommendations when using other mods... perhaps with Bob's, each step could be 10, as a max limit... or perhaps, scan through all items during startup, matching all items that contain "Science Pack", add 2, then divide 100/(science_pack_count + 2), to decide...

Rather than doing it with specific science packs, do it by quantity of unlocked science packs.

That should automatically adapt better to when 0.15.x introduces more science, as well as when mods which expand science packs, get added in.

(the 'add 2' I just pulled out of my ass, but that would allow for some growth room, as science packs unlock before any of the relevant science can be researched)

-- Smoov
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

I get the point. I didn't realize how bob adds new science packs, shame on me.
With your methodology, in vanilla we would get at unlocked science pack 1 16.66% of maxbiterevolution, science pack 2 -> 33.33, science pack 3 -> 50%, alien science pack -> 66.66 %
And for Bob mods well a lot of steps (1 2 3 4 alien gold alienblue alienorange alienpurple alienyellow aliengreen and alienred whatever the order it will be automatically adjusted)
1-> 7.14%
2-> 14.29%
3-> 21.43%
4-> 28.57%
5-> 35.71%
6-> 42.86%
7-> 50%
8-> 57.14%
9-> 64.29%
10-> 71.43%
11-> 78.57%
12-> 85.71%
Something like this (or maybe no increase at all for 1 and 2 as they are available early)
It implies I remove the config variables "minlimitationatsciencepackXXX" (those you advise to name maxlimitationatsciencepackXXX) and it makes sense since we don't know what mods would add to the game content in terms of science.
OK, sounds good to me. I'll study the feasibility of the whole thing.
Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by Smoovious »

remember, I pulled the "+ 2" out of my ass... maybe "+ 1", or "+ 1.5" or some other value would work out better...

in fact, thinking about it, I wouldn't go less than "+ 1", as that would allow for another step beyond the last science pack, which could allow for a last bit of evolution growth, when we reach the launching pad stage, pushing the max the rest of the way up to 100%.

-- Smoov

edit: we should still account for the red and green science, or evolution won't really grow much at all in early stages, and it should probably grow a little.

We get red science immediately, so, assuming 10 different science packs, the max evolution would be set at 10%... we get green science immediately (or close enuf to be immediate), so that would push max up to 20%... which isn't really a bad limitation in early stages...

It'll be a while before evolution reaches 20% anyways, so for those of us who don't speed-run our games, after a while we'll start getting some pressure from the biters to focus more on our defenses, but still staying down at a manageable level.
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

You will test this +X in the next days :)
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

I have implemented it but not released it yet. For now with vanilla it would start with a limitation of 40% at start (red + green) and for vanilla + bob about 15% (red + green) at start.
Do you think it's fair ?
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

I have done it, but I have added a superlimitation to 10 % for the first science pack unlocked and 20 % for the second pack unlocked for a non modded game.

Check the version 0.XX.9
Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by Smoovious »

Sorry, I missed the forum thread updates in my email... noticed the new version when I checked for updates.

I've currently, been manually reducing evolution factor from time to time as I build, but I'll start letting it creep up and see how it behaves.

I currently have red, green, and blue, unlocked, with with another 9 or so to unlock yet.

Let ya know if I see any issues.

-- Smoov

edit: ok... first thing that looks like an issue to me...

My science:
Science Pack 1 (red) -- researched
Science Pack 2 (green) -- researched
Science Pack 3 (blue) -- researched
Alien Science Pack (purple) -- NOT researched
Science Pack 4 (dk blue) -- NOT researched
Gold Science Pack (dk yellow) -- NOT researched
Science Pack 5 (yellow) -- NOT researched
Blue Alien Science Pack -- NOT researched
Orange Alien Science Pack -- NOT researched
Purple Alien Science Pack -- NOT researched
Yellow Alien Science Pack -- NOT researched
Green Alien Science Pack -- NOT researched
Red Alien Science Pack -- NOT researched

13 science packs, only 3 researched.

The game loaded up, telling me that the current evolution factor limit is now 59.3%

I still have 10 science packs to research, does this limit look like what you intended?

-- Smoov
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Dammit this is so wrong.
Try to achieve another research to see if it is corrected.
I would appreciate to get the savegame and the list of mods (You can zip your %appdata%/Factorio/mods please).

I read the state of the "enabled" parameter of each recipe if it contains the key "science-pack". Then I calculate the ratio explained above
stepValue = 1 / (nbSciencePackRecipes+1)
and
limit = nbEnabledSciencePackRecipes * stepValue
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

In Bob's tech mod, the technology named "alien-research" will unlock the following recipes :
"alien-science-pack-blue"
"alien-science-pack-orange"
"alien-science-pack-purple"
"alien-science-pack-yellow"
"alien-science-pack-green"
"alien-science-pack-red"
"science-pack-gold"

... and "advanced-research" will unlock the recipe :
science-pack-4
User avatar
TelemakFactorio
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Fri Oct 14, 2016 4:30 pm
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by TelemakFactorio »

Because of this behavior of bob's tech mod I think will have to rollback to the limitation calculated on first tech made with science-pack-XXX instead of unlocked science-pack-XXX
Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: [MOD 0.13.x | 0.14.x] Scaled Alien Evolution

Post by Smoovious »

Ok, I have a thought about this...

Perhaps, look into basing the limitation, not on available science packs, but on available research?

So, say I have 140 items of research in my tree, total, and of those 140, I currently have 95 unavailable to be researched yet (red), so, (140-95)/140=~0.3214 for a max of 32.14% evolution.

Later on, I have 73 unavailable (red), so now my limit is (140-73)/140=~0.4785 for a max of 47.85% evolution.

This would also save you the trouble of having to worry about what other research items other mods introduce, as that would already be baked into the research tree by the time your mod starts getting into the mix.

It would also allow for a smoother progression as evolution increases.

If someone adds mods in the middle of the game (like I do constantly), then your mod will adjust next time research is changed, so if I had 73 unavailable before, and a new mod adds 14 more pieces of research, then next time research is triggered, and 4 of those new pieces are available, and 10 unavailable, then my new limit is (154-83)/154=~0.4610 for a max of 46.1% evolution.

With it based on unavailable research, then the evolution limit will stay ahead of the curve, and reach 100% well before you research everything in the tree, and will have plenty of room to rise up in early game as well.

-- Smoov

edit: you could always adjust the difficulty level by including a config file value to add, so if you have a variable "extra_research", with a value of 8, then my new limit would be ((154+extra_research)-83)/154=~0.5129 for a max of 51.29% instead of 46.10%

So, the formula would be:
( tree.total_research - tree.locked_research + config.extra_research ) / tree.total_research = result.max_evolution
... in a more cleaned up version of it.

Would this sound more practical to use? At some point, your limit will end up over 100% evolution, but since the game handles that anyways, it shouldn't be an issue for your mod.

-- Smoov
Post Reply

Return to “Mods”