Loading...
  OR  Zero-K Name:    Password:   

Combat Outcome predictor widget

4 posts, 302 views
Post comment
Filter:    Player:  
sort
You will need the other 2 widgets for this one to run. enemy intel and build proposer.
The prediction is mode based on a counter matric that was built with online information .
Select ur army and the friendly units around it are counted in the prediction against the enemies surrounding them.

the widget (there are settings to play around with in hud panels/engagement predictor. if you can suggest a default setting for the range at which the widget looks at units that would be nice)

widget (put it in luaui/widgets)
https://pastebin.com/RmXiQT6s

Screenshot of the panel (you can disable all the extra information and only have it tell you the victory probability)
https://imgur.com/a/AyslEoy
+1 / -1
Interesting.
I haven't looked through the whole code but this seems counterintuitive:

quote:
-- Metal, discounted by how much of the unit is left. A Minotaur down to a third of its
-- health is not a third of a Minotaur in a fight, but it is a great deal less than one,
-- and counting it whole is the error that makes a losing push look winnable.
local function UnitValue(unitID, defID)
local base = (spuGetUnitCost and spuGetUnitCost(unitID, defID)) or cost[defID] or 0
local hp, maxHp = spGetUnitHealth(unitID)
if hp and maxHp and maxHp > 0 then
local frac = hp / maxHp
if frac < 0.05 then
frac = 0.05
elseif frac > 1 then
frac = 1
end
return base * frac
end
return base
end



The description does not actually do what is says.
Can't it just be simplified to:
(hp / maxHP) * unitCost
?

Also in what situation does the game return more HP than maxHP and why shouldn't it be accounted for?
+0 / -0

46 days ago
i'll be honest i vibe coded this widget with claude and i don't know what the answer is.
+2 / -0


46 days ago
Ok. Good to know! :-)
+3 / -0