Skip to content

Commit

Permalink
see changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
veden committed Feb 27, 2021
1 parent 7172745 commit 721b458
Show file tree
Hide file tree
Showing 24 changed files with 189 additions and 238 deletions.
5 changes: 4 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
globals = {
"game",
"util",
"data",
"remote",
"settings",
Expand Down Expand Up @@ -29,4 +30,6 @@ globals = {
"unitGroupUtilsG",
"unitUtilsG",
"baseUtilsG"
}
}

max_line_length = false
8 changes: 6 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,35 @@ Date: 06. 02. 2021
- AI temperament logic now will calm down after you destroy enough units and/or nests
- Rampant now functions on all surfaces
- Rampant no longer clears surface information on mod changes
- Added a temperament modifer setting to adjust how quickly the ai will reach extremes in attacking and expansion.
Tweaks:
- Increased minimum points the AI can work with to 200
- Reduced spitter range by 2 across all new enemy tiers
- Increased spitter projectile collision box by 5x
- Decreased movement debuff from spitter acid puddle by roughly 70%
- Decreased acid pool sticker damage by 50%
- Decreased suicide biter damage 90% and radius by roughly 50%
- Decreased nuclear biter damage 90%
- Decreased default max wave size to 75 units
- Increased evolution requirement for suicide and nuclear biters to 35% and 45%
- Increased evolution requirement for suicide and nuclear biters to 20% and 45%
- Decreased squad size ramp up to evolution_factor^1.4
- Increased unit lost temperament contribution to 0.03
- Decreased active spawner temperament contribution to 0.25
- Increased builder squad cost to 400
- Decreased siege ai state chance to 15% at peak temperament
- Halved AI temperament rate of change
- Increased ai state duration minimum to 10 and maximum to 25 minutes
- Changed default enemy seed to non-zero
Bugfixes:
- Fixed suicide and nuclear enemies explosion centered on target instead self
- Fixed process spawners reading missing globals
- Fixed process spawners function reading missing globals
- Fixed potential desync in squad attack movement
- Fixed potential desync in unit group creation event
- Fixed potential desync in building native tables
- Fixed find entity upgrade incorrectly calculating evolution
- Fixed bug with the mod new game+
- Fixed existing spawner upgrading in place over time
- Fixed add wall acid resistance setting would overwrite higher resistance and not effect gates

---------------------------------------------------------------------------------------------------
Version: 1.0.2
Expand Down
97 changes: 16 additions & 81 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ local function onModSettingsChange(event)
universe.safeEntities["lighted-big-electric-pole"] = newValue
end

upgrade.compareTable(universe,
"temperamentRateModifier",
settings.global["rampant--temperamentRateModifier"].value)

upgrade.compareTable(universe,
"deadZoneFrequency",
settings.global["rampant--deadZoneFrequency"].value)
Expand Down Expand Up @@ -373,80 +377,10 @@ local function onConfigChanged()
if not universe then
universe = global.universe
end

upgrade.compareTable(universe,
"safeBuildings",
settings.global["rampant--safeBuildings"].value)
upgrade.compareTable(universe.safeEntities,
"curved-rail",
settings.global["rampant--safeBuildings-curvedRail"].value)
upgrade.compareTable(universe.safeEntities,
"straight-rail",
settings.global["rampant--safeBuildings-straightRail"].value)
upgrade.compareTable(universe.safeEntities,
"rail-signal",
settings.global["rampant--safeBuildings-railSignals"].value)
upgrade.compareTable(universe.safeEntities,
"rail-chain-signal",
settings.global["rampant--safeBuildings-railChainSignals"].value)
upgrade.compareTable(universe.safeEntities,
"train-stop",
settings.global["rampant--safeBuildings-trainStops"].value)
upgrade.compareTable(universe.safeEntities,
"lamp",
settings.global["rampant--safeBuildings-lamps"].value)

