Building the map on the GPU

In the latest build of the game (0.15.16), we’re now creating the game map on the GPU, instead of on the CPU. This is much faster (at least for me and on every computer I’ve tried), and some parts of the process (particularly patching the terrain after it’s been built) actually build nicer-looking geometry as well.

On my main development machine, it’s gone from taking about two seconds to build the full terrain down to being almost instantaneous. On my older laptop, it’s gone from taking about four seconds to taking just a fraction of a second (albeit with a short stutter). I’m hoping that other folks see big improvements, too, and that it works for everyone!

If you’ve had a chance to play with this build, I’d be very grateful if you’d post a reply, letting me know whether the GPU-based map building worked correctly for you, and if it was noticeably faster than before. I’m especially interested in anybody who has an AMD video card or an integrated Intel chipset, as I’ve been unable to test it in those situations, yet; all my computers happen to use NVidia right now, which is a little unfortunate for testing purposes!

1 Like

It certainly seems to build faster, but is it normal for the terrain to look a little… Odd? Many zones are made up purely of mountains and others appear to be water, the individual zone fixes itself when you buy it and place a custom terrain anywhere.

I’ve included an example of a generated map:


Yup, I’ve been noticing that myself!

What seems to be happening is that during the load, some regions are generating as if they were full of their fourth terrain type, rather than what’s actually supposed to be inside of them. My guess is that the terrain generation is somehow happening before the regions manage to initialise their terrain data properly.

Can’t quite figure out how that could happen, but by following my usual “Imagine that I’m an evil programmer who wanted to surreptitiously get this result without anyone realising, how would I do it?” debugging technique… that’s going to be the first thing I chase.

Also, I really have to fix the color of those tips of mountains extending into the ocean. Those were like that in the CPU-based map building as well, but… they’re still bugging me, the way that the regions are dark but these mountain tips are full brightness, even though they’re extending into unowned sea regions.

Okay, in the latest build the bug I mentioned above seems to be fixed.

Now the bug that folks are noticing is that paths and network cables can’t be placed in regions which support either mountain or chasm terrain types; that’s because I moved terrain building to the GPU, and so the CPU no longer knows the exact shape of the terrain; it’s assuming that every terrain type is everywhere, and says “you can’t build a path/cable there, there’s a mountain in the way!” even if there isn’t actually any mountain in the region at all.

To work around the issue for the moment, you can edit a region to switch its Mountain or Chasm terrain types to a terrain type that can be walked on; that will get path and cable laying working again. I’ll try to get a build out today to fix the issue properly, though; just means I need to pull another piece of terrain data back to the CPU.

1 Like

I’ve already shared this over on the Discord, but here’s something that’s coming soon: