Skip to content

Commit

Permalink
see readme
Browse files Browse the repository at this point in the history
  • Loading branch information
veden committed Apr 30, 2017
1 parent e46b402 commit dae6da6
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 71 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ There will be a slight pause the first time this is started up due to indexing a

MP should be working

Configure Options:
- Max biter wave size
Configure Options not in game menu:
- Ramp up to max biter wave size
- Use dumb projectiles
- Use Natural Evolution unit launchers (Requires NE)
- Togglable attack wave triggers (pollution, player)
- Attack wave pollution trigger threshold


# Features

Expand Down Expand Up @@ -52,6 +48,14 @@ Configure Options:

# Version History

0.15.2 -
- Improvement: Created in game options for
- Max biter wave size
- Use dumb projectiles
- Use Natural Evolution unit launchers (Requires NE)
- Togglable attack wave triggers (pollution, player)
- Attack wave pollution trigger threshold

0.15.1 -
- Tweak: Increased small spitter damage from 7 to 15
- Tweak: Increased medium spitter damage from 15 to 22
Expand Down
79 changes: 40 additions & 39 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,58 @@ config.safeEntities["straight-rail"] = true
--config.safeEntities["electric-pole"] = true
config.safeEntityName["big-electric-pole"] = true

--[[
turns off homing projectiles for worms and spitters
--]]
config.useDumbProjectiles = true
-- --[[
-- turns off homing projectiles for worms and spitters
-- --]]
-- config.useDumbProjectiles = true

--[[
ONLY FOR USE WITH NATURAL EVOLUTION ENEMIES
use the NE unit launchers with medium and big worms.
if set to false this will still allow the dumb projectiles but without the unit spawning
A side effect of the dumb projectiles cause the units to be spawned as if two shots were fired
--]]
config.useNEUnitLaunchers = true
-- --[[
-- ONLY FOR USE WITH NATURAL EVOLUTION ENEMIES
-- use the NE unit launchers with medium and big worms.
-- if set to false this will still allow the dumb projectiles but without the unit spawning
-- A side effect of the dumb projectiles cause the units to be spawned as if two shots were fired
-- --]]
-- config.useNEUnitLaunchers = true

--[[
the attackWaveGenerationUse* options are used to score chunks with biter nests that will generate a Rampant attack wave.
Pollution, the vanilla pollution mechanic (shown on the minimap).
Player Proximity, if a player moves near a biter nest there is a chance for the nest to spawn attack waves (not shown on the minimap).
switching all to false will turn off Rampant biter waves
DOES NOT affect vanilla biters waves
--]]
config.attackWaveGenerationUsePollution = true
config.attackWaveGenerationUsePlayerProximity = true
-- --[[
-- the attackWaveGenerationUse* options are used to score chunks with biter nests that will generate a Rampant attack wave.
-- Pollution, the vanilla pollution mechanic (shown on the minimap).
-- Player Proximity, if a player moves near a biter nest there is a chance for the nest to spawn attack waves (not shown on the minimap).
-- switching all to false will turn off Rampant biter waves
-- DOES NOT affect vanilla biters waves
-- --]]
-- config.attackWaveGenerationUsePollution = true
-- config.attackWaveGenerationUsePlayerProximity = true

--[[
attackWaveGenerationThreshold is the score that the attackWaveGenerationUse* has to reach in order for an attack wave to spawn.
increasing this will reduce the radius of attack wave generation.
DOES NOT affect vanilla biters waves
scaling linearly with evolution factor
starts 20 @ 0.0 evolution
ends 0 @ 100.0 evolution
default max is 20
default min is 0
--]]
config.attackWaveGenerationThresholdMax = 20
config.attackWaveGenerationThresholdMin = 0
-- --[[
-- attackWaveGenerationThreshold is the score that the attackWaveGenerationUse* has to reach in order for an attack wave to spawn.
-- increasing this will reduce the radius of attack wave generation.
-- DOES NOT affect vanilla biters waves
-- scaling linearly with evolution factor
-- starts 20 @ 0.0 evolution
-- ends 0 @ 100.0 evolution
-- default max is 20
-- default min is 0
-- --]]
-- config.attackWaveGenerationThresholdMax = 20
-- config.attackWaveGenerationThresholdMin = 0

--[[
attackWaveMaxSize is the largest size that can be initially spawned by Rampant
--]]
config.attackWaveMaxSize = 150
-- --[[
-- attackWaveMaxSize is the largest size that can be initially spawned by Rampant
-- --]]
-- config.attackWaveMaxSize = 150

--[[
attackWaveScaling is used to calculate the attack wave size from the evolutionFactor
default is config.attackWaveMaxSize * (evolutionFactor ^ 1.666667)
DOES NOT affect vanilla biters waves
--]]
config.attackWaveScaling = function (evolutionFactor)
return math.ceil(gaussianRandomRange(config.attackWaveMaxSize * (evolutionFactor ^ 1.66667),
(config.attackWaveMaxSize * 0.5) * 0.333,
local attackWaveMaxSize = settings.startup["rampant-attackWaveMaxSize"].value
return math.ceil(gaussianRandomRange(attackWaveMaxSize * (evolutionFactor ^ 1.66667),
(attackWaveMaxSize * 0.5) * 0.333,
1,
config.attackWaveMaxSize + (config.attackWaveMaxSize * 0.25)))
attackWaveMaxSize + (attackWaveMaxSize * 0.25)))
end