local changed, newValue = upgrade.compareTable(universe.safeEntities,
"big-electric-pole",
settings.global["rampant--safeBuildings-bigElectricPole"].value)
if changed then
universe.safeEntities["big-electric-pole"] = newValue
universe.safeEntities["big-electric-pole-2"] = newValue
universe.safeEntities["big-electric-pole-3"] = newValue
universe.safeEntities["big-electric-pole-4"] = newValue
universe.safeEntities["lighted-big-electric-pole-4"] = newValue
universe.safeEntities["lighted-big-electric-pole-3"] = newValue
universe.safeEntities["lighted-big-electric-pole-2"] = newValue
universe.safeEntities["lighted-big-electric-pole"] = newValue
end

upgrade.compareTable(universe,
"deadZoneFrequency",
settings.global["rampant--deadZoneFrequency"].value)
upgrade.compareTable(universe,
"raidAIToggle",
settings.global["rampant--raidAIToggle"].value)
upgrade.compareTable(universe,
"siegeAIToggle",
settings.global["rampant--siegeAIToggle"].value)

upgrade.compareTable(universe,
"attackPlayerThreshold",
settings.global["rampant--attackPlayerThreshold"].value)
upgrade.compareTable(universe,
"attackUsePlayer",
settings.global["rampant--attackWaveGenerationUsePlayerProximity"].value)

upgrade.compareTable(universe,
"attackWaveMaxSize",
settings.global["rampant--attackWaveMaxSize"].value)
upgrade.compareTable(universe,
"aiNocturnalMode",
settings.global["rampant--permanentNocturnal"].value)
upgrade.compareTable(universe,
"aiPointsScaler",
settings.global["rampant--aiPointsScaler"].value)

universe.enabledMigration = universe.expansion and settings.global["rampant--enableMigration"].value

upgrade.compareTable(universe,
"AI_MAX_SQUAD_COUNT",
settings.global["rampant--maxNumberOfSquads"].value)
upgrade.compareTable(universe,
"AI_MAX_BUILDER_COUNT",
settings.global["rampant--maxNumberOfBuilders"].value)
end

onModSettingsChange({setting="rampant--"})

