Giter Site home page Giter Site logo

ggez's Introduction

ggez

Compute player performance statistics.

Install

npm install ggez

Usage

import { kda } from "ggez"

kda(6, 2, 5)
//=> 5.5

API

All arguments are sanitized e.g.:

  • invalid inputs are treated as zero (0) e.g. null, undefined, non-numeric strings, etc.
  • decimal values are dropped

In the case of zero player deaths, it is raised to 1 when performing the computations e.g. Math.max(d, 1).

Kill Ratios

kda(k, d, a)

k

Type: number

The number of player kills.

d

Type: number

The number of player deaths.

a

Type: number

The number of player assists.

Computes the Kill-Death-Assist ratio (KDA), the higher it is from 1, the better the player's performance.

Dominance Statistics

df(k, d, a)

k

Type: number

The number of player kills.

d

Type: number

The number of player deaths.

a

Type: number

The number of player assists.

Computes the dominance factor (DF) which is a point sum, where each kill progresses the sum by 2, each assist progresses the sum by 1, and each death regresses the sum by 3.

Participation Statistics

kp(k, a, tk)

k

Type: number

The number of player kills.

a

Type: number

The number of player assists.

tk

Type: number

The total number of a team's kills.

Computes the Kill Participation ratio (KP) which measures a player's involvement in fights or duels across a given game, and is defined as the percentage ratio of the sum of kills and assists, over the team score.

ggez's People

Contributors

j4ckofalltrades avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.