Giter Site home page Giter Site logo

dualword / shootergameanalyticsvisualizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alessandropro/shootergameanalyticsvisualizer

0.0 1.0 0.0 101.44 MB

A Unity game that records in-game statistics in a database, and a C# Winform application to visualize the data

C# 86.19% Mathematica 13.81%

shootergameanalyticsvisualizer's Introduction

Shooter Game Analytics Visualizer

This is a C# project that comes in two parts:

  • a Unity game in directory /ShooterGameAnalyticsVisualizer(WinForm)
  • a C# Winforms application in directory /SurvivalShooterTutorial(Unity)

The Unity game was not developed by me, it is a publicly available Unity "Survival Shooter" tutorial. Within it I implemented code that records in-game statistics for each game session in an SQLite database. This database can then be loaded into the Winforms visualizer, which will display the data, including a heat map of where the player died.

Some notes:

DATABASE:

The database is called ShooterGameAnalytics.db and is located in the zip file folder in SurvivalShooterTutorial\Assets\Database.

I created 4 tables:

  • game_session: records an id for each new "game session" (that is, each time the game application is run)
  • game round: records an id for each new "game round" in a particular game session (when the player dies, a new round starts)
  • player_round_stats: At the end of each game round, the statistics of the player are recorded here
  • enemy_round_stats: At the end of each game round, the statistics for all enemies as a collective are recorded here

3 of the stats for enemies that are recorded per round: average distance to player when killed, average survival time, number killed.

UNITY PROJECT:

I made two new scripts in SurvivalShooterTutorial\Assets\Database:

  1. DatabaseManager.cs: Static class with all of the calls to the database for recording data
  2. GameRoundStats.cs: Attached to an empty game object called "GameRoundStats" that is referenced in the game's scripts to keep track of game statistics (updated when the player dies, an enemy dies, etc.)

Also, some small changes were added to existing script, just small bits where GameRoundStats needed to be updated. All extra code in these scripts is appended with a "//@@" comment for easy searchng. Scripts touched are EnemyHealth.cs, PlayerHealth.cs, and PlayerShooting.cs

WINFORM:

For the visualizer, you must open the database (there is only one db file in SurvivalShooterTutorial\Assets\Database). Once it is loaded, you can choose to view statistics from all game sessions or choose a specific one. As discussed with you, a DataGridView was used instead of a PropertyGrid. The UI logic is all in ShooterGameAnalysisForm.cs and the database querying is in DatabaseReader.cs. There is also a game icon.

Game map (top-down view): GameMapView_TopDown

In-game view: GameView

Data Analytics Visualizer:
VisualizerTool

shootergameanalyticsvisualizer's People

Contributors

alessandropro 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.