Making Ghent Theft Auto with Python. 🐍

Lucas Selfslagh
Ghent Theft Auto
Published in
4 min readJan 25, 2019

Hello, boys and girls from the internet! 👋

In this week’s article, I’ll document how the programming language Python has been a crucial asset in the development of Ghent Theft Auto. 🐍

Python is a one of a kind language that grew to extreme popularity in the last few years, mostly because of its accessibility and ease-of-use. Since last year, it’s the third-most used language in the world and the popularity keeps rising.

The best thing about Python? That’s gotta be the vast amount of packages you can install, directly from your command prompt. Packages that have proven quite handy when developing a (real-world) game, for instance packages for:

  • file handling
  • web requests
  • parsing
  • analysis
  • plotting
  • re-projection of geocoordinates
  • geospatial image analysis
  • computer vision
Data is obviously a huge part of Ghent Theft Auto. Here’s some bus stops. 💁‍♂️

Not too long ago, making changes to Ghent Theft Auto’s map would take multiple days when done manually. Data had to be collected, processed and updated, the project had to be backed up because of the unsure nature of the build process, importing the files back into the game engine was a painful procedure, …

Jupyter notebooks are a great way of prototyping Python code if you mind your hidden state 👻

Even with my speedy muscle-memory and appetite for shortcuts, the process was pretty error prone and had to be monitored extensively in order to produce usable output.

Long story short, updating the map was a hassle. 😬

Back in the Unreal days.

A lot of time was being spent handling and tracking files in between processing batches, or clicking buttons and waiting for processes to finish in GUI’s of software packages like Blender or QGIS.

Since a lot of the software I was using was actually built upon Python, being able to access the core functionality without manually doing user input has proven priceless. Writing a quick for each loop for a repetitive operation in Blender that iterates over 162 files in different directories is a livesaver.

There’s a method to the madness now.

I not only tend to see opportunity for automation and tooling everywhere, I’m actually able to implement it since I started working at In The Pocket!

Here, I’ve been introduced to programming by my amazing co-workers, allowing my skills to grow exponentially.

32bit RGBA splatmaps using OpenCV color filtering on map tiles rendered with open street map data 👌

So yeah, enter Python automation!

Swearing is a must when prototyping user interfaces.

At first, I used a lot of single-purpose scripts but those evolved into a command line tool I can use to do almost anything to the data that compromises my map, allowing for quick lead time. Since my job has me working in Unity (C#) most of the time, I was able to map the output that I got from Python directly in to the Unity engine, extending existing features and scripting custom editor tools to update the map.

Unity 2018.3 🕺

This one has me pretty proud. Not only did I discover a workflow for making real-world locations in popular gaming engines like Unreal Engine and Unity, I automated the day-long manual process into a 2 minute afterthought that you can run from any terminal, on any computer, anywhere in the world.

Thanks to Python. 💞

--

--