I am having an issue with importing a PNG heightmap compiled from ArcGIS from LIDAR data. When I bring it to the World Editor, the terrain doesn't import correctly and shows up as a block with no collision. This is the heightmap I am importing, (~3kmx7km, 1pixel=1meter). Vertical Rise is ~1123m. Is there something wrong with the image, settings or is the game just being problematic?
I think it needs to be a square image with a resolution to the power of two. For example, a 2048 x 2048 pixel png. Or 1024 x 1024 and so on. So, you would have to cut parts of the image off or add some blank space or something. Also, I'd remove the already existing terrainblock from the level. That might cause some issues as well. You should only have one per level and as far as I know additional ones don't have collision.
Exactly as above. You can just add a black section to square it all off. But it's got to be a multiple of 512. 1024x1024, etc. all the way to max 8kx8k (unless they've changed it to allow more). Also, it will need to be the right format and compression to work well. Have a look at my map in an evening post, I think I explain which compression there. --- Post updated --- Taken from that post, useful if you get stepping. Often the case with heightmaps: Ok, to smooth the map, you need to load the HM into GIMP, then change the mode to 16 bit (floating) grayscale Then run a gaussian blur (I do 2.5) Then export as a 16bit Gray with no compression. - this gets you the smooth terrain as above - without losing too much of the detail that makes it interesting. --- Post updated --- Just remember all your textures will need updating to match whatever resolution you chose.
When I try do to this I'm getting lua script erros related to missing data, so is there any "best practices" regarding removing the default terrain and adding a new one from the heightmap?
I don't know. I've had some issues with that lately as well, though not lua-related. When deleting a terrain and importing a new one directly after, my game crashes for some reason. So I delete the terrain, safe the level and restart the game. Then I'm able to import the new terrain without issues. Maybe the error you get is specific to one certain level? The terrain object could be referenced somewhere by lua so it throws an error when it's deleted. You could try removing the terrain of a different level to see if it happens there as well.