mirror of
https://github.com/veden/Rampant.git
synced 2025-03-21 21:17:26 +02:00
adding max consecutive wanders to squads
This commit is contained in:
parent
47e20864e1
commit
15c140b728
@ -11,6 +11,7 @@ Date: 23. 11. 2021
|
|||||||
- Optimized regional base upgrades so that the work is spread over many ticks reducing lag spikes
|
- Optimized regional base upgrades so that the work is spread over many ticks reducing lag spikes
|
||||||
- Optimized adding new chunks to the Rampant in-memory state map
|
- Optimized adding new chunks to the Rampant in-memory state map
|
||||||
- Added minimum building cost upgrade check before base upgrade performs scanning
|
- Added minimum building cost upgrade check before base upgrade performs scanning
|
||||||
|
- Added max number of wander commands in a row for squads that aren't going anywhere before disbanding squad
|
||||||
- Optimized energy thief faction
|
- Optimized energy thief faction
|
||||||
- Factorissimo, Space Exploration Orbits, asteroid belts, secret maps, starmap, AAI-signal, NiceFill, Blueprint lab surfaces are no longer processed
|
- Factorissimo, Space Exploration Orbits, asteroid belts, secret maps, starmap, AAI-signal, NiceFill, Blueprint lab surfaces are no longer processed
|
||||||
- Map processing around player now changes to the surface the player is standing on
|
- Map processing around player now changes to the surface the player is standing on
|
||||||
|
@ -364,8 +364,13 @@ function squadAttack.cleanSquads(map, tick)
|
|||||||
end
|
end
|
||||||
squads[groupId] = nil
|
squads[groupId] = nil
|
||||||
elseif (group.state == 4) then
|
elseif (group.state == 4) then
|
||||||
|
squad.wanders = 0
|
||||||
squadAttack.squadDispatch(map, squad, tick)
|
squadAttack.squadDispatch(map, squad, tick)
|
||||||
elseif (squad.commandTick and (squad.commandTick < tick)) then
|
elseif (squad.commandTick and (squad.commandTick < tick)) then
|
||||||
|
if squad.wanders > 5 then
|
||||||
|
squad.group.destroy()
|
||||||
|
else
|
||||||
|
squad.wanders = squad.wanders + 1
|
||||||
local cmd = map.universe.wander2Command
|
local cmd = map.universe.wander2Command
|
||||||
squad.commandTick = tick + COMMAND_TIMEOUT
|
squad.commandTick = tick + COMMAND_TIMEOUT
|
||||||
group.set_command(cmd)
|
group.set_command(cmd)
|
||||||
@ -373,6 +378,7 @@ function squadAttack.cleanSquads(map, tick)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function squadAttack.squadDispatch(map, squad, tick)
|
function squadAttack.squadDispatch(map, squad, tick)
|
||||||
local group = squad.group
|
local group = squad.group
|
||||||
|
@ -83,6 +83,7 @@ function unitGroupUtils.createSquad(position, surface, group, settlers)
|
|||||||
penalties = {},
|
penalties = {},
|
||||||
base = nil,
|
base = nil,
|
||||||
frenzy = false,
|
frenzy = false,
|
||||||
|
wanders = 0,
|
||||||
settlers = settlers or false,
|
settlers = settlers or false,
|
||||||
kamikaze = false,
|
kamikaze = false,
|
||||||
frenzyPosition = {x = 0,
|
frenzyPosition = {x = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user