Mobile Game Tracking Rig

Tell us about your projects. Update us regularly.
Post Reply
parkview
Master Maker
Posts: 402
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Mobile Game Tracking Rig

Post by parkview » Sat Aug 17, 2019 4:53 pm

A friend likes to play a mobile phone game (no names). One of the functions is to physically visit locations/cells to capture them These cells are around 300m in diameter, so there are lots of them around. Unfortunately as of August 2019, there is no method of viewing the places you have visited. While he is notified if someone captures one of his cells, it only says how many kilometres away it is. Not very handy of knowing really on where this might have been located.

Since we have been driving to Perth and back a bit lately and seeing the game being played out, I thought it might be fun to try and build a data capture rig. This would:

1) capture a screenshot of the mobile phone game for each cell visited
2) OCR the captured screen
3) store all the data found, ie: name of cell, Latitude/Longitude location, Cell Owner, Cell income etc
4) record other stats and data via keyboard hot-keys: Mobile phone towers locations (handy to know where good signal reception is), in game monsters, special buildings etc
5) record stats of the journey
6) other hot-keys: Audio on/off, servo on/off, pause data capture, extra screenshots

The hardware for this rig:
* Raspberry Pi 2B
* Raspberry Pi Camera
* HDMI Pi display (was going to use a RPi touch display)
* Adafruit Ultimate GPS 3 module
* Two 9Ahr 12V LCA batteries (I had them lying around)
* buzzer (audio feed back)

The initial idea was to capture cell location data, cell name and owner etc. The project has kind of grown from there and perhaps way too much time has been spent on this whimsical project, but it has been a lot of fun?

The software is written in the wonderful Pygame python: https://www.pygame.org/news and uses various imported modules: gpiozero, pytesseract (does the OCRing), picamera, PIL (image manipulation), GPSController and bunch of normal ones, ie: maths, time etc.

Here is a photo of it working out on a drive:
later-version.2.jpg
later-version.2.jpg (37.47 KiB) Viewed 178 times


We quickly figured out it needed a sun shade to keep the sun off of the mobile phone screen. OCR doesn't like reflections! It's hard to see the screen, so, here is a close up:
Pygame-interface.jpg
Pygame-interface.jpg (28.43 KiB) Viewed 178 times


Once we have recorded a journey/drive, the data can be imported into QGIS: https://qgis.org/en/site/, so our GPS data can be nicely viewed:
cell-data_towers.jpg
cell-data_towers.jpg (34.42 KiB) Viewed 178 times
Above, I have included the Telstra mobile phone tower locations that we have recorded.

parkview
Master Maker
Posts: 402
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Mobile Game Tracking Rig

Post by parkview » Wed Sep 18, 2019 11:57 am

The above rig was built around a RPi 2B computer board. I found that it would OCR a screen photo in about 5-6 seconds. Driving at the speed limit of 110km gives us around 9.8 seconds before we enter the next 300m cell. Not much time to react to any information that might have been gleaned from the OCR data.

A new Raspberry Pi 4 2GB was purchased and it was pleasant to find that it would OCR a photo in 1-2 seconds! We now have lots of spare time to do things like activate a servo motor to automate a cells capture. Initially I tried using a small 9gm servo motor, but it couldn't press the tip of the stylus down hard enough to activate the games capture button. I re-modelled the design for a more powerful servo motor:
large-servo.2.jpg
large-servo.2.jpg (18.79 KiB) Viewed 111 times
Here it is not mounted yet, lying on it's side below the adjustable camera mount:
servo-motor.jpg
servo-motor.jpg (46.1 KiB) Viewed 111 times

Post Reply