Hello There, Guest! Login or Register


Storing Death Information
#1



With the 0.3z release I was thinking it would be a good idea to store death information in the database:


killerProfileId (if any)
victimProfileId
deathReasonId - see http://wiki.sa-mp.com/wiki/Weapons - this can include the weapon used or the way the player died, eg drowned, splat, etc
timestamp
isLameKill - lame kills are defined as driveby shooting, carbomb killing or heli kills - this can just be a boolean.


I think this would be really interesting data to store. This would make it possible in the future to monitor things like favourite weapons, favourite/worst victim, etc.  It could unlock a lot of cool new features that could be added in the future like extra bonuses for killing worst enemies.


MrBondt was concerned that this is a lot of data to store so perhaps we could use this thread to discuss it.


EDIT: Maybe we could store the position of the death too
EDIT2: And bodypart
Reply
#2
I really like your idea, especially because we can use this data to show awesome stuff on the player's website profile, like a map of San Andreas with kill spots, an image of a skin with hitmarkers and all the stuff you mentioned.

But I am afraid once we start capturing this data nobody is going to do something with it. I would really like someone to assure me that we'll have the website support this data BEFORE we start capturing data, so that we can roll out an awesome feature for every registered player. If we don't prepare the site for this right now, than it will probably never happen.

Maybe this is also the right moment to expand player profiles with achievements and all. We should really take this opportunity and get it all done at once :) I'm happy to help out.

Trac ticket: http://trac.sa-mp.nl/lvp/ticket/1391
Reply
#3
It would be great to store this kind of information and build features upon this data, but I'm afraid it would really be too much to store every single death in the database, as hundreds (or thousands?) of them would be registered every single day. We maybe could keep a record of information for each player, for example the number of times a player has shot a certain body part.

If we can handle the amount of data, then I'm all for it :)
Reply
#4
http://wiki.sa-mp.com/wiki/OnPlayerWeaponShot and http://wiki.sa-mp.com/wiki/OnPlayerGiveDamage

So lets make a list what we want to save for each player:
- Total bullets fired (for each weaponId)
- Bullets hit (for each weaponId)
- Amounts of hits for each bodypart
Reply
#5
Maybe we should trial this. Set up a table and do it through a filterscript for a few weeks and monitor the amount of data. Obviously this information would only be stored for registered players so I don't think it would be that high.
Reply
#6
While I've indeed expressed concern about the amount of data we're planning to store here, I don't think that should stop us from at least trying it out. Having said that, we have to compile a list of data we want to store before we can decide on what to show on the website or even implement in the gamemode.

Now that I got the disclaimer out of the way, on to dreaming! 8)

Can we detect what weapon a player is holding while on foot? If so, we can determine how many kills per minute they make per weapon. This might be a good statistic to show which weapons a player is most skilled in.

Something else I was thinking of: now that we can detect hits, we can determine who contributed to the kill. If two or more players wound a player (and he doesn't get healed in the meantime), award a kill assist to the players who didn't get the kill. This statistic can be stored, as well as giving some sort of other reward (a money reward or something). To stretch this even further, you could determine how much damage was done by each player and raise or lower the reward based on that. For statistic's sake, I don't see any added value in this though.

For every registered player we'd register these extra statistics:
  • Kill registration
    • [li]Killer
    • Victim
    • Weapon used
    • Fatal bodypart
    • Coordinates
    • Date and time
    • Is lame kill
    [/li]
  • General statistics
    • [li]Bullets fired
    • Bullets hit
    • Kill assists
    [/li]
  • For each weapon:
    • [li]Bullets fired
    • Bullets hit
    • Kill assists
    [/li]
  • For every bodypart:
    • [li]Hits on other players
    [/li]

For data to show on the website I was thinking along the lines of:
  • Detailed list of statistics per weapon:
    • [li]Amount of kills (we can make achievements or badges or whatever for getting x amount of kills per weapon)
    • Accuracy (shots hit/shots fired*100)
    • Kills per minute (if possible, see my question above)
    [/li]
  • Image of a human body with accuracy per bodypart
    • [li]On hover, show detailed weapon information
      • Kills
      • Percentage of total kills
      • Assisted kills (this could show which bodyparts the player hit the most which resulted in a kill assist)
      • Percentage of total kill assists
    [/li]
  • A map of San Andreas with areas where the player killed people (larger circles for many kills, smaller for fewer)
  • Favorite victims and worst enemies (i.e. people you kill often and people who you get killed by the most)
    • [li]Show a top 5
    • Show the amount of kills on them or deaths by them
    [/li]
  • Add to "Melee Statistics":
    • [li]Headshot count
    • Overall accuracy
    • Kill assists
    [/li]

Let me know what you think!
Reply
#7
(03-01-2014, 07:42 PM)MrBondt link Wrote: Can we detect what weapon a player is holding while on foot? If so, we can determine how many kills per minute they make per weapon. This might be a good statistic to show which weapons a player is most skilled in.
http://wiki.sa-mp.com/wiki/GetPlayerWeapon

(03-01-2014, 07:42 PM)MrBondt link Wrote: Something else I was thinking of: now that we can detect hits, we can determine who contributed to the kill. If two or more players wound a player (and he doesn't get healed in the meantime), award a kill assist to the players who didn't get the kill. This statistic can be stored, as well as giving some sort of other reward (a money reward or something). To stretch this even further, you could determine how much damage was done by each player and raise or lower the reward based on that. For statistic's sake, I don't see any added value in this though.
I like this, wouldn't be too hard to setup: KillAssistHandler.pwn which checks OnPlayerDamage who contributed to the damage, returns a reward OnPlayerDeath or reset this contribution whenever a pickup concerning armour/health is picked up. Show a textdraw '+1 assist' or something and show this variable on the site next to kills.

(03-01-2014, 07:42 PM)MrBondt link Wrote:
  • Kill registration
    • Is lame kill
Is lame kill could be split up to 'Is heli kill' and 'Is drive-by kill'.

Furthermore I completely agree with everything you've said and listed, and I don't think it can be more accurate. We should not forget to use all these variables to improve karma! I heard Jay has already set-up a filterscript?
Reply
#8
(03-03-2014, 02:55 PM)cake link Wrote: I heard Jay has already set-up a filterscript?

Nope. I'm willing to do it though. Just need the table structure :)
Reply
#9

For the first version of this perhaps we should just keep it simple.

Quote:General statistics
     
Bullets fired
Bullets hit
Kill assists
 
For each weapon:
     
Bullets fired
Bullets hit
Kill assists

Detecting the number of bullets fired per weapon isn't as easy as it sounds. We'd have to constantly monitor the number of ammo remaining using GetPlayerAmmo when OnPlayerWeaponShot is called. The problem here however is that GetPlayerAmmo IIRC isn't always 100% accurate. I suggest we leave this one out for now and I'll do some asking around and look into this again later.

So just a table that allows us to store this data will be sufficient for now:
Quote:Kill registration
     
Killer
Victim
Weapon used
Fatal bodypart
Coordinates
Date and time
Is lame kill

However I suggest we rename weapon used to reasonId to conform with this:
http://wiki.sa-mp.com/wiki/Weapons
Eg for things like running a player over etc.


EDIT: With regards to kill assists - are we allowing an unlimited number of people to be involved with a kill or only 1 person?
With 1 person for example: the person who assists the most gets the stat. If this is the case an extra field can be added to the above list for the profile ID of the person who gets the assist.


If not, we'd have to create a new table to list all the killers who assisted per death.
Reply
#10
https://github.com/LVPlayground/playground/issues/10
Reply