return config
Expand Down
6 changes: 2 additions & 4 deletions data-updates.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local config = require("config")

local vanillaUpdates = require("prototypes/enemies/UpdatesVanilla")
local bobsUpdates = require("prototypes/enemies/UpdatesBobs")
local NEUpdates = require("prototypes/enemies/UpdatesNE")
Expand All @@ -12,7 +10,7 @@ local function NEDetected()
return data.raw["unit"]["medium-spitter-Mk3"] ~= nil
end

if config.useDumbProjectiles then
if settings.startup["rampant-useDumbProjectiles"].value then
vanillaUpdates.useDumbProjectiles()
if bobsDetected() then
require("prototypes/enemies/AttackBobs")
Expand All @@ -21,7 +19,7 @@ if config.useDumbProjectiles then
if NEDetected() then
require("prototypes/enemies/AttackNE")
NEUpdates.useDumbProjectiles()
if config.useNEUnitLaunchers then
if settings.startup["rampant-useNEUnitLaunchers"].value then
NEUpdates.useNEUnitLaunchers()
end
end
Expand Down
2 changes: 0 additions & 2 deletions data.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local config = require("config")

require("prototypes/enemies/AttackAcidBall")
require("prototypes/enemies/AttackAcidFlame")

Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "0.15",
"version" : "0.15.1",
"version" : "0.15.2",
"title" : "Rampant AI",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
Expand Down
8 changes: 4 additions & 4 deletions libs/AIBuilding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ local CHUNK_SIZE = constants.CHUNK_SIZE
local NORTH_SOUTH_PASSABLE = constants.NORTH_SOUTH_PASSABLE
local EAST_WEST_PASSABLE = constants.EAST_WEST_PASSABLE

local CONFIG_USE_PLAYER_PROXIMITY = config.attackWaveGenerationUsePlayerProximity
local CONFIG_USE_POLLUTION_PROXIMITY = config.attackWaveGenerationUsePollution
local CONFIG_USE_THRESHOLD_MIN = config.attackWaveGenerationThresholdMin
local CONFIG_USE_THRESHOLD_MAX = config.attackWaveGenerationThresholdMax
local CONFIG_USE_PLAYER_PROXIMITY = settings.startup["rampant-attackWaveGenerationUsePlayerProximity"].value
local CONFIG_USE_POLLUTION_PROXIMITY = settings.startup["rampant-attackWaveGenerationUsePollution"].value
local CONFIG_USE_THRESHOLD_MIN = settings.startup["rampant-attackWaveGenerationThresholdMin"].value
local CONFIG_USE_THRESHOLD_MAX = settings.startup["rampant-attackWaveGenerationThresholdMax"].value
local CONFIG_USE_THRESHOLD_RANGE = CONFIG_USE_THRESHOLD_MAX - CONFIG_USE_THRESHOLD_MIN

local RETREAT_MOVEMENT_PHEROMONE_LEVEL = constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL
Expand Down
4 changes: 1 addition & 3 deletions libs/UnitGroupUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ local unitGroupUtils = {}

local mapUtils = require("MapUtils")
local constants = require("Constants")
package.path = "../?.lua;" .. package.path
local config = require("config")

-- constants

Expand All @@ -23,7 +21,7 @@ local NO_RETREAT_BASE_PERCENT = constants.NO_RETREAT_BASE_PERCENT
local NO_RETREAT_EVOLUTION_BONUS_MAX = constants.NO_RETREAT_EVOLUTION_BONUS_MAX
local NO_RETREAT_SQUAD_SIZE_BONUS_MAX = constants.NO_RETREAT_SQUAD_SIZE_BONUS_MAX

local CONFIG_ATTACK_WAVE_MAX_SIZE = config.attackWaveMaxSize
local CONFIG_ATTACK_WAVE_MAX_SIZE = settings.startup["rampant-attackWaveMaxSize"].value

local AI_MAX_BITER_GROUP_SIZE = constants.AI_MAX_BITER_GROUP_SIZE

Expand Down
42 changes: 30 additions & 12 deletions locale/en/locale.cfg
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@


[entity-name]
tunnel-entrance = Tunnel Entrance
tunnel-entrance=Tunnel Entrance

small-suicide-biter = Small Suicide Biter
medium-suicide-biter = Medium Suicide Biter
big-suicide-biter = Big Suicide Biter
behemoth-suicide-biter = Behemoth Suicide Biter
small-suicide-biter=Small Suicide Biter
medium-suicide-biter=Medium Suicide Biter
big-suicide-biter=Big Suicide Biter
behemoth-suicide-biter=Behemoth Suicide Biter

