Fixes a critical bug: undeployed MCV vans now count for short-game survival — previously every match ended at tick 1 (all players 'defeated', local player 'won'). The bot-vs-bot shellmap claim from earlier rounds was invalid for the same reason: shellmaps stall with Bot: players and matches insta-ended. The arena map + tools/balance_report.py is the real, verified harness. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
41 lines
1.3 KiB
Lua
41 lines
1.3 KiB
Lua
WorldLoaded = function()
|
|
print("BAL script loaded")
|
|
for _, p in ipairs(Player.GetPlayers(nil)) do
|
|
Trigger.OnPlayerWon(p, function(pl) print("BAL WON: "..pl.InternalName) end)
|
|
Trigger.OnPlayerLost(p, function(pl) print("BAL LOST: "..pl.InternalName) end)
|
|
end
|
|
end
|
|
|
|
-- Balance telemetry: logs bot economy/army every ~10s to lua.log.
|
|
-- Read with: grep BAL ~/Library/Application Support/OpenRA/Logs/lua.log
|
|
local tick = 0
|
|
local dead = {}
|
|
|
|
Tick = function()
|
|
tick = tick + 1
|
|
if tick <= 3 then print("BAL tick "..tick) end
|
|
if tick == 251 then print("BAL reached 251") end
|
|
if tick % 250 ~= 0 then
|
|
return
|
|
end
|
|
local bots = Player.GetPlayers(function(p) return p.InternalName == "BotA" or p.InternalName == "BotB" end)
|
|
for _, p in ipairs(bots) do
|
|
local units, buildings = 0, 0
|
|
for _, a in ipairs(Map.ActorsInWorld) do
|
|
if a.Owner == p then
|
|
if a.HasProperty("Move") then
|
|
units = units + 1
|
|
else
|
|
buildings = buildings + 1
|
|
end
|
|
end
|
|
end
|
|
print(string.format("BAL t=%d %s cash=%d stored=%d units=%d buildings=%d",
|
|
tick, p.InternalName, p.Cash, p.Resources, units, buildings))
|
|
if units + buildings == 0 and not dead[p.InternalName] then
|
|
dead[p.InternalName] = true
|
|
print(string.format("BAL t=%d %s ELIMINATED", tick, p.InternalName))
|
|
end
|
|
end
|
|
end
|