It is currently Wed Jun 19, 2013 9:11 pm




Post new topic Reply to topic  [ 8 posts ] 
Kill counting 
Author Message
The Nameless Mod
The Nameless Mod

Joined: Mon Apr 26, 2004 1:54 am
Posts: 1276
Location: Perth, Western Australia
Post Kill counting
The question has arisen multiple times as to how to accurately determine how lethal the player has been. As I see it there are two possible approaches. Which to people prefer? Can people think of additional pros/cons. Note that this mechanism is entirely unrelated to the conedit interface.

1) Increment a counter every time there is a death for which the player is the killer. This was suggested by nick (it sounds obvious but its not the way IS did it). DDL has already written a function which detects deaths so it would simply be a question of modifying this function to determine the correct flag (code already exists to do this) and increment it.

Pros:
- Simple
- Dynamic (i.e. flag always contains the correct value)

Cons:
- In order to determine percentage of people killed you still need to know how many people there were originally which requires you to count living pawns. You get this count practically for free with the second method.
- Doesn't consider Alginon kills e.g. dropping a crate of tnt on someone (or killing an unconscious body). As such it has the potential to understate kills.
- Could get messy for special pawns (like Athena who can die multiple times).

2) Count living pawns on map exit and subtract from original living pawns to determine killed pawns. Carcii for which the killer is not the player or which are unconscious add to the living pawn count.

Pros:
- Already implemented

Cons:
- Kinda messy
- Only correct for a given map if the player is currently not in that map.
- Gets very messy (and possibly impossible) to handle pawns that leave the map through alternative means (e.g. the leaving state).
- If it cannot determine who killed a pawn (e.g. if the pawn was gibbed) it considers them to be killed by the player. As such it is likely to overstate the player kills.


Wed Aug 06, 2008 10:17 am
Profile
Off Topic Productions
Off Topic Productions
User avatar

Joined: Sat Apr 24, 2004 9:21 pm
Posts: 13868
Location: Hafnia
Post 
Well, the pro on that second method is a very big pro.

But I'd say let it depend on how much work is involved in making the current system ignore pawns that leave without dying. A possible complication with any such fix is that some pawns are set to leave the map when they're fleeing, which means we can't always depend on pre-defined exceptions. But I'm not sure any pawns are set to that in maps we count kills on.

If you think it'd be easier to implement system 1 rather than fix system 2, go ahead.

Regardless of what you choose, you have to make it absolutely clear to me how the ConEdit interface works, because I can't figure out if it counts more than, less than, more than or equal to, or less than or equal to. It's a mess.

_________________
Jonas Wæver
Chief Poking Manager of TNM

Random Outbursts of Creativity


Wed Aug 06, 2008 3:07 pm
Profile WWW
Traditional Evil Scientist
Traditional Evil Scientist

Joined: Mon Oct 17, 2005 10:03 am
Posts: 3656
Post 
You could always alter state leaving so that instead of destroying themselves they just leaveworld() or something similar.

Basically, you've already got your own pawn class, and it's really easy to distinguish between a pawn wandering off and being destroyed and a pawn taking damage, spawning a carcass and being destroyed.


Also, I already wrote a function which detects deaths? I did? I mean, I might've done (god knows I'm losing track) but I suspect I'm being given credit for someone else's work... :D


Wed Aug 06, 2008 3:18 pm
Profile
Off Topic Productions
Off Topic Productions
User avatar

Joined: Sat Apr 24, 2004 9:21 pm
Posts: 13868
Location: Hafnia
Post 
Well I'm no programmer, but that does sound like a pretty good solution!

_________________
Jonas Wæver
Chief Poking Manager of TNM

Random Outbursts of Creativity


Wed Aug 06, 2008 3:23 pm
Profile WWW
Traditional Evil Scientist
Traditional Evil Scientist

Joined: Mon Oct 17, 2005 10:03 am
Posts: 3656
Post 
Also, for the former suggestion, it's also really easy to check a carcass's killerbindname/killer/killeralliance when it transitions from bNotDead to..well, dead: if they're not the same as the intigator of the damage that caused the transition..then oop: change em to reflect the fact that no matter WHO KO'd the carcass, it was THIS person that actually killed them.

Oh, and regarding killing people with crates (or TNT crates), doesn't the game store the instigator of the deco, and deliver the damage as if it were instigated by them?

And if so, simply make sure the instigator of a crate flying through the air en route to some poor firewalls cranium is..the person who flung the crate.


Wed Aug 06, 2008 3:36 pm
Profile
The Nameless Mod
The Nameless Mod

Joined: Mon Apr 26, 2004 1:54 am
Posts: 1276
Location: Perth, Western Australia
Post 
Well technically the function already existed you just overrode it as part of the custom difficulty code.

I should point out that the not already implemented method is so trivial to implement it could almost be considered implemented.

You can detect pawns being destroyed through means other than being killed however the easiest way to do it is probably to just count them when they -are- killed. I'm not sure how difficult it would be to adjust the leaving state. I would assume not very though you don't really have the already implemented advantage when you start to modify it.

I had considered the instigator thing and I'm not honestly sure what happens. I suspect however that it would be possible to rig it so you're not the instigator.


Wed Aug 06, 2008 4:21 pm
Profile
The Nameless Mod
The Nameless Mod

Joined: Mon Apr 26, 2004 1:54 am
Posts: 1276
Location: Perth, Western Australia
Post 
I've looked into it and it looks like you're right about damage the player is indirectly responsible for.


Wed Aug 06, 2008 4:28 pm
Profile
Off Topic Productions
Off Topic Productions
User avatar

Joined: Sat Apr 24, 2004 9:21 pm
Posts: 13868
Location: Hafnia
Post 
Christ, well I dunno. Just fix it ;)

_________________
Jonas Wæver
Chief Poking Manager of TNM

Random Outbursts of Creativity


Wed Aug 06, 2008 6:24 pm
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


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 © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.