Just like many of the posts I have read in the past few months,I wanted a large map for my game world but didn’t want to purchase World Machine. So, I’ve been working on other parts of my game, and occasionally I come back and put some time into figuring it out…
This week I spent the last couple of days working on this and came up with a solution. It takes lots of work but can be accomplished for free.
This is a list of the basic steps I took;
Acquire or make your heightmap from your preferred source. Next, we need to resize it, change the format, and cut it into pieces.
Determine the overall size of the landscape as you want it after it’s done…
Remember, if it’s over 20 km per side, you need to implement your own streaming method for multiplayer… Single-player, no problem…So It might be best to keep it under that unless you’re prepared to delve into that ball of worms.
This is how big your heightmap needs to be in meters… So a 20km wide heightmap would need to be 20000 pixels wide…
However, you have to take a look at the tech data page( https://docs.unrealengine.com/en-US/…ide/index.html ) for landscapes to determine which size works best for your situation. Then round off to make the division work. I wanted as close to 20km on a side as I could get, but I also wanted to have many landscapes that had free components and could be unloaded and streamed in, to make the CPU overhead as small as possible. I ended up going with 19171 pixels. That made 19-1009 meter wide landscapes as close as I could determine with 64 8x8 components each.
Open in gimp, and resize to the appropriate size.
Make sure to set the resolution to 16bit, and the color to grayscale. Save.
Import the grid guides plugin from Github… The gimp plugin depository is closed, but they have a link to it on Github.
Use grid guides to divide up your heightmap into the appropriate number of images.
Go to filters<web<slice to use pyslice to cut up and save your tiles as .png to import into world composition.
Rename the images to use the format that world composition needs, or it won’t import properly.
I found that I was able to change the base name to img_X , and that helped…
Ue4 need the images named as name _X then the xcoord, and then_Y ycoord.
I rewrote the python code in pyslice to do this… If you attempt this, the i and j variables are backward for the naming convention.
- After importing into world composition many times I realized a few things.
First, if all had to turn off" flip y" in the importer. Also, if you don’t edit pyslice, the import scrambles the order of the maps. Pyslice cuts up the pic with rows marked as x and columns as y, while ue4 is the opposite. At first, I just moved all the tiles into the correct place, but that got to be really old quickly, so I went back and edited Pyslice again.
I couldn’t figure out how to get the image to share pixels between images yet. This allows for some of the map edges to not meet exactly. So for right now, all I do is run a smoothing brush at about .02 strength over the edges to stitch the seams together. This works well, but there is also the work of smoothing the entire landscape, because even though my heightmap was over 4gb. It wasn’t high enough detail for smooth terrain. So, between stitching the seems and smoothing the terrain, there is quite a bit of work. But it can be done for free.
I made this original post from my phone, so I’ll post some pics soon for examples