Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.






Using Geographic Information Systems (GIS) as a game analysis tool

Posted by mippy, 23 October 2013 · 697 views

GIS analysis quality hack database
Public Draft

In this entry I will argue that Geographic Information Systems can be useful in game development. I'm a hobbyist game developer and hobbyist GIS hacker. Please take my opinions with a grain of salt.




What is a Geographic Information System (GIS)?
A GIS consists of a database that supports spatiotemporal data and some form of interface that can make use of it. Somewhere in the tool chain you might find some analysis tools.There are of course many more on the market, but I think these are the biggest ones. The analysis tools can of course render data, and the renderings tools usually comes with some API:s which you can use for data analysis.

A GIS database have extra features to manage spatial data.
  • Extended native datatypes: point, path, polygon, raster.
  • Extended comparisions: contains, inside, length, area, volume etc.
  • Examples on spatial SQL

~



Relevance to game development: stacking gameplay data
If you run many tests you will pile up a large quantity of data. Drawing conclusions from one game at a time can be useful, especially if you have player reactions on record. But in order to analyse patterns in larger sets of games; traditional replay features are not enough. You need to stack data and render it all at once. A GIS is very good at this as it can store large quantities of data and is optimized to query it using geometric and traditional attributes.

As a side-note: a game that actually has this feature is SuperMeatBoy, where you can see all your previous failures once you complete the level.

~

Relevance to game development: analysis
Many 2D and 3D games generate spatiotemporal data and a GIS is built to manage them. Gis analysis tools are used to analyse data.

Descriptive analysis
  • How many times does unit type A kill unit type B in the valleys and creeks outside the castle?
  • In a set of 1000 games, how does the players behaviors affecting the random enemy-wave generation?
  • How far into enemy territory are players generally able to make it before they die, on this asymmetric multiplayer map?
  • How many "predefined incidents" occurred in the first 3 minutes of gameplay where the server was X, players were from countries A,B,E and how long did they continue to play after that.
Predictive analysis
  • Where will players most likely diverge from the game-designers intended path?
  • Where will the hardest battles take place? How will the AI move NPCs across the map?
Data mining
  • Where in the levels are players getting lost?
  • Where does big battles take place?
Player event logging
  • Gather data on special events that can be considered bad manners.
I think the descriptive analysis, data mining and event logging are the most useful analysis forms. Predictions can be hard since games are in their essence models and predictive analysis are models, which would mean you are modeling model behavior.

~

Generating data
GIS tools are built to import/export industry standard file formats. If you make your game export data in one of these formats you won't have to do any processing before importing it into your database.

Data
The data is points, lines, polygons, timestamps, game-event-ids and such.The data that games produced is "perfect" compared to real-world data which is full of imperfections. As a result you don't need the most advanced tools on the market because a large part of their features are there to manage these imperfections.

Metadata
A very important aspect of any professional GIS is to use proper metadata, which are xml files containing information on how and when the data was created. If you follow industry standards in this aspect as well, the GIS software will help you stay organized as the project moves forward. In a game development setting the metadata can be build version, players, purpose and level/mission information.

Rasters
A raster in a GIS environment are pre-rendered background maps, satellite photographs etc. They can also be heatmaps, where each pixel represents a aggregated value of that particular spatial "square".

File formats
I'm not good enough at GIS to give recommendations on file-formats but here are some starting points:


~


Overkill?
One might argue that military grade mapping tools are overkill for a indie or any studio who has some xyzt coordinates to be rendered. However, if you stick to the standard formats you will be able to take advantage of already existing tools. Very clever persons have already done all the thinking. These tools are mature, free (in some cases), can handle large quantities of data and support very sophisticated analysis. Furthermore:
  • Instead of spending developer time on in-game analysis tools you spend it on building export capability to these industry standard formats.
  • Industry standard file formats are likely to have ready-made export libraries already written in your favorite language.
  • The skills of the involved programmers are not a limitation to how complex analysis you can make.

~


Use case 1: 2D Tennis game
I have been building a Pong clone for a contest in the beginners forum. The game contains some random events: cars (AI-controlled pads) and the ball are launched at random velocities at random times. How does this play out in larger sets of games? Will the random elements really be random within the bounds I intend it to be?

One way of finding out is to let the game run for a long time with and without player input. The starting velocities, positions and time-to-death/loss would be logged into an array with simple (time,x,y,eventClass) coordinates. This data could be copied into a spreadsheet such as Excel or LibreOffice Calc.

In here, make a diagram. Set its background to be a screenshot of the game-board. Add the data to the board as a scatter-plot and filter out the classes you don't want. You might have to edit the x,y-axis span so that the points will be mapped to the correct parts of the screen.

StarCraftII simple heatmap

An example where I did this in a StarCraft II map. I'ts a simple heatmap of unit-death events from one game.


~

Use case 2: StarCraft II - advanced
<< Logging game events, store them in PostGis database, run queries and render with OpenLayers. >>
Why doing it

How I did it

Post-mortem

Summary
This adventure was mostly an experiment to see if it was possible, and it was. However the project grew out of scope so I never finished. The questions I wanted to have answered could be answered using Excel.


~


Use case 3: MMO super project
<<Set up a proper GIS with events/glitches/bugs with interface for bug-reporters, developers and player moderators to keep track of how game develops in real-time>>


~

Career
The gaming industry can be quite stressful. If you at some point want to change career into something more stable, skills in GIS can be useful since government agencies and business worldwide use GIS quite a bit.

Summary
  • It is a good way to organize player data
  • I'ts made to handle large data-sets
  • Products on market are mature
  • Alternative career path
The tools for analysis are there, they are mature and there are plenty of experts in the field.


Further reading
  • Cartesian coordinate systems
  • Mercator projection to translate round earth to flat map projections are used. Cylindrical projections such as the mercator projection have simple x,y coordinates and is thus useful as a projection for game data.
  • Albert K.W. Yeung, G. Brent Hall (2007) Spatial Database Systems - Design, Implementation and Project Management.





Cool entry - I eagerly await the final draft

November 2014 »

S M T W T F S
      1
2345678
9101112131415
16171819202122
23 24 2526272829
30      
PARTNERS