Page 1 of 1
1x1 Casualties widget
Posted: 02 Apr 2012, 18:26
by Anarchid
So i finally made that little piece of lua that counts how much stuff you lose and how much stuff you kill. It has a lot of limits, though:
- any (enemy) unit that dies within your los counts as kill. No matter the cause.
- any kills that occur outside of los as such (i.e, on radar) don't count (i didn't try hard enough, though i think it should be possible to identify radar blips to units if those units were los-sighted before going radar-only)
- and if in ony other way you find yourself an ally, expect things to go gebork.
Also, it needs chili. So basically is limited to gundam, evo, and zk 1x1 games.
I'm just going to leave this here in case anyone wants it.
Re: 1x1 Casualties widget
Posted: 02 Apr 2012, 18:42
by smoth
why not make it a gadget, then you won't have the los restriction?
Re: 1x1 Casualties widget
Posted: 02 Apr 2012, 19:10
by Anarchid
Obvious, i want to use it when playing ZK games :D
It's an user-side widget, in other words, not game-designer one.
Re: 1x1 Casualties widget
Posted: 02 Apr 2012, 19:26
by smoth
Lol, no worries, I can see that as a good reason.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 00:05
by luckywaldo7
Sorry to keep semi-off-topic-ing this direction, but I would love you if you made a gadget version. Particularly I am interested in getting quick stats when I'm watching replays of games I lose, to see where I stand eco-wise or army-wise.
Some interesting stats would probably current resource income, total resource income, current army value, current damage dealt, and the like.
Also useful for commentators. :D
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 03:49
by smoth
waldo the gadget would have to be a part of said game..
gundam already has that. I just have not done the scoreboard yet.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 04:09
by luckywaldo7
Good thing I have svn access then! :D
He could probably get access himself pretty easily if he pokes Licho.
Cool if its in Gundam though. You have a lot of nice things in there, especially chili, that I need to get around playing with anyway.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 04:41
by smoth
Feel free to ask for me to setup any kind of script.luaui calls for widget if you need em. I cannot promise I will add them but hey, I can try and accomodate.
Code: Select all
-- Spring.Echo("PassStats",team,
-- "playerKills[team]", playerKills[team],
-- "playerDeaths[team]", playerDeaths[team],
-- "playerDamageTaken[team]", playerDamageTaken[team],
-- "playerDamageDealt[team]", playerDamageDealt[team])
This is a block I eventually planned on working on sending. I have not YET covered these parts and planned on breaking them up into seperate calls but here you go, a few I have not finished yet
Code: Select all
playerScores[msg],
playerExperience[msg],
playerLevelRank[msg])
I have these already done and in the UI in the PassScores call if you wanted to know
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 07:49
by klapmongool
luckywaldo7 wrote:Sorry to keep semi-off-topic-ing this direction, but I would love you if you made a gadget version. Particularly I am interested in getting quick stats when I'm watching replays of games I lose, to see where I stand eco-wise or army-wise.
Some interesting stats would probably current resource income, total resource income, current army value, current damage dealt, and the like.
Also useful for commentators. :D
IceUI gives those stats and more. When you are a player from your entire team, when you are a spec from everyone.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 08:26
by Google_Frog
Spectators can see Widget:UnitDestroyed for all units so a spectator widget is fairly easy to do.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 10:16
by Anarchid
I wonder if there is any way to determine when a ghosted building was busted outside of LOS in a non-spectator widget-based way.
Also, does anyone know if radar blips and los-sighted units share same uID? Or to detect when blips get killed?
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 11:41
by Niobium
Anarchid wrote:I wonder if there is any way to determine when a ghosted building was busted outside of LOS in a non-spectator widget-based way.
Also, does anyone know if radar blips and los-sighted units share same uID? Or to detect when blips get killed?
You can use :UnitEntered/LeftRadar in the same manner as :UnitEntered/LeftLos to track radar dot death. You'd also need to add some unit def id storage if you want to do anything like costing when a radar dot dies.
uID = Unit Id. Specific to unit, never changes.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 11:44
by Licho
Tbh i would like some sort of general "stats" like economy comparison or combat performace so far..
yes it gives away some information but i think it could improve gameplay - especially in FFA (and make people quit sooner)
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 12:51
by Anarchid
uID = Unit Id. Specific to unit, never changes.
I guess then my idea was right, but i did it wrong. Less alcohol next time!
(my suspicions were that maybe blips don't have uid's of full units, or that radar-callins would not detect kills. going to try enhancement this week)
On a side note, does that mean that if an unit was once spotted by LOS and then after a long delay emerges from some other point in space as a radar blip, we get to know it's unit type?
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 15:10
by Niobium
Anarchid wrote:On a side note, does that mean that if an unit was once spotted by LOS and then after a long delay emerges from some other point in space as a radar blip, we get to know it's unit type?
Yes. This is what ghost radar uses.
Re: 1x1 Casualties widget
Posted: 03 Apr 2012, 17:44
by CarRepairer
Before you say it, yes it's considered a bug. Here's a suggestion I once gave to fix it. I can still hope it's implemented one day.
http://springrts.com/phpbb/viewtopic.ph ... 60#p411160
Re: 1x1 Casualties widget
Posted: 04 Apr 2012, 11:18
by Johannes
The game end screen already has pretty exhaustive stats - how doable would it be to bring that screen to spectators midgame? By widget or engine change, I don't care. Players ofc shouldn't get it.
Re: 1x1 Casualties widget
Posted: 04 Apr 2012, 14:31
by smoth
It can be done, no one wants to.
Re: 1x1 Casualties widget
Posted: 04 Apr 2012, 22:01
by Beherith
Code: Select all
Spring.GetTeamResources
( number teamID, string "metal" | "energy" ) ->
nil | number currentLevel,
number storage,
number pull,
number income,
number expense,
number share,
number sent,
number received
Spring.GetTeamUnitStats
( number teamID ) ->
nil | number killed,
number died,
number capturedBy,
number capturedFrom,
number received,
number sent
Spring.GetTeamResourceStats 0.82 and later
( number teamID, string "metal" | "energy" ) ->
nil | number used,
number produced,
number excessed,
number received,
number sent
Spring.GetTeamStatsHistory
( number teamID [, number startIndex [, number endIndex = startIndex ]]) ->
nil |
number cur_max_index |
{
[1] = {
"time" = number,
"frame" = number,
"metalUsed" = number,
"metalProduced" = number,
"metalExcess" = number,
"metalReceived" = number,
"metalSent" = number,
"energyUsed" = number,
"energyProduced" = number,
"energyExcess" = number,
"energyReceived" = number,
"energySent" = number,
"damageDealt" = number,
"damageReceived" = number,
"unitsProduced" = number,
"unitsDied" = number,
"unitsReceived" = number,
"unitsSent" = number,
"unitsCaptured" = number,
"unitsOutCaptured" = number,
"unitsKilled" = number
}, ...
}
if called with just teamID as argument it returns the current possible range for startIndex/endIndex :={1..cur_max_index}
Re: 1x1 Casualties widget
Posted: 04 Apr 2012, 22:45
by Jools
Licho wrote:Tbh i would like some sort of general "stats" like economy comparison or combat performace so far..
Why don't you use Ecostats? It does just that: compares m and e income, army hp, buildpower ... on team basis. It even has one player mode and one spectator mode.
http://widgets.springrts.de/index.php#193
Not saying you can't make more versions of it though, more is always more.