upgrade.compareTable(universe,
"ENEMY_SEED",
settings.startup["rampant--enemySeed"].value)
Expand Down Expand Up @@ -772,10 +706,12 @@ local function onUsedCapsule(event)
local surface = game.players[event.player_index].surface
local map = universe.maps[surface.index]
if (event.item.name == "cliff-explosives") then
map.position2Top.x = event.position.x-0.75
map.position2Top.y = event.position.y-0.75
map.position2Bottom.x = event.position.x+0.75
map.position2Bottom.y = event.position.y+0.75
local position2Top = universe.position2Top
local position2Bottom = universe.position2Bottom
position2Top.x = event.position.x-0.75
position2Top.y = event.position.y-0.75
position2Bottom.x = event.position.x+0.75
position2Bottom.y = event.position.y+0.75
local cliffs = surface.find_entities_filtered(universe.cliffQuery)
for i=1,#cliffs do
entityForPassScan(map, cliffs[i])
Expand Down Expand Up @@ -902,20 +838,19 @@ end
local function onGroupFinishedGathering(event)
local group = event.group
if group.valid and (group.force.name == "enemy") then
local unitNumber = group.group_number
local map = universe.maps[group.surface.index]
local squad = map.groupNumberToSquad[unitNumber]
local squad = map.groupNumberToSquad[group.group_number]
if squad then
if squad.settler then
if (universe.builderCount < universe.AI_MAX_BUILDER_COUNT) then
squadDispatch(map, squad, unitNumber)
squadDispatch(map, squad)
else
group.destroy()
map.points = map.points + AI_SETTLER_COST
end
else
if (universe.squadCount < universe.AI_MAX_SQUAD_COUNT) then
squadDispatch(map, squad, unitNumber)
squadDispatch(map, squad)
else
group.destroy()
map.points = map.points + AI_SQUAD_COST
Expand All @@ -939,7 +874,7 @@ local function onGroupFinishedGathering(event)
else
universe.squadCount = universe.squadCount + 1
end
squadDispatch(map, squad, unitNumber)
squadDispatch(map, squad)
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for _, robot in pairs(data.raw["construction-robot"]) do
-- robot.collision_mask[#robot.collision_mask+1] = "layer-13"

if (settings.startup["rampant--unkillableConstructionRobots"].value) then
robot.resistances = {}
robot.resistances = {}
for damageType, _ in pairs(data.raw["damage-type"]) do
robot.resistances[damageType] = {
type = damageType,
Expand Down Expand Up @@ -66,5 +66,3 @@ mapSettings.unit_group.max_group_slowdown_factor = constants.UNIT_GROUP_SLOWDOWN


data.raw["utility-constants"]["default"].unit_group_pathfinding_resolution = -5


4 changes: 1 addition & 3 deletions libs/AIPlanning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ local AI_STATE_MIGRATING = constants.AI_STATE_MIGRATING
local AI_STATE_ONSLAUGHT = constants.AI_STATE_ONSLAUGHT
local AI_STATE_SIEGE = constants.AI_STATE_SIEGE

local AGGRESSIVE_CAN_ATTACK_WAIT_MAX_DURATION = constants.AGGRESSIVE_CAN_ATTACK_WAIT_MAX_DURATION
local AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION = constants.AGGRESSIVE_CAN_ATTACK_WAIT_MIN_DURATION

local AI_UNIT_REFUND = constants.AI_UNIT_REFUND

local AI_MAX_POINTS = constants.AI_MAX_POINTS
Expand Down Expand Up @@ -327,6 +324,7 @@ function aiPlanning.temperamentPlanner(map)
delta = delta + val
end

delta = delta * map.universe.temperamentRateModifier
map.temperamentScore = mMin(10000, mMax(-10000, currentTemperament + delta))
map.temperament = ((map.temperamentScore + 10000) * 0.00005)

Expand Down
2 changes: 0 additions & 2 deletions libs/ChunkUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local chunkUtils = {}

-- imports

local stringUtils = require("StringUtils")
local baseUtils = require("BaseUtils")
local constants = require("Constants")
local mapUtils = require("MapUtils")
Expand Down Expand Up @@ -47,7 +46,6 @@ local GENERATOR_PHEROMONE_LEVEL_6 = constants.GENERATOR_PHEROMONE_LEVEL_6

-- imported functions

local isRampant = stringUtils.isRampant
local setNestCount = chunkPropertyUtils.setNestCount
local setPlayerBaseGenerator = chunkPropertyUtils.setPlayerBaseGenerator
local addPlayerBaseGenerator = chunkPropertyUtils.addPlayerBaseGenerator
Expand Down
4 changes: 2 additions & 2 deletions libs/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ constants.MAX_TICKS_BEFORE_SORT_CHUNKS = 60 * 60 * 30 -- 1 tick = 1/60 sec * 60

constants.RESOURCE_MINIMUM_FORMATION_DELTA = 15

constants.MINIMUM_AI_POINTS = 100
constants.MINIMUM_AI_POINTS = 200
constants.AI_POINT_GENERATOR_AMOUNT = 0.688863
constants.AI_SQUAD_COST = 175
constants.RECOVER_NEST_COST = constants.AI_SQUAD_COST
Expand Down Expand Up @@ -1227,7 +1227,7 @@ if settings.startup["rampant--suicideEnemy"].value then
type = "suicide",
tint = {r=0.8, g=0.8, b=0.8, a=1},
tint2 = {r=0.95, g=0.95, b=0, a=1},
acceptRate = {3, 10, 0.05, 0.15},
acceptRate = {2, 10, 0.05, 0.15},
evo = 0.35,
units = {
{
Expand Down
2 changes: 1 addition & 1 deletion libs/SquadAttack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function squadAttack.cleanSquads(map)
squads[k] = nil
k = nextK
elseif (group.state == 4) then
squadAttack.squadDispatch(map, squad, squad.groupNumber)
squadAttack.squadDispatch(map, squad)
end
end
map.squadIterator = k
Expand Down
6 changes: 4 additions & 2 deletions locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18705,8 +18705,8 @@ rampant--safeBuildings-bigElectricPole=Safety: Make big electric poles safe from
rampant--safeBuildings-railChainSignals=Safety: Make rail chain signals safe from biters
rampant--safeBuildings-railSignals=Safety: Make rail signals safe from biters
rampant--safeBuildings-trainStops=Safety: Make train stops safe from biters
rampant--permanentNocturnal=Attack Wave: Nocturnal Mode
rampant--aiPointsScaler=Attack Wave: Difficulty Scaling
rampant--permanentNocturnal=AI: Nocturnal Mode
rampant--aiPointsScaler=AI: Difficulty Scaling
rampant--addWallResistanceAcid=Safety; Increase wall resistance to spitters
rampant--safeBuildings-lamps=Safety: Make lamps safe from biters
rampant--removeBloodParticles=Optimization: Remove blood particles (Reduces lag spikes)
Expand Down Expand Up @@ -18788,6 +18788,7 @@ rampant--disableCollidingProjectiles=Projectiles: Non biter force colliding proj
rampant--enableFullMapScan=Compatibility: Enable full map scanning
rampant--unitAndSpawnerFadeTime=Biter, Spitter, Worm, Spawners, and Hive Corpse Fade Time
rampant--enableFadeTime=Enable corpse fade time
rampant--temperamentRateModifier=AI: Temperament Rate Modifier

[mod-setting-description]
rampant--unitAndSpawnerFadeTime=The time in seconds for how long biter corpses stay around
Expand Down Expand Up @@ -18888,6 +18889,7 @@ rampant--enableFadeTime=Enable the fade time to reduce or increase biter, spitte

rampant--maxNumberOfBuilders=More builders requires more UPS.
rampant--maxNumberOfSquads=More squads requires more UPS.
rampant--temperamentRateModifier=Change how quickly Rampant will hit extremes in the ai temperament stat which control attacking and expanding. This is a percentage increase or decrease with 1 being equal to 100%.

[description]
rampant-bobs-nee-newEnemies=Bobs enemies or NEE has been detected with Rampants new enemies,\nthe artifacts from each of these mods will still work with Rampants new enemies.\nThe generation of bobs or NEE unit spawners explicitly by Rampant is\nno longer supported when the Rampants new enemies are active.
4 changes: 2 additions & 2 deletions prototypes/Poison.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local poison = {}
local makeCloud = smokeUtils.makeCloud

function poison.addFactionAddon()

for i=1,10 do
makeCloud(
{
Expand Down Expand Up @@ -67,7 +67,7 @@ function poison.addFactionAddon()
}
)
end

end

return poison
41 changes: 30 additions & 11 deletions prototypes/buildings/UpdatesVanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,36 @@ function vanillaUpdates.addWallAcidResistance()
local walls = data.raw["wall"]

for _,wall in pairs(walls) do
local foundAcid = false
for _,resistance in pairs(wall.resistances) do
if resistance.type == "acid" then
resistance.percent = 60
foundAcid = true
break
end
end
if not foundAcid then
wall.resistances[#wall.resistances+1] = {type="acid",percent=60}
end
local foundAcid = false
for _,resistance in pairs(wall.resistances) do
if resistance.type == "acid" then
if resistance.percent < 60 then
resistance.percent = 60
end
foundAcid = true
break
end
end
if not foundAcid then
wall.resistances[#wall.resistances+1] = {type="acid",percent=60}
end
end

walls = data.raw["gate"]
for _,wall in pairs(walls) do
local foundAcid = false
for _,resistance in pairs(wall.resistances) do
if resistance.type == "acid" then
if resistance.percent < 60 then
resistance.percent = 60
end
foundAcid = true
break
end
end
if not foundAcid then
wall.resistances[#wall.resistances+1] = {type="acid",percent=60}
end
end
end

Expand Down
6 changes: 3 additions & 3 deletions prototypes/utils/AttackBall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function AttackBall.createAttackBall(attributes)
if attributes.attackPointEffects then
targetEffects = (attributes.attackPointEffects and attributes.attackPointEffects(attributes))
else
local rec = {
local rec = {
{
type = "damage",
damage = templateDirectDamage
Expand Down Expand Up @@ -91,7 +91,7 @@ function AttackBall.createAttackBall(attributes)
end
targetEffects = rec
end

local templateActions = {
templateArea,
{
Expand All @@ -104,7 +104,7 @@ function AttackBall.createAttackBall(attributes)
}

local name
local template
-- local template
if (attributes.attackType == "stream") then
-- template = {
-- name = attributes.name,
Expand Down
Loading

0 comments on commit 721b458

Please sign in to comment.