mirror of
https://github.com/veden/Rampant.git
synced 2024-12-26 20:54:12 +02:00
RC1 Build
This commit is contained in:
parent
a945c69b95
commit
3638ab19f9
@ -12,6 +12,8 @@ Date: 16. 4 2020
|
||||
- Refactored calculateKamikazeThreshold based on member count and current evolution
|
||||
- Reduced enemy unit lost contribution to AI state to 0.001
|
||||
- Reduced RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX to 190000
|
||||
- Removed lite mode setting
|
||||
- Removed disable vanilla ai setting
|
||||
Bugfixes:
|
||||
- fixed add movement penalty not using squad chunk
|
||||
- fixed landfill and waterfill getting registered properly
|
||||
|
@ -59,7 +59,7 @@ local processPheromone = pheromoneUtils.processPheromone
|
||||
local commitPheromone = pheromoneUtils.commitPheromone
|
||||
local playerScent = pheromoneUtils.playerScent
|
||||
|
||||
local getDeathGenerator = chunkPropertyUtils
|
||||
local getDeathGenerator = chunkPropertyUtils.getDeathGenerator
|
||||
local processBase = baseUtils.processBase
|
||||
|
||||
local processNestActiveness = chunkPropertyUtils.processNestActiveness
|
||||
|
@ -48,46 +48,29 @@ function movementUtils.addMovementPenalty(map, squad, chunk)
|
||||
if (chunk == -1) then
|
||||
return
|
||||
end
|
||||
-- addDeathGenerator(map, chunk, DOUBLE_DEATH_PHEROMONE_GENERATOR_AMOUNT * 10)
|
||||
-- if squad.settlers then
|
||||
-- chunk[RESOURCE_PHEROMONE] = chunk[RESOURCE_PHEROMONE] * 0.1
|
||||
-- else
|
||||
-- chunk[BASE_PHEROMONE] = chunk[BASE_PHEROMONE] * 0.1
|
||||
-- end
|
||||
|
||||
|
||||
-- local penalties = squad.penalties
|
||||
-- for i=1,#penalties do
|
||||
-- local penalty = penalties[i]
|
||||
-- if (penalty.c == chunk) then
|
||||
-- penalty.v = (2 * penalty.v) + MOVEMENT_PENALTY_AMOUNT
|
||||
-- -- if (penalty.v >= MOVEMENT_PENALTY_AMOUNT * 10) then
|
||||
-- print("movementThreshold", squad.group.group_number, penalty.v, squad.settlers, squad.kamikaze, squad.status)
|
||||
-- -- squad.kamikaze = true
|
||||
-- -- end
|
||||
-- return
|
||||
-- end
|
||||
-- end
|
||||
-- if (#penalties == 7) then
|
||||
-- tableRemove(penalties, 7)
|
||||
-- end
|
||||
-- tableInsert(penalties,
|
||||
-- 1,
|
||||
-- { v = MOVEMENT_PENALTY_AMOUNT,
|
||||
-- c = chunk })
|
||||
local penalties = squad.penalties
|
||||
local penaltyCount = #penalties
|
||||
for i=1,penaltyCount do
|
||||
local penalty = penalties[i]
|
||||
if (penalty.c == chunk) then
|
||||
penalty.v = ((penaltyCount > 1) and penalty.v + 1) or penalty.v
|
||||
if (penalty.v > 2) then
|
||||
-- print("movementThreshold", #penalties, squad.group.group_number, penalty.v, squad.settlers, squad.kamikaze, squad.status)
|
||||
-- game.players[1].teleport(chunk, game.surfaces[1])
|
||||
squad.kamikaze = true
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
if (penaltyCount == 7) then
|
||||
tableRemove(penalties, 7)
|
||||
end
|
||||
tableInsert(penalties,
|
||||
1,
|
||||
{ v = 1,
|
||||
c = chunk })
|
||||
end
|
||||
|
||||
-- function movementUtils.lookupMovementPenalty(squad, chunk)
|
||||
-- local penalties = squad.penalties
|
||||
-- for i=1,#penalties do
|
||||
-- local penalty = penalties[i]
|
||||
-- if (penalty.c == chunk) then
|
||||
-- return penalty.v
|
||||
-- end
|
||||
-- end
|
||||
-- return 0
|
||||
-- end
|
||||
|
||||
--[[
|
||||
Expects all neighbors adjacent to a chunk
|
||||
--]]
|
||||
|
@ -146,6 +146,7 @@ local function settleMove(map, squad, surface)
|
||||
end
|
||||
addDeathGenerator(map, chunk, TEN_DEATH_PHEROMONE_GENERATOR_AMOUNT)
|
||||
addSquadToChunk(map, chunk, squad)
|
||||
addMovementPenalty(map, squad, chunk)
|
||||
local distance = euclideanDistancePoints(groupPosition.x,
|
||||
groupPosition.y,
|
||||
squad.originPosition.x,
|
||||
@ -272,6 +273,7 @@ local function attackMove(map, squad, surface)
|
||||
local squadChunk = squad.chunk
|
||||
addDeathGenerator(map, squadChunk, TEN_DEATH_PHEROMONE_GENERATOR_AMOUNT)
|
||||
addSquadToChunk(map, chunk, squad)
|
||||
addMovementPenalty(map, squad, chunk)
|
||||
squad.frenzy = (squad.frenzy and (euclideanDistanceNamed(groupPosition, squad.frenzyPosition) < 100))
|
||||
local attackChunk, attackDirection, nextAttackChunk, nextAttackDirection = scoreNeighborsForAttack(map,
|
||||
chunk,
|
||||
|
@ -109,6 +109,7 @@ function unitGroupUtils.createSquad(position, surface, group, settlers)
|
||||
group = unitGroup,
|
||||
status = SQUAD_GUARDING,
|
||||
rabid = false,
|
||||
penalties = {},
|
||||
frenzy = false,
|
||||
settlers = settlers or false,
|
||||
kamikaze = false,
|
||||
|
Loading…
Reference in New Issue
Block a user