# gamevis

> [![Gitter](https://badges.gitter.im/saul/gamevis.svg)](https://gitter.im/saul/gamevis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Latest version **0.2.0** (published 2016-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamevis
pnpm add gamevis
yarn add gamevis
bun add gamevis
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-03-25 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Known vulnerabilities | 0 (+20 in 5 direct dependencies) |
| Install scripts | no |
| GitHub stars | 25 |
| Maintainers | saulren |

## Links

- npm: https://www.npmjs.com/package/gamevis
- Repository: https://github.com/saul/gamevis
- Homepage: https://github.com/saul/gamevis#readme
- Issues: https://github.com/saul/gamevis/issues
- npm.io page: https://npm.io/package/gamevis

## Dependencies (16)

- [pg](https://npm.io/package/pg.md) ^4.4.3
- [vue](https://npm.io/package/vue.md) ^1.0.16
- [pace](https://npm.io/package/pace.md) 0.0.4
- [three](https://npm.io/package/three.md) ^0.74.0
- [jquery](https://npm.io/package/jquery.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [xxhash](https://npm.io/package/xxhash.md) ^0.2.3
- [bluebird](https://npm.io/package/bluebird.md) ^3.1.1
- [demofile](https://npm.io/package/demofile.md) ^0.2.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [stats.js](https://npm.io/package/stats.js.md) ^1.0.0
- [pg-native](https://npm.io/package/pg-native.md) ^1.10.0
- [sequelize](https://npm.io/package/sequelize.md) ^3.17.3
- [db-streamer](https://npm.io/package/db-streamer.md) ^0.4.0
- [pg-copy-streams](https://npm.io/package/pg-copy-streams.md) ^0.3.0
- [electron-prebuilt](https://npm.io/package/electron-prebuilt.md) ^0.36.4

## Recent versions

- 0.2.0 (latest) — 2016-03-25

## README

# <img src="logo.png" width="32"> Gamevis

[![Gitter](https://badges.gitter.im/saul/gamevis.svg)](https://gitter.im/saul/gamevis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Gamevis is an open-source [Electron](http://electron.atom.io/) application for visualising gameplay data developed by [Saul Rennison](http://saul.re) as part of his degree dissertation.

Gamevis is unopinionated and easily fits many genres of games, and includes importers for Counter-Strike: Global Offensive and Dota 2.

## Screenshot

Screenshot demonstrating two layered heatmap visualisations:

<img src="screenshot.png" width="1024">

## Installation

### 1. Prerequisites

Node & npm are already expected to be installed:

```
brew install libpqxx
npm install -g gulp # required for building
npm install # install app dependencies
gulp # compile JavaScript and stylesheets
```

### 2. Database

A Postgres server is by default expected to be running on `localhost`. The `config.json` file can be updated at the root of the project to specify a non-default database IP/port.

By default the server is expected to have a database named `gamevis` with a username and password of `gamevis`.

Note that no tables need to be generated - the application will automatically generate.

### 3. Run the app

The application can be started with `npm start`. However, no sessions are available by default. The importers (see below) can be used to import game sessions into the database.

## Visualisations

Multiple visualisations can be show on a single visualisation (as shown in the screenshot):

* Heatmaps
* Timeline events (e.g., round start)
* Discontinuous points (e.g., death location)
* Continuous points (e.g., player movement)

## Importers

Game | Path | Comments
-----|------|----------
Counter-Strike: Global Offensive | `importers/csgo` | Run `import.js` with the path to the demo file as the argument.
Dota 2: Reborn | `importers/dota_reborn` | Run `import.go` with the path to the `.dem` replay file as the argument.

## Release log

Gamevis is still a work-in-progress and is not expected to be in a production-ready state until Summer 2016. However, changes are committed frequently and any issues should be raised as bugs. Of course pull requests are welcome!

## Database

Gamevis expects to connect to a Postgres database of version 9.3 or later due to JSONB querying features. This section details the structure of the database tables, that are automatically generated by the game client.

### session

Column | Type | Value
-------|------|-------
title | string, not null | User-friendly session title
level | string, not null | Name of the level/map/world this session was recorded from, e.g., `de_dust2`
game | string, not null | Short name of the game this session is associated with, e.g., `csgo`. This name will be used as the subdirectory to find the level overview data.
data | JSONB | (Optional) Custom data associated with this session.

### event

This table represents events that occur throughout a game's session. Events are optionally associated with one or more locations within the game world, and optionally associated with one or more entities.

Column | Type | Value
-------|------|-------
session_id | foreign key | → session
tick | int, not null | Game tick that this event occurred
name | string, not null | Name of the event
data | JSONB, not null | Event-specific data. The data keys for a particular event name are expected to be constant across all instances of it being fired in a particular session
locations | JSONB | (Optional) All locations associated with this instance of the event. Keys should be a user-friendly string, and the value a `Vector2` object, e.g., `{'player': {'x': 500, 'y': 250}}`
entities | JSONB | (Optional) All entities associated with this instance of the event. Keys should be a user-friendly string, and the values pointers into the `entity_props` table, e.g., `{'grenade': 175, 'thrower': 11}`

### entity_props

This table represents the entity properties throughout the recorded session.

Column | Type | Value
-------|------|-------
session_id | foreign key | → session
index | int, not null | Entity index. Does not have unique across an entire session, just for this entity at this tick
tick | int, not null | Game tick that this update occurred
prop | string, not null | Name of the property that was updated (e.g., `health`)
value | JSONB, not null | JSON object of the format `{'value': newValue}` representing the new value of the property.

## License

This project is licensed under the MIT license, see [LICENSE.md](LICENSE.md) for the full legalese.

## Acknowledgements

* Logo derived from Pao Media's gamepad logo, licensed under [Creative Commons (Attribution 3.0 Unported)](https://creativecommons.org/licenses/by/3.0/).

---
_Source: https://npm.io/package/gamevis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
