View topic - Gadget: player has taken the lead with xxx kills



All times are UTC + 1 hour


Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 21 Aug 2011, 07:12 

Joined: 16 Dec 2010, 14:44
You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death. Here's an implementation:
http://springfiles.com/spring/lua-scrip ... myallyself

For message broadcast (eg: "player A has taken lead!!") each widget could be modified to communicate with opposite team's widget to sync its value/correct-deviation... (much like how allyCursor widget communicate with each other). This ensure the value are same across player...


Top
 Offline Profile  
 
PostPosted: 21 Aug 2011, 13:21 
Moderator

Joined: 19 May 2009, 20:10
msafwan wrote:
You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death.

2 Problems:
Not all mods have visible wrecks. Wrecks can be made only visible if inside LOS.
Not all dead units leave a wreckage.


Top
 Offline Profile  
 
PostPosted: 21 Aug 2011, 13:24 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
gadget to count the kills, widget for display.
i think everything else is just messing around...


Top
 Offline Profile  
 
PostPosted: 22 Aug 2011, 15:47 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
Yes, the problem with a widget counting the kills is also that it gets reset when LuauI is reloaded, and some people do that sometimes.

Ofc there's also the spring internal method of getting kills/losses:

Code:
Spring.GetTeamUnitStats(TeamID)


But I don't recommend using that method, it doesn't count all kills, it counts kills of cancelled and unfinished units and it counts it as a loss when you place a dragon teeth for instance.

So the gadget that counts kills works well, but the widget side needs to be adjusted. But how does a widget and gadget communicate with each other? They need to be in the same file?


Last edited by Jools on 07 Sep 2011, 03:29, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 22 Aug 2011, 15:52 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
msafwan wrote:
You can count enemy unit death with metal wreckage. New wreck = new unit death, so filter wreck with 'allyID' to yield enemy unit death.


Interesting: so there is information in the wrecks about what player it belonged to?

This could still be interesting to my statistics widget. It is an widget so it doesnt have information on enemy deaths, but as you become spectator it fills up that information. Maybe using this widget could be more reliable that asking spring for a start value of a players deaths and kills (when you become spec or reload luaui).

Or even better, since the killcount isnt the best measure of efficiency, I'm trying to replace it with a killed-hp count, the maximum healt points of the units you have killed. Maybe this could come in handy there. killed-hp isnt a perfect measure either, but it's better than just kills or dealt damage imo.


Top
 Offline Profile  
 
PostPosted: 22 Aug 2011, 18:22 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Also wreck steps are skipped if the damage is high enough.


Top
 Offline Profile  
 
PostPosted: 23 Aug 2011, 00:18 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
But how does a widget and gadget communicate with each other?
Spring.SendLuaUIMsg
this is about something else but same technic:
http://answers.springlobby.info/questions/575/how-do-you-draw-a-widget-scorebox


Top
 Offline Profile  
 
PostPosted: 24 Aug 2011, 14:43 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
There's another way to do this also: use the UnitLeftLOS/Radar callins. If the unit disappeared ( unit position is nil) but it didnt leave radar or los, then it died.

But using a gadget and UnitDestroyed is probably best way still. However, does it catch indirect kills? I mean if I have 50 crawling bombs and someone kills one of them so that the others explode too?


Top
 Offline Profile  
 
PostPosted: 24 Aug 2011, 19:26 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Jools wrote:
There's another way to do this also: use the UnitLeftLOS/Radar callins. If the unit disappeared ( unit position is nil) but it didnt leave radar or los, then it died.
what happens on entering jammer, entering water, being transported, morphing?


Quote:
But using a gadget and UnitDestroyed is probably best way still.
yup.

Quote:
However, does it catch indirect kills? I mean if I have 50 crawling bombs and someone kills one of them so that the others explode too?
it gives you attackerID...
But yea, needs filtering ie if the unit was complete or just a construction that got destroyed or canceled.
I think dragonteeth trigger UnitDestroyed too etc


Top
 Offline Profile  
 
PostPosted: 24 Aug 2011, 20:43 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
knorke wrote:
what happens on entering jammer, entering water, being transported, morphing?

If jammed then spring will call UnitLeftLOS or -Radar, depending on where is was visible. Not sure about the others. When morphed the unit essentially dies and gets replaced by the morphed unit (new unitID).

Quote:
it gives you attackerID...

But is the attackerID the enemy or one of the chain exploded bombs?


Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 15:12 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
added a scoring system to grts this weekend. I have added the relevant parts of your kill tracking to it. why are you checking if a unit is completed or not before kill?


Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 15:18 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
why are you checking if a unit is completed or not before kill?
1% build unit gets destroyed -> counts as kill
canceling build process -> counts as kill
reclaiming a nano frame -> counts as kill
etc


Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 16:09 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
It seems we need to have a discussion about what is a kill, I didn't think there would be several views about it. Obviously, I don't think those things you mentioned are really kills.

If a tank is, say 1% complete, it's not really a tank yet, and it has no personnel, so if someone bombs it, how can that be counted as a kill? It also has no ability to defend itself (dunno if that's something we should consider).

If a planned construction is cancelled, then that's not a kill. There is no-one killing it. Same thing if something is reclaimed, then it 's reclaimed, not killed.

To me a kill happens when a unit gets destroyed in combat, be it either a military or a civilian one (although spring doesnt distiguish). But this debate is also higly philosophic, basically we need to decide when a unit is a unit. Maybe we can borrow some arguments from the abortion debate:)


Last edited by Jools on 06 Sep 2011, 20:25, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 18:01 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Canceled counts as a kill lol that is fukt up..

So what if it was aborted(killed in the factory)instead of miscarried(canceled)?

Seriously why is that a unit destroyed?


Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 20:31 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
How is unnit formed?


Top
 Offline Profile  
 
PostPosted: 06 Sep 2011, 20:35 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
Anyway, killed units is not the best measure of a player's success. I've started to use "killed hp" instead in my other widget, which means weighting the number of kills by the hp the unit has as 100% full health.

It's not perfect, but I think it's better than just "kills" or "damage dealt".


Top
 Offline Profile  
 
PostPosted: 07 Sep 2011, 00:32 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
I like kills though and plan on having that and damage dealt recorded. hell i want to record what you kill and how many, store it locally etc.

have all of it on a lol style leaderboard CUZ I CAN. etc.


Top
 Offline Profile  
 
PostPosted: 07 Sep 2011, 22:41 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
That's a nice idea, will be interesting so see how you lay it out graphically. Still, one life is also 1 life so kills is still a good way to count it. Or, whatever way you do it it's not gonna be perfect, because it's not better to kill 20 pyros than 1 goliath, for instance.

Here's how I formatted my kill stats:

Image


Top
 Offline Profile  
 
PostPosted: 08 Nov 2011, 17:23 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
I updated a little my gadget:
- Not counting spectator as players anymore
- Printing faction name as well
- Printing "AI" instead of "" for external AI. But reading the proper AI shortName would require a gadget<->widget communication, making the whole thing a bit more complex than just a gadget.

Edit: Thanks to [BoS]nixtux for telling me about a bug that made it crash when playing against AI.


Attachments:
File comment: Tis a gadget, not a widget.
taken_the_lead.lua [2.63 KiB]
Downloaded 106 times
Top
 Offline Profile  
 
PostPosted: 12 Jul 2012, 13:44 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
bump for knuckleheads in ba subforum.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2

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.