Loss Prevention - Because noone enjoys taking down green biters with red ammo

All mods from Reika

Moderator: Reika

Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Reika »

If playing with sufficiently harsh settings, one can find that they have been...rather outpaced by the advancement of the native life. This is especially true with certain mod environments, such as a grouping of NauvisDay, Natural Evolution, and Rampant.

Biters should present a serious threat, especially when one does not design their factory with good defence strategies in mind. But noone wants to end up 60 hours into a save and realize that they need blue science tech just to defend their factory against the ceaseless attack waves, while they are currently still struggling to automate ammo production. Noone wants to realize that to get their first oil patch, they need to clear a nest with 19 spawners and 8 big worms, while the best weaponry they have available are un-upgraded grenades.

With Loss Prevention, those scenarios will not happen - the enemy evolution will be kept in check by your own progression - or lack thereof - through the tech tree. Unlike other mods, this does not change how evolution generally behaves - time, pollution, and spawner destruction still do their thing - but it does prevent it from running to a point of unrecoverability.
Image

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

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by darkfrei »

Something like this?

Code: Select all

On_tick
  If not (technology[i].enabled) then set_evolution_limit (n) end
End

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Reika »

darkfrei wrote:Something like this?

Code: Select all

On_tick
  If not (technology[i].enabled) then set_evolution_limit (n) end
End
No, it is a lot more complex than that.
Image

Wildejackson
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sun Jul 31, 2016 2:40 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Wildejackson »

can we get some more technical details on what factors the mod takes into account?

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Reika »

Wildejackson wrote:
Tue Sep 11, 2018 6:53 am
can we get some more technical details on what factors the mod takes into account?
I was somewhat vague on the exact conditions, as knowing those would open the possibility for gaming the system.

I will say it depends on your research, certain production capabilities, certain defensive capabilities, and a few other statistics.
Image

ThirdGhostHand
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Oct 15, 2018 4:03 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by ThirdGhostHand »

Does this mod work in a PvP scenario? Say if we have six players, will the bugs wait to evolve for the slowest person? Or does it work differently? Thanks!

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Reika »

ThirdGhostHand wrote:
Mon Oct 15, 2018 4:06 pm
Does this mod work in a PvP scenario? Say if we have six players, will the bugs wait to evolve for the slowest person? Or does it work differently? Thanks!
I am not entirely sure what it might do in a MP environment at all.
Image

IVAN_PIDORVAN
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Sep 23, 2018 4:15 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by IVAN_PIDORVAN »

60 hours - no blue science, no ammo production, jesus christ...

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Reika »

IVAN_PIDORVAN wrote:
Mon Nov 05, 2018 11:54 pm
60 hours - no blue science, no ammo production, jesus christ...
???
Image

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Vas »

I have some thoughts for this mod.

I looked at its code a bit too and was trying to figure out how I could improve upon it but I'm not really a coder or anything so.

So, what I was thinking it would be nice to have enemies evolution capped till I do certain things, and the cap reduces at certain stages too. For example, research is permanent, so once I research something, I can never reduce the cap again and I'm screwed when the green biters start attacking and I'm still struggling to automate turret development and defend my base from endless attack waves.

I want to have research affect the evolution cap in a more minor way. With no research, 0.1% cap.
Researching turrets, increases the cap by 0.5%, researching turret damage upgrades, another 0.25% per research. Military research, 0.5%.

Now, these are still fairly low, the enemy might be around 1.5% total after a few early research. Now we add buildings into the mix. For each turret, the cap goes up another 0.15 to 0.25, for each 10 walls, another 0.05 or even, for each wall 0.005.

When a turret is destroyed, the cap is reduced, same for walls. If all of your defenses are destroyed, the cap is down to its minimal permanent levels from research and other modifiers that make it stay higher.

I'd also like a setting, that stops nests from being devolved. I don't mind nests having high evolution worms or nests, but the attack waves should only consist of biters that are of your evolution level. So nest spawns should reflect that level of evolution while the worms stay at their evolution and defend the nest.

What do you think?
There's also a mod suggestion I was thinking of, an ability to reduce the evolution, or even just make the aliens docile by giving them stuff or actively reducing pollution. I tried NauvisDay, but I reported a pretty major bug in it.
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

Pi-C
Smart Inserter
Smart Inserter
Posts: 1639
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Pi-C »

Vas wrote:
Thu Nov 21, 2019 9:33 am
I want to have research affect the evolution cap in a more minor way. With no research, 0.1% cap.
Perhaps Research Causes Evolution could help you achieve at least some of the things you want?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Vas »

So, when I looked at your mod, and was attempting to add settings to it I hit a pitfall where I have no idea how to add settings to your mod the way I did bob's greenhouse (which my settings no longer work for since 0.17 because the devs changed something somewhere that broke my damn mod with no apparent cause). I'll share what I got so far, and perhaps you can add settings to your mod?

Settings.lua

Code: Select all

