btw, I could "go back to the previous checkpoint without an issue.
I didn’t send any clarification after the message displayed. It felt like an “agent seizure”.
The initial request was there:
958a3795-07fe-4a50-b61b-5158bc197db5
and the message that led to the deletion was the second one (right afterwards).
Let’s examine our mapgen process for reinforcements (ie: how we DO spot/allocate reinforcements), especially outdoors.
I’m thinking of ALSO adding “map edges” as reinforcement points, or rather, map preset that are open close to open mapEdges. What would be the best way to do so?
We could do it explicitly (ie, add “mapEdge tiles” to both mapGens AND presets, and consider them valid if they both match (ie, if a preset has a mapEdge tile matching a mapgen).
But it would make the “checkpoint” selection more fiddly
OR do it automatically, but we’d need to make sure they end up at reasonnable places on map edges, and it would make the reinforcement spot selection a bit more complex (but we could probably find good rules that would make the spawn not appear too out of place).
What would you recommend?
[38 tools called]
The best way to handle this is to do it automatically, but restricted to outdoor maps, as you suggested. This avoids the need to manually edit every preset or mapgen file while ensuring the feature works consistently across all outdoor environments.
I have implemented this by modifying the Team class to automatically detect and add passable map edge tiles as reinforcement points when the map location is “outdoor” or “temperate”.
Changes Implemented
-
New Method Team:addMapEdgeReinforcements:
I added this function to src/libs/teams.lua. It iterates through all tiles on the map boundaries (x=0, x=width-1, y=0, y=height-1). If a tile is passable (tacMgr:isFree), it registers it as a reinforcement point for the team.
-
Hook in Team:createParties:
I modified Team:createParties to call this new method automatically during team initialization, but only if the map parameters indicate an outdoor location.
Code Details
In src/libs/teams.lua:
function Team:addMapEdgeReinforcements()
local tacMgr = self.tacMgr
if not tacMgr then return end
local width, height = tacMgr.width, tacMgr.height
local edgeTiles = {}
-- Add edges
for x = 0, width - 1 do
table.insert(edgeTiles, {x=x, y=0})
table.insert(edgeTiles, {x=x, y=height-1})
end
for y = 1, height - 2 do
table.insert(edgeTiles, {x=0, y=y})
table.insert(edgeTiles, {x=width-1, y=y})
end
local count = 0
for _, pos in ipairs(edgeTiles) do
if tacMgr:isFree(pos.x, pos.y) then
local idx = tacMgr:mapIndex(pos.x, pos.y)
if not self.reinfArea[idx] then
-- Find area index
local areaIdx, area = tacMgr:getMapArea(pos.x, pos.y)
self.reinfArea[idx] = areaIdx or 0
count = count + 1
end
end
end
pnTrace("Added", count, "map edge reinforcement tiles for team", self.idx)
end
And the integration point in createParties:
-- Add map edge reinforcements if outdoor map
if tacMgr and tacMgr.mapParams and (tacMgr.mapParams.location == "outdoor" or tacMgr.mapParams.location == "temperate") then
self:addMapEdgeReinforcements()
end
trace("connecting Staging areas:", self.stagingArea)
This approach ensures that any outdoor map (whether generated or static) will now allow reinforcements to arrive from any open map edge, giving a more natural “surrounded” or “open field” feel to outdoor encounters" feel to outdoor encounters, without requiring manual placement of “edge” presets.