cbarrete / pdm

Punishing Deathmatch gametype for Warsow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Punishing Deathmatch (PDM) is an alternative deathmatch gametype for Warsow forked from Vitaly Minko's RDM. The only distinction from the default deathmatch is that the score is measured not by frags, but by a numeric equivalent of the beauty of the shots. Bad shots punish you by removing a fraction of your total score.

The basic rule of the gametype is that you have to move fast to get decent score. See the description below for details of how the score is calculated.

Score

The score you get depends on the following parameters:

  1. Your speed.
  2. Speed of your target.
  3. Distance between you and your target.

The harder it is to hit the target (higher speeds, longer distance), the higher score you'll get. If your score is less than DS, you'll instead lose a fraction of your current score proportional to how much less than DS you did.

Here is the exact formula:

              /            / Va'\2  /      min(Vta', Vtg') \   / Dat \ \
score = floor | DS * ACF * |----| * | 1 + -----------------| * |-----| |
              \            \ Nv /   \            Nv        /   \ Nd  / /

And if score < DS:

             /       score - DS  \
finalScore = | CS * ------------ |
             \           DS      /

Where

  • DS is the default score for a "normal" shot (100).
  • CS is the current total score of the attacker.
  • ACF is the anti-camper factor, see the description below.
  • Va' is the projection of the attacker's velocity relative to ground to the flat surface that is perpendicular to the vector from the attacker to the target.
  • Vta' is the projection of the target's velocity relative to the attacker to the flat surface that is perpendicular to the vector from the target to the attacker.
  • Vtg' is the projection of the target's velocity relative to the ground to the flat surface that is perpendicular to the vector from the target to the attacker.
  • Nv is the normal velocity (600).
  • Dat is the distance between the attacker and the target.
  • Nd is the normal distance (800).

Anti-camper factor

The idea behind the factor is to make camping uninteresting. We significantly decrease score if the attacker's velocity is lower than the normal velocity (Nv). If the velocity is noticeably higher than Nv, then ACF almost does not affect the score (i.e. it's close to 1).

Here is the exact formula:

            /         / Va     \ \    pi
      arctan| scale * |---- - 1| | + ---
            \         \ Nv     / /    2
ACF = ----------------------------------
                      pi

Where

  • Va is the length of the player's velocity vector.
  • Nv is the normal velocity (600).
  • scale specifies how fast the factor grows (12).

And here is what it looks like.

Awards

There are four types of awards:

  1. nice shot for a shot a score higher or equal than 500 and lower than 1000;
  2. awesome for a shot a score higher or equal than 1000 and lower than 2500;
  3. mental for a shot with a score higher or equal than 2500;
  4. sucks for a shot with a score lower or equal than 100, resulting in points lost.

Notes

Due to the nature of the gametype, it is not supposed to work with normal weapons (i.e. with Instagib disabled).

License

(c) 2021 CĂ©dric Barreteau

(c) 2011-2016 Vitaly Minko

Documentation available under GNU Free Documentation License 1.3 and Creative Commons Attribution-Share Alike 3.0 Unported License

PDM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3.

ChangeLog

20 Dec 2021 - Version 1.1 Punishment is now based on the difference with the default score rather than the anti-camper factor.

19 Dec 2021 - Version 1.0 First PDM version, forked from RDM.

2 Oct 2016 - Version 0.6 The default timelimit changed from 10 to 20 minutes.

20 Sep 2016 - Version 0.5 Fixed embarrassing mistake in the function RDM_min. Thanks to Maarten Snauwaert.

14 Mar 2016 - Version 0.4 Provided compatibility with Warsow-2.0.

26 Sep 2015 - Version 0.3 Provided compatibility with Warsow-1.5.

14 Sep 2012 - Version 0.2 Provided compatibility with Warsow-1.0. Selfkill now is punished by 500 points. Fixed wrong behaviour when Instagib is disabled. Welcome text no longer displayed when returning from spectator. Fixed wrong time handling.

04 Nov 2011 - Version 0.1 First public release.

About

Punishing Deathmatch gametype for Warsow

License:GNU General Public License v3.0


Languages

Language:C++ 99.8%Language:Shell 0.2%