1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-11 14:49:32 +02:00

see changelog

This commit is contained in:
Aaron Veden 2019-03-27 20:55:13 -07:00
parent eb9cabb11d
commit 5f47b0a645
7 changed files with 225 additions and 87 deletions

View File

@ -1,3 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 0.17.11
Date: 3. 27. 2019
Improvements:
- Changed new enemy unit spawning probabilities to follow a gaussian distribution over the level of the nest, so lower level nest spawn lower level enemies longer.
- Increased new enemy building spacing
Tweaks:
- Added a collision box reduction to all nests and worm turrets of 50% on the mod setting Enable the Swarm.
---------------------------------------------------------------------------------------------------
Version: 0.17.10
Date: 3. 17. 2019

View File

@ -86,8 +86,39 @@ if settings.startup["rampant-enableSwarm"] then
}
end
end
for k, unit in pairs(data.raw["unit-spawner"]) do
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
unit.collision_box = {
{unit.collision_box[1][1] * 0.50, unit.collision_box[1][2] * 0.50},
{unit.collision_box[2][1] * 0.50, unit.collision_box[2][2] * 0.50}
}
end
end
for k, unit in pairs(data.raw["turret"]) do
if string.find(k, "worm") and unit.collision_box then
unit.collision_box = {
{unit.collision_box[1][1] * 0.50, unit.collision_box[1][2] * 0.50},
{unit.collision_box[2][1] * 0.50, unit.collision_box[2][2] * 0.50}
}
end
end
-- local obj = data.raw["container"]["chunk-scanner-nest-rampant"]
-- obj.collision_box = {
-- {obj.collision_box[1][1] * 0.70, obj.collision_box[1][2] * 0.70},
-- {obj.collision_box[2][1] * 0.70, obj.collision_box[2][2] * 0.70}
-- }
-- obj = data.raw["container"]["chunk-scanner-worm-rampant"]
-- obj.collision_box = {
-- {obj.collision_box[1][1] * 0.70, obj.collision_box[1][2] * 0.70},
-- {obj.collision_box[2][1] * 0.70, obj.collision_box[2][2] * 0.70}
-- }
end
if settings.startup["rampant-addWallResistanceAcid"].value then
vanillaBuildings.addWallAcidResistance()
end

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "0.17",
"version" : "0.17.10",
"version" : "0.17.11",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -13,6 +13,8 @@ local bobsUnits = require("BobsBaseUtils")
-- constants
local BUILDING_SPACE_LOOKUP = constants.BUILDING_SPACE_LOOKUP
local MAGIC_MAXIMUM_NUMBER = constants.MAGIC_MAXIMUM_NUMBER
local BASE_AI_STATE_DORMANT = constants.BASE_AI_STATE_DORMANT
@ -141,6 +143,7 @@ local BASE_QUEUE_SIZE = constants.BASE_QUEUE_SIZE
local BASE_COLLECTION_THRESHOLD = constants.BASE_COLLECTION_THRESHOLD
local CHUNK_SIZE = constants.CHUNK_SIZE
local CHUNK_AND_HALF_SIZE = constants.CHUNK_AND_HALF_SIZE
local EVOLUTION_INCREMENTS = constants.EVOLUTION_INCREMENTS
@ -395,12 +398,10 @@ function baseUtils.upgradeEntity(entity, surface, baseAlignment, natives, evolut
if spawnerName then
entity.destroy()
local newPosition = surface.find_non_colliding_position(
spawnerName,
-- ((entityType == "unit-spawner") and "chunk-scanner-nest-rampant") or
-- "chunk-scanner-worm-rampant",
BUILDING_SPACE_LOOKUP[spawnerName],
position,
CHUNK_SIZE,
2,
1,
true
)
if newPosition then

View File

@ -71,6 +71,7 @@ constants.PLAYER_PHEROMONE_MULTIPLER = 2500
-- chunk properties
constants.CHUNK_SIZE = 32
constants.CHUNK_AND_HALF_SIZE = constants.CHUNK_SIZE * 1.5
constants.DOUBLE_CHUNK_SIZE = constants.CHUNK_SIZE * 2
constants.TRIPLE_CHUNK_SIZE = constants.CHUNK_SIZE * 3
constants.HALF_CHUNK_SIZE = constants.CHUNK_SIZE / 2
@ -725,6 +726,64 @@ constants.POISON_WORM_VARIATIONS = wormVariations
constants.POISON_UNIT_TIERS = unitTiers
constants.POISON_UNIT_VARIATIONS = unitVariations
constants.BUILDING_SPACE_LOOKUP = {}
for t = 1, 10 do
local wormTier = t + 1
for v = 1, 20 do
constants.BUILDING_SPACE_LOOKUP["neutral-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["neutral-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["neutral-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["acid-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["acid-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["acid-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["physical-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["physical-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["electric-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["electric-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["suicide-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["suicide-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["nuclear-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["nuclear-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fire-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fire-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fire-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["inferno-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["inferno-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["troll-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["troll-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["troll-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fast-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fast-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["fast-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["laser-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["laser-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["laser-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["wasp-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["wasp-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["spawner-spitter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["spawner-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["energy-thief-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["energy-thief-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["poison-biter-nest-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. t .. "-nest-rampant"
constants.BUILDING_SPACE_LOOKUP["poison-worm-v" .. v .. "-t" .. t .. "-rampant"] = "chunk-scanner-" .. wormTier .. "-nest-rampant"
end
end
constantsG = constants
return constants

View File

@ -28,6 +28,8 @@ local TIER_NAMING_SET_5 = constants.TIER_NAMING_SET_5
local xorRandom = mathUtils.xorRandom(settings.startup["rampant-enemySeed"].value)
local gaussianRandomRangeRG = mathUtils.gaussianRandomRangeRG
local makeBiterCorpse = biterUtils.makeBiterCorpse
local makeUnitSpawnerCorpse = biterUtils.makeUnitSpawnerCorpse
local makeWormCorpse = biterUtils.makeWormCorpse
@ -1184,7 +1186,7 @@ local function addWormDefaults(template, upgrades)
end
local function unitSetToProbabilityTable(upgradeTable, unitSet)
local function unitSetToProbabilityTable(upgradeTable, unitSet, tier)
local dividers = {}
for i=1,#unitSet do
@ -1194,9 +1196,18 @@ local function unitSetToProbabilityTable(upgradeTable, unitSet)
if upgradeTable then
local points = #unitSet * 2
for _=1,points do
local index = mFloor(xorRandom() * #unitSet)+1
local index
if (tier == 1) then
index = mFloor(gaussianRandomRangeRG(tier, 1.3, 1, 2.5, xorRandom))
else
index = mFloor(gaussianRandomRangeRG(tier, 2, tier * 0.5, mMin(tier * 1.4, #unitSet), xorRandom)+1)
end
-- local index = mFloor(xorRandom() * #unitSet)+1
local upgrade = upgradeTable[index]
-- print(tier, index)
dividers[index] = dividers[index] + upgrade
end
end
@ -1243,7 +1254,7 @@ local function unitSetToProbabilityTable(upgradeTable, unitSet)
else
result = {
{
((i - 2) > 0 and dividers[i-2]) or 0,
((i - 2) > 0 and dividers[i-2]) or (dividers[i-1] * 0.3),
0
},
{
@ -1268,7 +1279,7 @@ local function unitSetToProbabilityTable(upgradeTable, unitSet)
result[#result+1] = {unitSet[i][x], probability}
end
end
return result
end
@ -1572,7 +1583,8 @@ function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, v
local unitSpawner = deepcopy(templates.unitSpawner)
unitSpawner.name = unitSpawner.name .. "-v" .. i .. "-t" .. t
local unitTable = unitSetToProbabilityTable(upgradeTable.probabilityTable,
unitSet)
unitSet,
tier)
generateApperance(unitSpawner, ut)
unitSpawner.type = "spawner"
upgradeEntity(unitSpawner, upgradeTable.unitSpawner, ut)
@ -1594,6 +1606,8 @@ function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, v
end
end
-- ent()
end
function swarmUtils.buildWorm(template, upgradeTable, attackGenerator, variations, tiers)

View File

@ -1,4 +1,6 @@
data:extend({
{
type = "container",
@ -75,81 +77,103 @@ data:extend({
circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
circuit_connector_sprites = circuit_connector_definitions["chest"].sprites,
circuit_wire_max_distance = default_circuit_wire_max_distance
}-- ,
-- {
-- type = "container",
-- name = "chunk-scanner-nest-rampant",
-- icon = "__base__/graphics/icons/wooden-chest.png",
-- icon_size = 32,
-- flags = {},
-- collision_mask = {"player-layer", "object-layer", "water-tile"},
-- collision_box = {{-6, -6}, {6, 6}},
-- selection_box = {{-6, -6}, {6, 6}},
-- minable = {mining_time = 1, result = "wooden-chest"},
-- max_health = 100,
-- corpse = "small-remnants",
-- fast_replaceable_group = "container",
-- inventory_size = 16,
-- open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
-- close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
-- vehicle_impact_sound = { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
-- picture =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
-- priority = "extra-high",
-- width = 32,
-- height = 36,
-- shift = util.by_pixel(0.5, -2),
-- hr_version =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/hr-wooden-chest.png",
-- priority = "extra-high",
-- width = 62,
-- height = 72,
-- shift = util.by_pixel(0.5, -2),
-- scale = 0.5
-- }
-- },
-- circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
-- circuit_connector_sprites = circuit_connector_definitions["chest"].sprites,
-- circuit_wire_max_distance = default_circuit_wire_max_distance
-- },
-- {
-- type = "container",
-- name = "chunk-scanner-worm-rampant",
-- icon = "__base__/graphics/icons/wooden-chest.png",
-- icon_size = 32,
-- flags = {},
-- collision_mask = {"player-layer", "object-layer", "water-tile"},
-- collision_box = {{-3, -3}, {3, 3}},
-- selection_box = {{-3, -3}, {3, 3}},
-- minable = {mining_time = 1, result = "wooden-chest"},
-- max_health = 100,
-- corpse = "small-remnants",
-- fast_replaceable_group = "container",
-- inventory_size = 16,
-- open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
-- close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
-- vehicle_impact_sound = { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
-- picture =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
-- priority = "extra-high",
-- width = 32,
-- height = 36,
-- shift = util.by_pixel(0.5, -2),
-- hr_version =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/hr-wooden-chest.png",
-- priority = "extra-high",
-- width = 62,
-- height = 72,
-- shift = util.by_pixel(0.5, -2),
-- scale = 0.5
-- }
-- },
-- circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
-- circuit_connector_sprites = circuit_connector_definitions["chest"].sprites,
-- circuit_wire_max_distance = default_circuit_wire_max_distance
-- }
}
})
local scales = {
[1] = 0.7,
[2] = 0.8,
[3] = 0.9,
[4] = 1,
[5] = 1.1,
[6] = 1.2,
[7] = 1.3,
[8] = 1.4,
[9] = 1.5,
[10] = 1.6,
[11] = 1.7
}
for t=1,11 do
local scale = scales[t] * 1.5
data:extend(
{
{
type = "container",
name = "chunk-scanner-" .. t .. "-nest-rampant",
icon = "__base__/graphics/icons/wooden-chest.png",
icon_size = 32,
flags = {},
collision_mask = {"player-layer", "object-layer", "water-tile"},
collision_box = {{-3 * scale, -2 * scale}, {2 * scale, 2 * scale}},
selection_box = {{-6, -6}, {6, 6}},
minable = {mining_time = 1, result = "wooden-chest"},
max_health = 100,
corpse = "small-remnants",
fast_replaceable_group = "container",
inventory_size = 16,
open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
vehicle_impact_sound = { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
picture =
{
filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
priority = "extra-high",
width = 32,
height = 36,
shift = util.by_pixel(0.5, -2),
hr_version =
{
filename = "__base__/graphics/entity/wooden-chest/hr-wooden-chest.png",
priority = "extra-high",
width = 62,
height = 72,
shift = util.by_pixel(0.5, -2),
scale = 0.5
}
},
circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
circuit_connector_sprites = circuit_connector_definitions["chest"].sprites,
circuit_wire_max_distance = default_circuit_wire_max_distance
}-- ,
-- {
-- type = "container",
-- name = "chunk-scanner-" .. t .. "-worm-rampant",
-- icon = "__base__/graphics/icons/wooden-chest.png",
-- icon_size = 32,
-- flags = {},
-- collision_mask = {"player-layer", "object-layer", "water-tile"},
-- collision_box = {{-1.1 * scale, -1 * scale}, {1.1 * scale, 1 * scale}},
-- selection_box = {{-3, -3}, {3, 3}},
-- minable = {mining_time = 1, result = "wooden-chest"},
-- max_health = 100,
-- corpse = "small-remnants",
-- fast_replaceable_group = "container",
-- inventory_size = 16,
-- open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
-- close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
-- vehicle_impact_sound = { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
-- picture =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
-- priority = "extra-high",
-- width = 32,
-- height = 36,
-- shift = util.by_pixel(0.5, -2),
-- hr_version =
-- {
-- filename = "__base__/graphics/entity/wooden-chest/hr-wooden-chest.png",
-- priority = "extra-high",
-- width = 62,
-- height = 72,
-- shift = util.by_pixel(0.5, -2),
-- scale = 0.5
-- }
-- },
-- circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
-- circuit_connector_sprites = circuit_connector_definitions["chest"].sprites,
-- circuit_wire_max_distance = default_circuit_wire_max_distance
-- }
}
)
end