small-fire-spitter = Small Fire Spitter
small-fire-spitter=Small Fire Spitter

[entity-description]
tunnel-entrance = This tunnel is used by the biters to bypass player defenses. Fill the hole using landfill.
tunnel-entrance=This tunnel is used by the biters to bypass player defenses. Fill the hole using landfill.

small-suicide-biter = These biters will explode at close range
medium-suicide-biter = These biters will explode at close range
big-suicide-biter = These biters will explode at close range
behemoth-suicide-biter = These biters will explode at close range
small-suicide-biter=These biters will explode at close range
medium-suicide-biter=These biters will explode at close range
big-suicide-biter=These biters will explode at close range
behemoth-suicide-biter=These biters will explode at close range

small-fire-spitter = These biters will spit fire
small-fire-spitter=These biters will spit fire

[mod-setting-name]
rampant-useDumbProjectiles=Use Dumb Projectiles
rampant-useNEUnitLaunchers=Use Natural Evolution Unit Launchers (Needs NE)
rampant-attackWaveGenerationUsePollution=Use Pollution as attack trigger
rampant-attackWaveGenerationUsePlayerProximity=Use Player Proximity as attack trigger
rampant-attackWaveGenerationThresholdMax=Starting chunk attack threshold
rampant-attackWaveGenerationThresholdMin=Ending chunk attack threshold
rampant-attackWaveMaxSize=Max biter group size that can be directly formed

[mod-setting-description]
rampant-useDumbProjectiles=Turns off homing projectiles for worms and spitters
rampant-useNEUnitLaunchers=ONLY FOR USE WITH NATURAL EVOLUTION ENEMIES use the NE unit launchers with medium and big worms. if set to false this will still allow the dumb projectiles but without the unit spawning. A side effect of the dumb projectiles cause the units to be spawned as if two shots were fired
rampant-attackWaveGenerationUsePollution=Include pollution amount for threshold on chunks with biter nests that will generate a Rampant attack wave. DOES NOT affect vanilla biters waves
rampant-attackWaveGenerationUsePlayerProximity=Include player pheromones amount for threshold on chunks with biter nests that will generate a Rampant attack wave. DOES NOT affect vanilla biters waves
rampant-attackWaveGenerationThresholdMax=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (starting threshold @ 0.0 evolution)
rampant-attackWaveGenerationThresholdMin=The score that a chunk must reach in order for an attack wave to spawn. DOES NOT affect vanilla biters waves. Scaling linearly with evolution factor (ending threshold @ 100.0 evolution)
rampant-attackWaveMaxSize=If you wish to change how the attack wave scales with evolution you will need to modify the config.lua in the zip file.
2 changes: 2 additions & 0 deletions make.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
(string->path "data-updates.lua")
(string->path "LICENSE.md")
(string->path "tests.lua")
(string->path "settings.lua")
(string->path "README.md")
(string->path "NOTICE")
(string->path "libs")
Expand Down Expand Up @@ -64,6 +65,7 @@
(copyFile "info.json" modFolder)
(copyFile "data.lua" modFolder)
(copyFile "data-updates.lua" modFolder)
(copyFile "settings.lua" modFolder)
(copyFile "tests.lua" modFolder)
(copyDirectory "libs" modFolder)
(copyDirectory "locale" modFolder)
Expand Down
72 changes: 72 additions & 0 deletions settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
data:extend({

{
type = "bool-setting",
name = "rampant-useDumbProjectiles",
description = "rampant-useDumbProjectiles",
setting_type = "startup",
default_value = true,
order = "a[modifier]-a[projectiles]",
per_user = false
},

{
type = "bool-setting",
name = "rampant-useNEUnitLaunchers",
setting_type = "startup",
default_value = true,
order = "a[modifier]-b[projectiles]",
per_user = false
},

{
type = "bool-setting",
name = "rampant-attackWaveGenerationUsePollution",
setting_type = "startup",
default_value = true,
order = "b[modifier]-a[trigger]",
per_user = false
},

{
type = "bool-setting",
name = "rampant-attackWaveGenerationUsePlayerProximity",
setting_type = "startup",
default_value = true,
order = "b[modifier]-b[trigger]",
per_user = false
},

{
type = "double-setting",
name = "rampant-attackWaveGenerationThresholdMax",
setting_type = "startup",
minimum_value = 0,
default_value = 20,
order = "c[modifier]-b[threshold]",
per_user = false
},

{
type = "double-setting",
name = "rampant-attackWaveGenerationThresholdMin",
setting_type = "startup",
minimum_value = 0,
default_value = 0,
order = "c[modifier]-a[threshold]",
per_user = false
},

{
type = "int-setting",
name = "rampant-attackWaveMaxSize",
setting_type = "startup",
minimum_value = 20,
maximum_value = 250,
default_value = 150,
order = "d[modifier]-a[wave]",
per_user = false
}


})

0 comments on commit dae6da6

Please sign in to comment.