XYZ

Devlog 9 - Terrain

So currently my map consists of a base plane, and a bunch of cubes that I have to manually place to build the map. This didn't seem like a scalable way to create maps, and it's also no fun to manually place them.

Here is our current map it's not very pretty. XYZ

So obviously my first thought is we can just create a landscape with unreal's tools and maybe sculpt out are map. Well... that would be fine if we had some sort of open world game where terrain changes all the time. But for our RTS most of the map is going to be flat areas with sharp height differences. Let's look at starcraft for reference.

XYZ

Here is a classic map from SC2 Steppes of War. As you can see from the minimap image the map is a bunch of different height planes connected by ramps.

Using the sculpt tool isnt going to give me the very calculated looking maps that starcraft has. I started thinking that maybe I can create some sort of tool in Unreal that subdivides an flat landscape and let's me edit them in the editor. But that is way beyond the scope of this game. So let's go wayyyyyy simpler.

Height Map

I'll be honest I have 0 experience with terrains, but I did remember that landscapes can be altered with Heightmaps which are just grayscale images that unreal uses to adjust the heights of it's landscape. After reading some UE5 docs I decided it's worth a try to make a super simple heightmap and see how it looks.

I loaded up Photoshop and created a 128x128 image. I made the base ground a dark grey and our leveled planes a lighter gray. Then with the gradient tool i made rectangles connecting the light to dark pixels. Honestly I had no idea if this would even work.

XYZ

I then created a new landscape importing our heightmap, and after some tweaks to the Z scale we got..

XYZ

Honestly surpassed my expectations, but it didn't come without some bugs. As our land scape is 128x128 I had to resize our MapManagerGrid to be 128x128 in size since previously it was 100x100. After a lot of debugging our FogOfWarManager, MinimapManager, MapManager were back up and running fine.

I had a terrain material pack from one of my old projects, so I plopped it into our new terrain.

newterrain

I'm super satisfied with the results! There's some adjustments I'll need to make for the material. But making different kinds of maps is just editing a 128x128 image!

Here's a demo! Thanks for reading if you have any questions email me at jandro@xyzrts.com

View original