Search Unity

Points for enemies hit by multiple friendlies and player

Discussion in 'Game Design' started by varunvp, Oct 30, 2016.

  1. varunvp

    varunvp

    Joined:
    Jul 11, 2014
    Posts:
    57
    Hello forum,
    So in my game I have some levels where I'll be playing with the friendlies. The friendlies hit the same drones as the player does. So if the enemy dies, should all the points that were to be given to the player for the enemy he destroyed be given to him(player), or should it be proportional to the damage only he causes?
     
  2. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    Generally it's always a good idea to make the player feel good about themselves, even if it wasn't really them that did it. However you want to avoid a situation where the player consciously becomes aware of a 'mistake' in the scoring even if it's in their favor.

    My suggestion would be to award the kill to the player if they were a) the last one to hit it or b) caused a significant amount of damage just prior to the death of the enemy, i.e. award them the kill if the enemy dies within 10-20 seconds of them inflicting a substantial amount of damage.

    As far as I know some games which involve a lot of pvp and npcs do this such as Elite Dangerous.
     
  3. varunvp

    varunvp

    Joined:
    Jul 11, 2014
    Posts:
    57
    That's what I was thinking too! Maybe like after 80% damage?
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    Actually I would simply do it on a 'barrage' basis. Basically, if the player gets a good semi-continuous set of hits (i.e. 20% damage in a space of 3 seconds as an example) within a short time (10-20 seconds) of the enemy dying, they should be awarded the kill.

    The idea is to have a reasonably short interval between the player's experience of visibly damaging the opponent, and being awarded the kill, so that there's an association made and it feels 'right'.
     
  5. varunvp

    varunvp

    Joined:
    Jul 11, 2014
    Posts:
    57
    Now that's a lot complex!
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    Not really. You basically just need a timer on the script where the enemy receives damage:
    • Start the 3 second timer when a hit by the player takes place on the enemy and start counting the damage into a variable. If another hit from the player takes place during this timer, rewind it.
    • If the timer reaches the end of its 3-second cycle, check if the cumulative damage was enough (e.g. 20%), and if so, begin another timer for 10-20 seconds. If not, reset the first timer and start again.
    • if the enemy dies while the second timer is running, award the kill.
     
  7. varunvp

    varunvp

    Joined:
    Jul 11, 2014
    Posts:
    57
    Ummm, by rewind, do you mean set it to 0? Why would I do that? Shouldn't the timer be counting from the first hit that happens to the enemy? After it expires, if there is another hit, then the timer should be restarted.
     
  8. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,013
    Well you can do it any way you like, but for for me the important thing is how long of an interval there is between when the player last damages the enemy and when the enemy dies. So in this case the important thing is to record the time since the last shot. But also, because the amount of damage is relevant, it would record the cumulative damage.

    You gotta play around with this stuff until you find something that feels right for your game.
     
  9. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    The method described is good as far as I can tell, but it may be a bit too complicated. It's not that hard to wrap your head around, but for score-based games, players should know exactly how to be the one awarded the points for a kill. Somewhat complex algorithms may lead to situations where a player feels cheated out of points that they really felt like they deserved.

    What if you proportionately award points for damage proportion, then add a bonus for last hit? Maybe another bonus for soloing medium or large targets.