using location in games
DESCRIPTION
A lot of this is out of date now (a whole 6 months later!)--but this is my presentation from LOGIN 2011 about using location based APIs in games.TRANSCRIPT
![Page 2: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/2.jpg)
Who am I?
• Game programmer, designer, jack of all trades.
• Founded FLARB in 2001, one of the earliest publishers and developers of mobile games in the US.
• Been working on a location-based game ad startup since 2010
![Page 3: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/3.jpg)
Getting Location
• Most smartphones have GPS receivers
• GPS-less devices (netbooks, iTouch) use “Fake GPS”
• Location from IP lookup
• Color: “GPS Doesn’t Work”
![Page 4: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/4.jpg)
GPS Accuracy
• Limited government restrictions
• 5-10m GPS, 50m WiFi, 500m triangulation
• Hyperlocation won’t be a reality until NFC or other tech comes about
![Page 5: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/5.jpg)
GPS APIs
• iOS– Core Location
• Android– Location Manager
• GPS uses lots of juice!
![Page 6: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/6.jpg)
Location in a Browser
• W3C Geolocation API
• Javascript in modern browsers
• Works the same way as native APIs
![Page 7: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/7.jpg)
Storing Location
• Geospatial databases
• Basic functions:– Storing geographic locations– Sorting (distance checks)– Testing (intersections with shapes)
![Page 8: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/8.jpg)
Storing Location: MySQL
• Spatial Extensions in 4.1 (subset of OpenGIS)
• Geometry stored as WellKnownText (WKT) or binary (WKB): “POINT (30 10)”
• All computations are in Euclidean (flat) space
![Page 9: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/9.jpg)
Storing Location: PostGIS
• PostgresSQL with GIS extension
• Most mature relational solution (2001)
• WKT or WKB
• “Geographic Coordinates” for accurate queries mapped on globe
![Page 10: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/10.jpg)
Storing Location: MongoDB
• Popular NoSQL database with game devs
• Geospatial indexing using spherical coordinates
• Uses geohash to store points
• Only points, no lines, polygons, etc.
![Page 11: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/11.jpg)
Storing Location: SimpleGEO
• SimpleGEO Storage is a cloud service
• Cassandra with custom spatial extensions
• Store location as lat/long, geohash, or IP
• Cloud service—use HTTP calls. Heavy overhead.
![Page 12: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/12.jpg)
Using Location
• Places Databases– Find out EXACTLY where you are
• Different places database provide different info about venues and locations– Trending– Coupons
![Page 13: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/13.jpg)
Places APIs
• Foursquare• Factual• Facebook Places• Google Places• SimpleGeo• CityGrid• Etc. etc. etc.
![Page 14: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/14.jpg)
Street Addresses
• Get latitude and longitude of street address
• Geocoding
• Google Maps API:
http://maps.googleapis.com/maps/api/geocode/json?address=xxx&sensor=false
![Page 15: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/15.jpg)
Foursquare API
• Unauthenticated– Raw places API.– Free to use, with paid tier.– Crowdsourced
• Authenticated– OAuth2– Access to check-in history, friends,
mayorships, trends
![Page 16: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/16.jpg)
Facebook Places API
• Database is based on Factual
• Authenticated only
• Tagging friends
• Deals platform
![Page 17: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/17.jpg)
Foursquare vs Facebook
• Foursquare’s unauthenticated mode make it useful as a general places database
• Facebook has WAY more users
• Neither one can detect cheats
• Tagging friends is a powerful feature
![Page 18: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/18.jpg)
Designing for Location
• A sample– Parallel Kingdom– Paranormal Activity– Turf Wars– The Merchant Kingdom– Dokobots
• Too literal.
![Page 19: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/19.jpg)
Location Design Problems
• Convenience
• Density
• Privacy
![Page 20: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/20.jpg)
Popular uses in apps
• As a social networking tool– WhosHere– Color– Instagram
• As a coupon/deals platform– Stickybits– Goldrun
![Page 21: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/21.jpg)
Business Models for Location
• Real-world rewards for virtual world play– Pain in the ass for the advertiser– A hassle to redeem
• Local deals are hard to source– Most LBS companies are sales
organizations
![Page 22: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/22.jpg)
Data Collection?
• Heaven’s Diner!
![Page 23: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/23.jpg)
Summary
• Location is an interesting and low-tech buzzworthy feature
• Location gaming is in its infancy
• The “check-in” may be going away, but location isn’t.
![Page 24: Using Location in Games](https://reader036.vdocuments.net/reader036/viewer/2022062703/5554dcccb4c905a16f8b522e/html5/thumbnails/24.jpg)
Thanks!
• Ralph Barbagallo
• twitter.com/flarb
• ralphbarbagallo.com