data:extend({
	{
		-- Technology List for Permanent Evolution
		type = "string-setting",
		name = "technology-list",
		localised_name = "List of technologies and the level of evolution they max at.",
		localised_description = "Simply list a technology, and then the evolution unlocking it will max at. I suggest going in evolution order so you don't get lost and confused. Warning, a blank setting will result in max evolution and disable the mod.",
		setting_type = "startup",
		allow_blank = true,
		default_value = "turrets:0.01,military:0.1,steel-processing:0.2,military-2:0.3,military-3:0.7",
		order = 1
	},
		-- Structure List for Evolution Addition
		type = "string-setting",
		name = "structure-list",
		localised_name = "List of structures and evolution they add.",
		localised_description = "This is a list of structures that once built, they will add evolution cap. Once destroyed, the evolution cap will decrease again.",
		setting_type = "startup",
		allow_blank = true,
		default_value = "",
		order = 2
	},
	{
		-- Enemy Base evolution factor
		type = "bool-setting",
		name = "enemy-base-deleveler",
		localised_name = "Reset enemy base structures as well?",
		localised_description = "Set to true, if the enemy base should be reset when evolution level is lower than the base level. If set to false, bases will generate normally, and only enemy attack waves will be set to the current evolution factor making it potentially harde to take down enemy bases on resource deposits.",
		setting_type = "startup",
		default_value = true,
		order = 3
	}
})
The first setting, is a list of technologies and the evolution setting they unlock. But now that I've looked more closely at your mod because this confused me, it seems more like, the evolution listed on that technology is the technology that the game goes up to until you unlock that tech. Since it maxes at 1% till I unlock turrets, and then after turrets its 10%. Why do you have Steel Processing increase the max? A little odd since its not a defense technology.

The next list, is part of my suggestion previously. For each entity built, the cap of evolution increases. So say you add turret as one entity and set it to 0.001, the cap will go up by 0.1% each turret you have. If you have 30 turrets, the cap will be 3% higher than your permanent cap level. Say all you have is turrets researched, your cap is 10%, + 3%, 13%. Now half your turrets are destroyed in a raid, the cap will go down to 11.5%.

Adding onto that suggestion however, perhaps you can have the cap decrease slowly when it reduces, like a max rate of 0.1% per minute. That'll help smooth things out rather than instant de-leveling everything in the middle of a battle.

Here's the code part I was gonna attempt, but I'm not a coder so I have no idea if it would have worked. I just cut pieces from other projects of mine where a friend helped out with portions as well.

Code: Select all

local TECH_LIST=		settings.global["technology-list"].value
local STRUCT_LIST=		settings.global["structure-list"].value
local BASE_SETTING=		settings.global["enemy-base-deleveler"].value

-- Lets create a splitter function so we can split our additional strings properly.
local function split(inputstr, sep)
	if sep == nil then sep = "%s" end
	t={} i=1
	for str in string.gmatch(inputstr, "([^"..sep.."]+)") do 
		t[i] = str
		i = i + 1
	end return t
end

-- Now lets rebuild the list of technology unlocks and their evolution factors.
script.on_event(defines.events.on_player_created,function(param)
	local p=game.players[param.player_index]
	
	if TECH_LIST ~= "" then
		local items = split(TECH_LIST,",")
		for no, item_str in pairs(items) do
			local info = split(item_str,":")
			if game.forces[player].technologies[info[1]] then
				addTechEvoThreshold(info[1],tonumber(info[2]))
			end
		end
	end
end)

--[[ Reference Code:
addTechEvoThreshold("turrets", 0.01)
addTechEvoThreshold("steel-processing", 0.2)
addTechEvoThreshold("military", 0.1)
addTechEvoThreshold("military-2", 0.3)
addTechEvoThreshold("military-3", 0.7)]]--
I left the reference in there only when I was planning to test, but I gave up cause I couldn't figure out how to go about doing this. So I leave it up to you to fiddle with now. I really hope you can add these settings so we can alter this stuff ourselves. :P With bob's mods and Rampart you can still lose rather quickly to AI, plus I play a slower game where I try not to pollute a lot. For some reason researching steel causes the evolution to go very high and I lose every time I do, when I need steel for early game stuff and I've still got crummy bad turrets.
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by Vas »

Here's one more thing I should add that may help in tweaking the mod later on if you decide on any sort of rebalancing, Reika. Some settings I added into my personal copy for while I play.

Code: Select all

addTechEvoThreshold("turrets", 0.01)
addTechEvoThreshold("stone-walls", 0.03)
addTechEvoThreshold("military", 0.05)
addTechEvoThreshold("military-2", 0.15)
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-sniper-turrets-1", 0.18) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-turrets-2", 0.21) end
addTechEvoThreshold("automobilism", 0.28)
addTechEvoThreshold("laser-turrets", 0.30)
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-sniper-turrets-2", 0.32) end
addTechEvoThreshold("military-3", 0.35)
if game.active_mods["bobwarfare"] then addTechEvoThreshold("reinforced-wall", 0.38) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-turrets-3", 0.42) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-sniper-turrets-3", 0.43) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-laser-turrets-2", 0.44) end
addTechEvoThreshold("military-4", 0.64)
addTechEvoThreshold("tanks", 0.65)
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-laser-turrets-3", 0.66) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-turrets-4", 0.70) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-laser-turrets-4", 0.72) end
if game.active_mods["ForceFields2"] then addTechEvoThreshold("Forcefields", 0.80) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-turrets-5", 0.85) end
if game.active_mods["bobwarfare"] then addTechEvoThreshold("bob-laser-turrets-5", 0.90) end
addTechEvoThreshold("rocket-silo", 1.00)
Your system still confuses me to a degree, if someone researches Stone Walls, then evolution goes up to the next lowest item in the list, 0.05, yes? (5% Military)
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

User avatar
modo_lv
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Jan 12, 2021 2:08 pm
Contact:

Re: Loss Prevention - Because noone enjoys taking down green biters with red ammo

Post by modo_lv »

Any plans to update for 1.1? And/or is it safe to simply fix the info.json file and use the same mod?
It is not safe to update info.json. I tried that and encountered a crash within the first few minutes of starting a new game.

Post Reply

Return to “Reika's Mods”