<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Ghent Theft Auto - Medium]]></title>
        <description><![CDATA[A medium publication on the creation of Ghent Theft Auto, and more importantly: my generalist skillset. - Medium]]></description>
        <link>https://medium.com/ghent-theft-auto?source=rss----1968df2b7b8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Ghent Theft Auto - Medium</title>
            <link>https://medium.com/ghent-theft-auto?source=rss----1968df2b7b8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:22:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ghent-theft-auto" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making Ghent Theft Auto, with heightmaps. ]]></title>
            <link>https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-height-maps-5b7400f6ce56?source=rss----1968df2b7b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/5b7400f6ce56</guid>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[games]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Lucas Selfslagh]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 23:53:36 GMT</pubDate>
            <atom:updated>2020-05-01T12:08:13.039Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHkAMh_E-2lMLYfjZoNFGw.png" /><figcaption>Process shot of 211 sq km in a Unity scene (yes, that is the Harbor DLC content you’re seeing up there)</figcaption></figure><p>It’s been a while since I’ve ranted about my monster pet project. For those of you who have been craving a new article, I’ve got a real <em>doozy </em>this time.</p><p>Today, we’re talking <a href="https://en.wikipedia.org/wiki/Heightmap">heightmaps</a> and why they are the vastly superior choice when doing terrain in realtime engines. Fasten your seat belts and maybe even grab some snacks, because it’s gonna get real <em>old skool</em> up in here. 😎</p><h3>Background</h3><p>First things first. I know, I know: I’m a lucky guy. 🍀</p><p>I don’t have to work with 30 m accuracy Shuttle Radar Topology Mission, not even with 5 m per pixel/vertex Digital Elevation Model Flanders (a complete LIDAR scan of Flemish territory that will be used to extend the map even further later on).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*F820yMBL1DKf9794Ocwk6Q.gif" /><figcaption>God, how I miss the Space Shuttle.</figcaption></figure><p>No, I have the luxury to work with 4 m pixel accuracy Gent in 3D scans. Whilst I’m very thankful to have access to this data, that’s about where my luck runs out. ☘</p><p>The Gent in 3D dataset has a <em>few</em> peculiar design choices, causing the data to not actually be as open as it could be, and frankly: quite unusable in a realtime environment, such as Unity or the Unreal Engine.</p><p>Gent in 3D decided to share their dataset in a set of .dwg files. This format is proprietary to Autodesk software, and while it is arguably the absolute standard in urban and architectural disciplines, it is also kinda close to the least open-source file format in 3D.</p><p>You literally have to download an Autodesk product to be able to view and edit these files in a meaningful way. If you know me, that’s what I’d call a “big no-no”. 🙅‍♂️</p><p>Anyhow, I’m totally a student so let’s have a look inside these .dwg files with my trusted 3DS Max 2020 Student version!</p><p>The first caveat is one that’s pretty to spot with the naked eye: every file contains 64 meshes with no apparent benefit at all. That’s 13293 redundant OnTransformUpdate calls we can spot on file load. This gonna be good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5xMAvcIDQUMmKRyJpCavg.jpeg" /><figcaption>Gross. 🤮</figcaption></figure><p>Go ahead, call me pedantic and argue that a few more transforms and vertices don’t incur <em>that much</em> of a cost.</p><p>Consider that any CPU/GPU call that is completely stripped and eliminated at the source level is replicated across the board 211 times. Every time and everywhere the data is accessed. Ever.</p><p>Remove 240 faces? You’ve just wiped 50640 faces! Eliminate a transform, and it won’t ever be updated again, in any future client or editor session, at any given frame rate, literally: ever. 🤗</p><p>I believe this work will earn me the respect and love of many computers, especially: mine.</p><p>Disregarding the redundant object count, there are a few other issues preventing optimal use in real-time environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*5MWt7FKr3jDyB_IXk0cdcw.gif" /><figcaption>One of the 64 tiles (in one of the 211 tiles) being stripped from the redundant data.</figcaption></figure><p>The meshes lack consistent normal info, sometimes pointing down into the Earth’s crust. Smoothing groups have been applied to these meshes, further invisibly increasing an already intolerable vertex count (12 million vertices).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*lWEGVAUiDEP3Mr-H2FRR7A.png" /><figcaption>Hate to say it, but this is deeply uncool.</figcaption></figure><p>Getting into the bad stuff now: the meshes aren’t even sized to 1000 x 1000 meters, as advertised. As a direct result, my biggest pet peeve: all the origins are off in the range of multiple meters. 🤬</p><p>This stuff may seem trivial if you perhaps haven’t worked on this huge scale before, but trust me: you can’t <strong>count </strong>on it, let alone <strong>build applications </strong>on it.</p><p>Sorry, we’re just getting started: in my (<strong>strong</strong>) opinion, it doesn’t make a whole lot of sense to store terrain in mesh formats, even if the file format is completely open source.</p><p>Before everybody’s all, <em>“Yeah, classic Lucas Selfslagh, again with the blind ripping on industry standards, what an obnoxious moron”, </em>just hear me out for a second! 🙋‍♂️</p><p>The mesh data structure is a <em>beautiful </em>thing, which — like all beauty in the world — I know not nearly enough about. As far as this article is concerned, meshes are containers for various data types: positions, triangles, normals, uv coordinates, colors, etc.</p><p>They’re also extremely important for both rasterized and path-traced rendering. When you hear dudes and dudettes talking about computer graphics, they’re most of the time talking about rendering meshes. So, the mesh is a great and versatile way to describe the shape and appearance of something as basic as a simple cube or quad, to something as complex as a point cloud scan of a historical site. Why, even the lunar surface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w1v7Y8dRdG4dXEcIQBDWvA.png" /><figcaption>Cool thing about geodata skills: if humanity finally starts settling the Moon, just switch up the radius in your code et voila! You’re now a leodata engineer.</figcaption></figure><p>Meshes have also been around for a long time! I own a book about computer graphics that’s older than I am and even <em>that thing</em> has stuff about meshes in it.</p><p>I know: this is kinda intense, right? No sweat, we’re getting to the core of it: meshes are <strong>completely unnecessary </strong>for what we’re trying to do here, which is render beautiful, accurate, real-world terrain. Sure, they’re flexible but they also bring way too much overhead along with them.</p><p>Instead of wasting CPU cycles and precious build size on error-prone data + wildly conflicting behavior across various 3D environments (looking at you, left-handed vs. right-handed and Y-up vs. Z-up), we could also just cut the literal crap and start focusing about the only thing we care about: <br>the height, am I right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*cXScOK_jO6vNxYdlWyK5jg.jpeg" /><figcaption>How I often feel talking about these topics.</figcaption></figure><p>Those flipped normals I talked about earlier? Screw ‘em, already gone! Are you the one that fancied managing UV channels for 211 irregular shaped terrain meshes? Yeah, me neither. Do we need smoothing groups on flat Low Countries terrain? Should we continue to let 16-bit mesh restrictions dictate the 4 m resolution of our terrain? Let’s say we wanted to provide level to detail to these meshes. Yeah.</p><p>I guess what I’m saying is, fall in love with your hardware a little. Start caring about <em>all </em>the operations the things have to perform in order to draw your graphics and process your data.</p><p>Writing optimized code is one thing, but also pay attention to application load and think about storing and handling the data you really need. Reserve as much resources as possible for doing meaningful crunch at runtime.</p><p>Because, between you and me, I have <em>strong suspicions </em>that all my computers are <em>a lot </em>better at crunching than I am. 🤫</p><p>Ok. We have a total and complete knowledge about various aspects of the shape we want to represent, such as e.g.:</p><ul><li>the size of our terrain slices</li><li>their real world locations and neighbors</li><li>the topology of every point in the two-dimensional grid</li><li>the minimum and maximum elevation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*fJk_tcfZ3pqfgCu5tCcQMg.jpeg" /><figcaption>“Look ma, no mesh!”</figcaption></figure><p>As you see, we can already define a lot of terrain without having to deal with Autodesk products, closed-source proprietary files, redundant mesh data, vertex-duplicating smoothing groups, right vs left-handedness, up- and forward-axis, etc.</p><p>We don’t need to store redundant state, we don’t need to waste cycles and bandwidth reading and writing the same numbers between hardware components. We don’t need more numbers, we need better logic<strong>. 🧠</strong></p><p>Logic <em>does </em>need a data structure to operate on. Let’s piggyback on a better one: two-dimensional arrays!</p><p>I am of course talking about images. Images don’t have all the nasty numbers that I talked about above. What images do have is a certain size, readily accessible by the dimensions of the 2D pixel array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*-gBHA3V6uxV3tR4cz8mqhw.jpeg" /><figcaption>Yo dawg.</figcaption></figure><p>So yo <em>dawg,</em> when you take images, which are two dimensional arrays, and place them inside two-dimensional arrays of their own: those two dimensions are offloaded to the computer, so we never have to think about that stuff for the rest of our lives. ✌</p><p>We can write logic that turns pixels and coordinates into interchangeable entities, merging their behavior. This allows us to solely worry about one thing: a single friggin’ 16-bit float describing the height at a certain coordinate, anywhere in Ghent. Uh I mean, in Belgium. Any pixel! The globe. Literally, whatever! Go talk to my computer! 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncDbXKHMetVkdPUQBTffzw.png" /><figcaption>Low-resolution color-corrected preview of one of the 211 .raw heightmaps.</figcaption></figure><blockquote>(Do mind, both approaches ultimately end up as meshes when it’s rendering time. Game engines simply perform better and provide more flexibility when storing and handling terrain using heightmaps.)</blockquote><h3>Splatmaps</h3><p>Another benefit of image-based terrain is the ability to mask your terrain using colors, resulting in things called <em>splatmaps</em>. Splatmaps enable you to control what layer is rendered where, through the use of a specialized shader that supports instanced drawing.</p><p>In traditional game design, these splatmaps are painted in a process which takes a lot of time, by skilled artists who in turn take a lot of <em>moolah</em>. 💸</p><p>There’s the option of masking the terrain by using slope-based and height-based rules, which you might know from software such as WorldMachine. Those geometry-based rules ultimately won’t account for every characteristic little patch of grass, wheat, forest, river bed, gravel, etc. in the Ghent area. A critical requirement for Ghent Theft Auto.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gW4we2HKkgdQGimZre34Q.png" /><figcaption>“It’s all code. If you listen closely, you can hear the numbers.”</figcaption></figure><p>Since I’m quite fond of bolting tech and data together in hacky ways, as it has been my job for the last five years, I’ve devised a method that makes sure I never paint a single splatmap pixel in my life. 🙃</p><p>It wasn’t <em>that </em>hard to come up with, since we’ve just turned coordinates and pixels into basically the same thing, right? We can now request data using pixels and paint textures using coordinates!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ReqeLTxQKVXAGIg1qOyqQA.png" /><figcaption>Don’t mind the gap(s).</figcaption></figure><p>The resulting terrain layers can be linked to different materials, allowing wildly different surfaces to be rendered in a lightweight way (up to 8 different materials in HDRP, and I believe Unreal Engine can handle even more with DX12 iirc).</p><p>Both engines support the instancing of 3D objects, creating the appearance of dense forests and rocky deserts, without the need for placing every single 3D object in a natural way. Using brush tools, artists can paint 3D instances onto the terrain. But, again, you still have to paint every pixel.</p><p>Well, you <em>don’t have to</em> when you can just ping some server for a shape file containing all the ‘forest’ landuses, right? 💅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPqfTFhNIA_cCoXOQWDdzQ.png" /><figcaption>feelsgoodmap_foliage_map.jpeg</figcaption></figure><h3>Results</h3><p>Back in the UE4 days, I was already using heightmaps but I didn’t know how to code. My terrain building process entailed manually loading the entire 2GB dataset into a 3D package, rendering a 16K pixel heightmap that I imported into WorldMachine, to slice into sections and color in using predefined masks.</p><p>A very labor intensive and error prone process. Nobody would want to keep track of an area that’s over 200 square kilometres for minute changes in grass patches, right? I kept scribbled notes of import settings and marked my progress on printed versions of the map. I wasn’t exactly looking forward to rebuilding the terrain and I kept thinking that there should be a way to automate it all, if only I know <em>how</em>.</p><p>Even though building my terrain pipeline in Unity took me the better part of three (admittedly eventful) days, it has already saved the project thousand of hours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*_DwKvy0qK9KWAvOXQ8TzIQ.png" /><figcaption>The new visualization mode from Unity’s Terrain Tools package, still in preview.</figcaption></figure><p>Not only does Ghent Theft Auto now have a light-weight, fully automated terrain pipeline, all Cartesian coordinates in our map now have an elevation, wherever they’re coming from.</p><p>Sampling the terrain at a coordinate and interpolating the returned float between the minimum and maximum elevation, is <em>way </em>cheaper than raycasting onto mesh colliders using non-deterministic real-time physics systems. You can even perform the math <strong>outside of a game engine</strong>.</p><p>The new pipeline added an accurate and efficient way to query the elevation of millions of Cartesian coordinates, whether they’re points of interest or paths for the AI to navigate on. We can just throw 2D points at the map, and have them hug the terrain, adding so freaking much to the visual appearance of this project. 🥰</p><p>And now, the numbers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*lne6KmTf2GHnVBUSazC4aQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*xr5wEw4OJmL9TsJjrynTMQ.png" /><figcaption>Guess which one’s the heightmaps.</figcaption></figure><p>I’m very glad to be able to say I was able to reduce the size on disk by 400%, whilst correcting the entire dataset and enhancing it using data from various other sources.</p><p>The entirety of a Ghent Theft Auto build is still way below the 2 GB dataset of the terrain. 👏</p><h3>Workflow</h3><p>So far, you seen me throwing shade onto meshes and humble-bragging my geospatial skills. Let’s go through the entire pipeline from start to finish!</p><ul><li>batch download of all zips from Open Data Gent 💾</li><li>extract and gather all terrain .dwg files in a single directory 🛒</li><li>batch import .dwg files and convert into .fbx files 🦾</li><li>unify the normals, make them point up 🙆‍♂️</li><li>merge all duplicate vertices and drop vert count by 1 million 🙄</li><li>fix the pivot points with renewed 1 cm precision 🕵️‍♂️</li><li>start doing raycasts over the terrain to sample the mesh height 🛸</li><li>store the heights and inverse interpolate between the min/max height 📊</li><li>stitch prominent holes edges, by scanlining and backfilling black edges 🤷‍♂️</li><li>query geoservers for data pertaining to areas inside our map 🧐</li><li>project certain areas (e.g. forests) into the terrain data 🌳</li><li>project points of interest onto the terrain 📍</li><li>project the roads down onto the terrain 🛣</li></ul><p>Add lots and lots of coffee in between the above steps and that’s it! 💃</p><p>If you like what you’re seeing and would like a more steady stream of development progress and updates: I am actively debating whether I should bite the bullet and try to get funding for this project, given these exceptional times, where the citizens of Ghent, and Flanders really, could <em>use </em>a multiplayer digital twin to meet each other in.</p><p>If you made it to the bottom, and you think I should quit stalling and get balling: leave me clap or send me a message! Anything to further coerce me into finally doing this surely helps at this point, believe you me. 😉</p><p>Anyway the cookie crumbles, the next article will explain how you can combine methods for processing augmented reality trackables and compensating client-side lag visually, in order to have real airplanes flying over the game, based on realtime flight info! ✈</p><p>Yours truly,</p><p>that weird Ghent Theft Auto kid.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b7400f6ce56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-height-maps-5b7400f6ce56">Making Ghent Theft Auto, with heightmaps. 🗻</a> was originally published in <a href="https://medium.com/ghent-theft-auto">Ghent Theft Auto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Ghent Theft Auto, with Open Data ]]></title>
            <link>https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-open-data-cab03cdb5c36?source=rss----1968df2b7b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/cab03cdb5c36</guid>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Lucas Selfslagh]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 16:48:58 GMT</pubDate>
            <atom:updated>2019-02-07T17:38:47.626Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, hello again, boys and girls of the internet! 👋</p><p>Today’s article is all about how Ghent Theft Auto uses open data to build the world and drive gameplay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*NengXyhyH0vCuwc_fwQ81g.png" /><figcaption>Imagine placing every single item on this map, by hand. 😰</figcaption></figure><h4>Open Data</h4><p>First things first. What exactly does ‘open data’ mean?</p><p>In the case of this article, the term covers (geo-tagged) data that’s available freely in many forms: from fully fledged out API’s with GET and POST calls to geotagged serialized .xml or .json on disk, specialized spatial files like .shp or .geojson in software like QGIS, GeoPandas dataframes in Python, rasterised tilemap images, satellite imagery, weather forecasts, etc.</p><p>Sources for my datasets are equally plentiful as the forms they come in but most of it originates from two places: Ghent’s <a href="https://data.stad.gent/">Open Data Portal</a> and <a href="https://www.openstreetmap.org/">OpenStreetMap</a>.</p><p>Anyway, regardless of where and how I get the stuff: the search for inventive ways to leverage this data is easily one of the most fun parts in developing my monster pet project! 🤓</p><h4>Open Data Gent</h4><p>Ghent hosts and distributes a slew of datasets about things like population numbers, car parking occupancy, vegetation coverage, schools, hospitals, public transport, etc.</p><p>Some of the use cases are pretty obvious, stuff that you think of instantly.</p><p>Like: gathering every single tree in the map’s area, converting their coordinates into a custom coordinate system, splitting them up by the tiling level and ray-casting them to my terrain, giving them attributes such as their species, plant date or height, parsed from a live link.🌱</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4W2sq9sm6bXtmQSM_oKuQ.png" /><figcaption>How to save yourself 30.000 mouse clicks. 😅</figcaption></figure><p>Then there’s more unexpected ways of using open data. Take for instance, the dataset containing the doctors of Ghent.</p><p>When a player dies in Ghent Theft Auto, a global Death() function is called. After taking care of the basics, this function checks where he/she died exactly and then finds the nearest doctor, who in turn sends a ‘respawn request’, literally respawning them at their front door.👩‍⚕️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TyACkGNo38mMi7KKWUQuRg.png" /><figcaption>Easily one of the more inventive ways I use open data in Ghent Theft Auto. 💅</figcaption></figure><p>Likewise, the people populating the game’s world went to the same schools as me and my friends have gone to, they’ve been born in the hospitals of Ghent, the postmen collect letters from real mailboxes at the right time, shops open and close at their real-life hours, public transport runs in real-time, etc.</p><p>The vast array of available data out there <em>theoretically</em> even allows me to spawn the correct types of trash in the right streets on appropriate days, having it get picked up in the morning by garbage trucks following the streets and traffic rules I parsed from online sources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*5A37OY-qr_vvMe94HjkzpQ.gif" /><figcaption>Maybe I’ve been watching too much Black Mirror. 🙈</figcaption></figure><p>I’ve thought of using Natural Language Processing and the Wikipedia API to fill in eventual gaps in the data. It kinda feels like the only limit is my own imagination. There’s so many possibilities. 🙃</p><p>Now, you may think I’m wasting my time on details such as these, hear me out for a second. If there’s anything I’ve learned from my two years stint making architectural visualisations, or the countless hours I plunged into open world games, it’s that that the devil is <strong>always </strong>in the details.</p><p>To really sell the illusion of computer graphics, the background matters more than you think. It’s the things your eyes only pick up in a second or third pass, maybe never at all, those are the things that make you <em>believe </em>an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*krrG42v9Bx5_tN4KpDy9BQ.gif" /><figcaption>Grabbing real time data about underground parking occupancy and displaying it in-game. Why? Because I can. 🎉</figcaption></figure><p>Making a timelapse of Ghent Theft Auto using a fully functioning day/night cycle, hooked up to any open data I can parse, has been my dream since I’ve started learning programming about a year ago.</p><p>I’m pretty sure I’m just around the corner of finally pulling it off. 🤸‍♂️</p><h4><strong>Open Street Map</strong></h4><p>Open Street Map (or in short, OSM) is the second big source of the data framework that the game’s world is built on.</p><p>It’s very much like the Wikipedia of online maps: users can enter, edit and remove all kinds of geolocation data using the web client or specialized software. OSM doesn’t only act as the source of a whole range tilemap servers, it also powers stuff like reverse geosearching or outright data downloads.</p><p>Open Street Map’s biggest strength is easily the huge community behind it. Allow me give you an example.</p><p>In September 2018, just a stone’s throw away from my beloved Sint-Baafskathedraal, a major infrastructure project was completed. Two rivers were rejoined, restoring a waterway that got filled in during the sixties, in order to create more parking space. 🙄</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*fYRIjw0SSQbN6iooJuicyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*Sye_btG_guSwgTuBtER5fA.png" /><figcaption>👈 OpenStreetMap, Google Maps 👉</figcaption></figure><p>While Google Maps, Apple Maps, Bing Maps, etc. are <em>still </em>not up to date, four months after project completion, OpenStreetMap-based tilemaps literally had water running through the ‘Nederschelde’ on the exact same day as in real life.</p><p>Believe me, I checked. 🧐</p><p>The notion of user generated maps has the direct result of there being lots more data for low population areas, as people rely on OSM for hikes and bike trips. There’s also a lot of information about the accessibility of places for those of use who are less mobile.</p><p>Some major players in the tech industry build their services on Open Street Map, for example: Foursquare, Facebook, Niantic, Flickr, Uber, Strava, Craigslist, TripAdvisor, Snapchat, etc.</p><p>I’m actually pretty sure the open source mapping provider has better coverage than Google’s or Apple’s maps for the Flemish region. Maybe I should write some unit tests for backing up my claim. 😉</p><p>Anyway, and did I mention all of these services are 100% free? 💕</p><p>All these factors allowed me to rely solely on OSM as the data source of my map building tool, read about it in <a href="https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-python-ce9771220502">Making Ghent Theft Auto with Python 🐍</a>.</p><h4>Bigger picture</h4><p>My long term goal is to also to write data from my game back to the servers.</p><p>Not only as a way of giving something back to the service/community but more importantly: as<em> a way of building my game</em>.</p><p>I got the idea from collaborative world building games like Minecraft or Open Rollercoaster Tycoon, where I would see friends of mine toil away for hours in their shared multiplayer worlds, making a complete world out of empty maps that are now just gathering dust on some disk or server.</p><p>I figure, if I could deliver a <em>multiplayer </em>build of a city’s digital twin, it would basically build itself.</p><p>Yeah. That one was pretty <em>meta</em>. Sorry. 🙈</p><p>Next time we get practical again, when we get to read ‘Making Ghent Theft Auto using Blender! 🤖’. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cab03cdb5c36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-open-data-cab03cdb5c36">Making Ghent Theft Auto, with Open Data 🌐</a> was originally published in <a href="https://medium.com/ghent-theft-auto">Ghent Theft Auto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Ghent Theft Auto, with Git. ]]></title>
            <link>https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-git-5ad1fe732555?source=rss----1968df2b7b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ad1fe732555</guid>
            <category><![CDATA[real-world]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[3d]]></category>
            <dc:creator><![CDATA[Lucas Selfslagh]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 13:05:34 GMT</pubDate>
            <atom:updated>2019-01-28T19:28:13.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys and gals from the internet! 👋</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uu575phgTSN1u7MbRCo-dA.png" /><figcaption>Imagine trying to manage this without any form of source control. Yeah, that’s exactly what you’re looking at. 🙈</figcaption></figure><p>Another week, another article! This one is going to cover the various uses of source control systems in my pet project Ghent Theft Auto, more specifically: Git version control.</p><p>I started using source control just over a year ago, before I even started this whole programming <em>mumbo jumbo</em>, in a rather naïve search for backups and hosting in a single solution.</p><p>I had worked with Github Pages before to host static websites, having no clue about the sheer magnitude of and great functionality behind Git. To this day I discover new uses and advantages when it comes to tracking, well umm, stuff!</p><p>Seriously, if I could version control my life, sign my ass up any day.</p><p>Naaaaah, who am I kidding:</p><p>I got into Git because I thought I looked <em>hella cool</em> when I typed stuff like git commit -m &quot;yeah baby&quot; in a Terminal prompt. 🤓</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*0wKng_VUQMc0XHvJ5Qbaug.png" /><figcaption>Excerpt from one of my first source repo’s. Man, so messy. 😤</figcaption></figure><p>Fanatics will probably rage (or at least frown) at me for using text-based source control when dealing with large binary files. While the use of version control for tracking 3D files definitely has <em>some</em> drawbacks, I feel like they’re actually a good thing. I learned a lot of ‘sloppy’ and high poly habits in my first job as an arch viz artist and the limitations of using Git for the map really helped me grasp the impact on hardware, software, in some cases even the network when producing and rendering 3D content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPXM2wGcCb9mUVj5cNQLqg.png" /><figcaption>Quad overdraw. Bad for everything. 🤢</figcaption></figure><p>Don’t fret, if you insist on being pedantic: there are ASCII based 3D formats, like .STL files. Github allows you to render those in their web interface, even though the format is extremely cumbersome to work with and lacks even the most basic functionality such as smoothing groups or material id’s. 🤷‍♂️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ipOgyrArgeJQsBLqdqNRUQ.gif" /><figcaption>Github.com lets you render .STL files ánd their diffs (!) in the browser. 💅</figcaption></figure><h4><strong>Issues</strong></h4><p>When I stumbled upon issue tracking, I started using it extensively as a personal advanced to-do list and time tracker.</p><p>Thinking in issues allows you to plan ahead, defining scope and architecture before writing a single line of code. Call it Issue Driven Development, where you could sometimes very well be planning months ahead.</p><p>There’s a masochistic touch about assigning hundreds of tickets in advance, quickly aggregating into a huge backlog, looming over your head.</p><p>On the other hand, it’s exactly that kind of self-inflicted torture that helps you decide what feature is worth those precious hours!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*iZ6fpD9A32o446hsxxFnMA.png" /></figure><p>Assigning issues to Milestones helps me setting goals, like working towards apparently one of the most elusive thing about Ghent Theft Auto: a shippable first multiplayer demo.</p><p>Anyway, Projects allow you to group issues, helping you encapsulate development and understand the bigger impact of features.</p><p>Last but not least, the practice of feature branching, further allows you to isolate your development efforts, avoiding broken builds and non-relevant bugs.</p><p>When you’re done, integrate your feature branch with a commit message referencing the issue you assigned, which closes it <em>automagically</em>. 🧙‍♂️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tHVprNDe_MW5svX91y5efg.gif" /><figcaption>These kinds of visualisations alone are a reason to use source control! 😍</figcaption></figure><h4><strong>Submodules</strong></h4><p>Submodules are my most recent Git discovery and I’m loving every second of them. I got used to working with submodules as we use them as a solution for managing common code bases in our Unity projects at <a href="https://inthepocket.com/">In The Pocket</a>. We use submodules as a temporary fix because Unity’s package manager is still getting its act together with regard to 3rd-party dependencies via Git. Fingers crossed for 2019.1 🤞</p><p>Long story short: submodules act like repositories within repositories, where you can point the submodule to a specific commit.</p><p>The structure enforced upon you when working with submodules makes it impossible for you to not think about the scope and architecture of what you’re trying to achieve. Encapsulating code, enforcing the single responsibility principle and avoiding circular dependencies becomes way easier when code is literally, physically <em>split</em>.</p><p>Instead of a cumbersome, monolithic blob, your project turns into a network of intertwined plug-and-play components that can be configured into other builds and even totally new projects.</p><p>If you for instance develop a video game where you include the ability for a player to drive cars, nothing stops you from developing that feature decoupled (i.e. as an independent submodule), later including it in other productions. The added benefit being, when you improve or extend your code in those later productions, updating the original repository could - in theory - be as easy as updating the submodule.</p><p>Likewise, code you’ve written for user input could be integrated into a common submodule. That module would be shared by all your projects, streamlining your code and allowing you to quickly integrate new best practices and lessons learned from other projects into new and old ones.</p><p>I like this kind of ‘<em>plant the seed</em>’ or ‘<em>pay it forward</em>’ approach to development, as I feel it offers all the benefits and none of the disadvantages of iteration. 🌱</p><p>Another major added benefit is how they can intertwine with Unity’s package system, but that’s literally a story for a different date. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ad1fe732555" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-git-5ad1fe732555">Making Ghent Theft Auto, with Git. 🔃</a> was originally published in <a href="https://medium.com/ghent-theft-auto">Ghent Theft Auto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Ghent Theft Auto with Python ]]></title>
            <link>https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-python-ce9771220502?source=rss----1968df2b7b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/ce9771220502</guid>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Lucas Selfslagh]]></dc:creator>
            <pubDate>Fri, 25 Jan 2019 13:24:53 GMT</pubDate>
            <atom:updated>2019-01-28T10:19:59.852Z</atom:updated>
            <content:encoded><![CDATA[<h3>Making Ghent Theft Auto with Python. 🐍</h3><p>Hello, boys and girls from the internet! 👋</p><p>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. 🐍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CbJToK3f06cMP8OLcqdYA.png" /></figure><p>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.</p><p>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:</p><ul><li>file handling</li><li>web requests</li><li>parsing</li><li>analysis</li><li>plotting</li><li>re-projection of geocoordinates</li><li>geospatial image analysis</li><li>computer vision</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*DeM46RzBc6ZMnMEN9OhLgw.gif" /><figcaption>Data is obviously a huge part of Ghent Theft Auto. Here’s some bus stops. 💁‍♂️</figcaption></figure><p>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, …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*Q6ovUflabwu0XupydfuUTg.png" /><figcaption>Jupyter notebooks are a great way of prototyping Python code if you mind your hidden state 👻</figcaption></figure><p>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.</p><p>Long story short, updating the map was a hassle. 😬</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKO5gyxqoPZEgfoJFfOssg.png" /><figcaption>Back in the Unreal days.</figcaption></figure><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*NengXyhyH0vCuwc_fwQ81g.png" /></figure><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vIrg9rSldIQsZbaQW8qCNA.png" /><figcaption>There’s a method to the madness now.</figcaption></figure><p>I not only tend to see opportunity for automation and tooling everywhere, I’m actually able to implement it since I started working at <a href="https://inthepocket.com/">In The Pocket</a>!</p><p>Here, I’ve been introduced to programming by my <em>amazing</em> co-workers, allowing my skills to grow exponentially.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_8LIw2q2ZxmhOz7_8U3NhQ.gif" /><figcaption><em>32bit RGBA splatmaps using OpenCV color filtering on map tiles rendered with open street map data 👌</em></figcaption></figure><p>So yeah, enter Python automation!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*QKw9vC16D4oBK2KWRPsc_Q.png" /><figcaption>Swearing is a must when prototyping user interfaces.</figcaption></figure><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-iXeb03ePTfJczBwOjNHag.png" /><figcaption>Unity 2018.3 🕺</figcaption></figure><p>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 <strong>2 minute afterthought</strong> that you can run from <strong>any terminal</strong>, on <strong>any computer</strong>, <strong>anywhere</strong> in the world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRQOXgDWuV4hut9qAMlXTw.png" /></figure><p>Thanks to Python. 💞</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce9771220502" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ghent-theft-auto/making-ghent-theft-auto-with-python-ce9771220502">Making Ghent Theft Auto with Python 🐍</a> was originally published in <a href="https://medium.com/ghent-theft-auto">Ghent Theft Auto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>