mirror of
https://github.com/veden/Rampant.git
synced 2025-02-05 13:14:51 +02:00
see changelog
This commit is contained in:
parent
f7c99d03ab
commit
8843b973af
15
Upgrade.lua
15
Upgrade.lua
@ -403,13 +403,14 @@ function upgrade.attempt(universe)
|
||||
|
||||
universe.maxPoints = 0
|
||||
|
||||
if (universe.maps) then
|
||||
for _,map in pairs(universe.maps) do
|
||||
for _,base in pairs(map.bases) do
|
||||
base.damagedBy = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
-- if (universe.maps) then
|
||||
-- for _,map in pairs(universe.maps) do
|
||||
-- for _,base in pairs(map.bases) do
|
||||
-- base.damagedBy = {}
|
||||
-- base.deathEvents = 0
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
game.print("Rampant - Version 1.0.10")
|
||||
end
|
||||
|
@ -1,8 +1,6 @@
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.0.10
|
||||
Date: 29. 04. 2021
|
||||
Features:
|
||||
- Added new enemies adaptation to damage type that kills them. So if you kill biters with physical damage you will start seeing biters that are resistant to physical damage.
|
||||
Improvements:
|
||||
- Increased ai baseline point accumulation based on temperament
|
||||
Tweaks:
|
||||
@ -14,6 +12,7 @@ Date: 29. 04. 2021
|
||||
- Increased siege chance at max ai temperament by 25%
|
||||
- Decreased settler cost to ai by 33%
|
||||
- Increased base ai min and max duration by ~x1.8
|
||||
- Increased biter base point gain by x3.5
|
||||
Bugfixes:
|
||||
- Settlers not spawning as they should do to incorrect weighting on spawn locations
|
||||
- Fixed new enemies factions not mutating or upgrading structures overtime
|
||||
|
48
control.lua
48
control.lua
@ -468,17 +468,19 @@ local function onDeath(event)
|
||||
if (entityType == "unit") then
|
||||
if (chunk ~= -1) and event.force and (event.force.name ~= "enemy") then
|
||||
|
||||
local group = entity.unit_group
|
||||
if group then
|
||||
local damageType = event.damage_type
|
||||
local squad = map.groupNumberToSquad[group.group_number]
|
||||
if squad then
|
||||
local base = squad.base
|
||||
if base then
|
||||
base.damagedBy[damageType] = (base.damagedBy[damageType] or 0) + 0.01
|
||||
end
|
||||
end
|
||||
end
|
||||
-- local group = entity.unit_group
|
||||
-- if group then
|
||||
-- local damageType = event.damage_type
|
||||
-- local squad = map.groupNumberToSquad[group.group_number]
|
||||
-- if squad then
|
||||
-- local base = squad.base
|
||||
-- if base then
|
||||
-- base.damagedBy[damageType] = (base.damagedBy[damageType] or 0) + 0.01
|
||||
-- base.deathEvents = base.deathEvents + 1
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- drop death pheromone where unit died
|
||||
deathScent(map, chunk)
|
||||
|
||||
@ -818,12 +820,12 @@ local function onUnitGroupCreated(event)
|
||||
squad = createSquad(nil, nil, group, settler)
|
||||
map.groupNumberToSquad[group.group_number] = squad
|
||||
|
||||
if universe.NEW_ENEMIES then
|
||||
local chunk = getChunkByPosition(map, group.position)
|
||||
if (chunk ~= -1) then
|
||||
squad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- local chunk = getChunkByPosition(map, group.position)
|
||||
-- if (chunk ~= -1) then
|
||||
-- squad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
if settler then
|
||||
universe.builderCount = universe.builderCount + 1
|
||||
@ -850,12 +852,12 @@ local function onUnitGroupCreated(event)
|
||||
squad = createSquad(nil, nil, group, settler)
|
||||
map.groupNumberToSquad[group.group_number] = squad
|
||||
|
||||
if universe.NEW_ENEMIES then
|
||||
local chunk = getChunkByPosition(group.position)
|
||||
if (chunk ~= -1) then
|
||||
squad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- local chunk = getChunkByPosition(group.position)
|
||||
-- if (chunk ~= -1) then
|
||||
-- squad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
if settler then
|
||||
universe.builderCount = universe.builderCount + 1
|
||||
|
@ -225,9 +225,9 @@ function aiAttackWave.formSettlers(map, chunk)
|
||||
universe.formCommand.unit_count = scaledWaveSize
|
||||
local foundUnits = surface.set_multi_command(universe.formCommand)
|
||||
if (foundUnits > 0) then
|
||||
if universe.NEW_ENEMIES then
|
||||
squad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- squad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
squad.kamikaze = mRandom() < calculateKamikazeThreshold(foundUnits, universe)
|
||||
universe.builderCount = universe.builderCount + 1
|
||||
map.points = map.points - AI_SETTLER_COST
|
||||
@ -272,9 +272,9 @@ function aiAttackWave.formVengenceSquad(map, chunk)
|
||||
universe.formCommand.unit_count = scaledWaveSize
|
||||
local foundUnits = surface.set_multi_command(universe.formCommand)
|
||||
if (foundUnits > 0) then
|
||||
if universe.NEW_ENEMIES then
|
||||
squad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- squad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
squad.kamikaze = mRandom() < calculateKamikazeThreshold(foundUnits, universe)
|
||||
map.groupNumberToSquad[squad.groupNumber] = squad
|
||||
universe.squadCount = universe.squadCount + 1
|
||||
@ -320,9 +320,9 @@ function aiAttackWave.formSquads(map, chunk, tick)
|
||||
universe.formCommand.unit_count = scaledWaveSize
|
||||
local foundUnits = surface.set_multi_command(universe.formCommand)
|
||||
if (foundUnits > 0) then
|
||||
if universe.NEW_ENEMIES then
|
||||
squad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- squad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
squad.kamikaze = mRandom() < calculateKamikazeThreshold(foundUnits, universe)
|
||||
map.points = map.points - AI_SQUAD_COST
|
||||
universe.squadCount = universe.squadCount + 1
|
||||
|
@ -113,7 +113,7 @@ function aiPlanning.planning(map, evolution_factor, tick)
|
||||
|
||||
points = points * universe.aiPointsScaler
|
||||
|
||||
map.baseIncrement = points
|
||||
map.baseIncrement = points * 3.5
|
||||
|
||||
local currentPoints = map.points
|
||||
|
||||
|
@ -16,9 +16,7 @@ local FACTION_MUTATION_MAPPING = constants.FACTION_MUTATION_MAPPING
|
||||
|
||||
local MAGIC_MAXIMUM_NUMBER = constants.MAGIC_MAXIMUM_NUMBER
|
||||
|
||||
local BASE_AI_STATE_DORMANT = constants.BASE_AI_STATE_DORMANT
|
||||
local BASE_AI_STATE_ACTIVE = constants.BASE_AI_STATE_ACTIVE
|
||||
local BASE_AI_STATE_OVERDRIVE = constants.BASE_AI_STATE_OVERDRIVE
|
||||
local BASE_AI_STATE_MUTATE = constants.BASE_AI_STATE_MUTATE
|
||||
|
||||
local FACTION_SET = constants.FACTION_SET
|
||||
@ -100,6 +98,8 @@ function baseUtils.findNearbyBase(map, chunk)
|
||||
end
|
||||
end
|
||||
|
||||
-- print("base found", foundBase)
|
||||
|
||||
return foundBase
|
||||
end
|
||||
|
||||
@ -334,7 +334,6 @@ end
|
||||
|
||||
function baseUtils.processBase(chunk, map, tick, base)
|
||||
if not base.alignment[1] then
|
||||
base.state = BASE_AI_STATE_DORMANT
|
||||
return
|
||||
end
|
||||
|
||||
@ -345,7 +344,10 @@ function baseUtils.processBase(chunk, map, tick, base)
|
||||
point.x = chunk.x + (CHUNK_SIZE * mRandom())
|
||||
point.y = chunk.y + (CHUNK_SIZE * mRandom())
|
||||
|
||||
if (base.state ~= BASE_AI_STATE_MUTATE) then
|
||||
local upgradeRoll = mRandom()
|
||||
if ((base.state == BASE_AI_STATE_MUTATE) and (upgradeRoll < 0.02)) or
|
||||
((base.state == BASE_AI_STATE_ACTIVE) and (upgradeRoll < 0.1))
|
||||
then
|
||||
local entities = surface.find_entities_filtered(universe.filteredEntitiesPointQueryLimited)
|
||||
if #entities ~= 0 then
|
||||
local entity = entities[1]
|
||||
@ -359,34 +361,33 @@ function baseUtils.processBase(chunk, map, tick, base)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
end
|
||||
|
||||
-- if (base.deathEvents > 1000) then
|
||||
if (upgradeRoll > 0.95) then
|
||||
if (base.points >= BASE_UPGRADE) then
|
||||
if upgradeBase(map, base) then
|
||||
base.points = base.points - BASE_UPGRADE
|
||||
end
|
||||
end
|
||||
end
|
||||
-- base.damagedBy = {}
|
||||
-- base.deathEvents = 0
|
||||
-- end
|
||||
|
||||
if (base.state == BASE_AI_STATE_OVERDRIVE) then
|
||||
base.points = base.points + (map.baseIncrement * 5)
|
||||
else
|
||||
base.points = base.points + map.baseIncrement
|
||||
end
|
||||
base.points = base.points + map.baseIncrement
|
||||
|
||||
if (base.points > universe.maxPoints) then
|
||||
base.points = universe.maxPoints
|
||||
end
|
||||
|
||||
print(serpent.dump(base.damagedBy))
|
||||
|
||||
base.damagedBy = {}
|
||||
-- print("baseStats", base.points, base.state, base.deathEvents-- , serpent.dump(base.damagedBy)
|
||||
-- )
|
||||
|
||||
if (base.stateTick <= tick) then
|
||||
local roll = mRandom()
|
||||
if (roll < 0.70) then
|
||||
if (roll < 0.85) then
|
||||
base.state = BASE_AI_STATE_ACTIVE
|
||||
elseif (roll < 0.965) then
|
||||
base.state = BASE_AI_STATE_OVERDRIVE
|
||||
else
|
||||
base.state = BASE_AI_STATE_MUTATE
|
||||
end
|
||||
|
@ -521,10 +521,11 @@ function chunkUtils.unregisterEnemyBaseStructure(map, entity, damageType)
|
||||
setNestActiveness(map, chunk, 0)
|
||||
end
|
||||
setFunc(map, chunk, 0)
|
||||
local base = getChunkBase(map, chunk)
|
||||
if base then
|
||||
base.damagedBy[damageType] = (base.damagedBy[damageType] or 0) + 1
|
||||
end
|
||||
-- local base = getChunkBase(map, chunk)
|
||||
-- if base then
|
||||
-- base.damagedBy[damageType] = (base.damagedBy[damageType] or 0) + 1
|
||||
-- base.deathEvents = base.deathEvents + 1
|
||||
-- end
|
||||
if (getEnemyStructureCount(map, chunk) == 0) then
|
||||
setChunkBase(map, chunk, nil)
|
||||
end
|
||||
|
@ -115,9 +115,9 @@ function aiDefense.retreatUnits(chunk, cause, map, tick, radius)
|
||||
end
|
||||
|
||||
if created then
|
||||
if universe.NEW_ENEMIES then
|
||||
newSquad.base = findNearbyBase(map, chunk)
|
||||
end
|
||||
-- if universe.NEW_ENEMIES then
|
||||
-- newSquad.base = findNearbyBase(map, chunk)
|
||||
-- end
|
||||
map.groupNumberToSquad[newSquad.groupNumber] = newSquad
|
||||
universe.squadCount = universe.squadCount + 1
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user