View topic - 1x1 Casualties widget



All times are UTC + 1 hour


Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: 1x1 Casualties widget
PostPosted: 02 Apr 2012, 17:26 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
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.


Attachments:
File comment: the wupget itself
attrition.lua [2.99 KiB]
Downloaded 99 times
Top
 Offline Profile  
 
PostPosted: 02 Apr 2012, 17:42 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
why not make it a gadget, then you won't have the los restriction?


Top
 Offline Profile  
 
PostPosted: 02 Apr 2012, 18:10 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
Obvious, i want to use it when playing ZK games :D

It's an user-side widget, in other words, not game-designer one.


Top
 Offline Profile  
 
PostPosted: 02 Apr 2012, 18:26 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Lol, no worries, I can see that as a good reason.


Top
 Offline Profile  
 
PostPosted: 02 Apr 2012, 23:05 

Joined: 17 Sep 2008, 03:36
Location: your imagination
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


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 02:49 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
waldo the gadget would have to be a part of said game..

gundam already has that. I just have not done the scoreboard yet.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 03:09 

Joined: 17 Sep 2008, 03:36
Location: your imagination
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.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 03:41 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
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:
            -- 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:
playerScores[msg],
playerExperience[msg],
playerLevelRank[msg])

I have these already done and in the UI in the PassScores call if you wanted to know


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 06:49 

Joined: 13 Aug 2007, 12:19
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.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 07:26 
Moderator

Joined: 12 Oct 2007, 08:24
Spectators can see Widget:UnitDestroyed for all units so a spectator widget is fairly easy to do.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 09:16 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
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?


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 10:41 
User avatar

Joined: 07 Dec 2008, 02:35
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.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 10:44 
Server Owner & Developer
User avatar

Joined: 19 May 2006, 18:13
Location: Brno, Czech rep., EU, Terra, Sol, Orion arm, Milky way, Virgo supercluster
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)


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 11:51 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
Quote:
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?


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 14:10 
User avatar

Joined: 07 Dec 2008, 02:35
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.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 16:44 
Cursed Zero-K Developer
User avatar

Joined: 07 Nov 2007, 21:48
Location: Horse
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. viewtopic.php?p=411160#p411160


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 10:18 
User avatar

Joined: 17 Sep 2010, 14:49
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.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 13:31 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
It can be done, no one wants to.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 21:01 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Code:
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}


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 21:45 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
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.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.