Tiled world to unity

Hi everyone,

I currently have a world size of 30 km x30 km and i want to export it to unity so i was looking for the correct procedure to do it, i did search the forum but didn’t found what i was looking for.

Also some posts are from very early version of WM and with recent version thing might have change but the information seem hard to find.

I know the basic stuff about exporting raw tiled set but what about the y axis? Should i just flip all of them in Photoshop?

It would be nice to have a forum section with clear and precise instructions for the most used features.

Regards Peter

Ok i did some test yesterday and i saw the flip y axis checkbox in the tiling window and it seem to work but at some place on the tarrain there seem to be uneven gap not matching the tile.

I didn’t use any problematic device in the build just a simple layout generator with advanced perlin and an erosion.

Is there a script to assemble those terrain in unity instead of having to put them all by hand?

Regards Peter

Hi everyone,

Regarding the height is there a precise math formula to get the exact height of the terrain? Unity unit are meter and so far the only way i have is to guess it since the unit doesn’t seem to represent the same regarding the height.

Regards Peter

Anyone on this?

Hi Peter,

I’m not 100% sure what people usually do to place many (tiled) objects into Unity.

In terms of matching up units, Unity Terrains let you specify their worldspace size in terms of the terrain width, length, and height (with Y=up)

You should be fine so long as Unity and WM agree on the size of your terrain tiles:

Set the elevation (Unity Y axis or height) in Project Settings -> General Setup. Set the minimum to 0m and the maximum to whatever you told unity (default 800)

If you are creating a 30km x 30km area, lets say with 5 tiles on a side, make sure you import the terrains into Unity respecting the tile size (30km/5 = 6000m) values for the width and length.

If you are using the “Flip-Y orientation” output option in tiled build, you shouldn’t have any artifacts introduced by doing so. (On the other hand, using a Flipper device in the World IS NOT tiled build compatible). Edges should always match – double check that “Share edge vertices” is also checked.

Hi Stephen,

Thank for replying and we solved the terrain gap by using a Unity plugin that stitch the terrain tiles automatically.

Since we made the world with ocean floor we have set the height parameter to - 2000 m(ocean floor) and 8000 m for highest point on the map and it seem to work fine.

The only thing left to do now is to put the rivers and lakes and sent the terrain to Mudbox for further tweaking.

Regarding road i found it hard to adjust the value since the preview doesn’t show anything when i change the elevation of the road, i can only see it upon rendering.

Regards Peter

Hi everyone,

I did some more test yesterday and unity unit for height are certainly not meter since i made a test scene with a 300 meter square and import it in unity at 300 and it was way to flat so i had to bump the value to 600(default value) and it seem OK.

Unity help is so bad and their forum is useless about precise questions that the only choice you have is to find out by yourself.

Regards Peter

I have just recently released a package on the Unity Asset store that should ease the import process. It should work with terrains from different programs, but it was primarily built around World Machine. You can import a single heightmap/alpha map or a tiled set.

It’s only $5, and if you’re going to be importing tile sets repeatedly I highly recommend it. Here’s the link to the forum page where you can find more information: http://forum.unity3d.com/threads/released-terrain-importer.264640/

If you’re not interested, that’s cool. Here are the steps I follow to import my World Machine tile sets into Unity.

Obviously this isn’t the only way to go about creating/importing a tile set, but it’s the way I do it, and it works well. I am not using World Machine 3 yet, so not sure how it works with it. I’ll have to do some testing soon.

This is not a definitive guide; this is just what has worked well for me.

  1. Generate a non tiled heightmap with your tile set in mind. For example, if at the end of this process
    you want a 4 x 4 tile set with each tile having a heightmap resolution of 513, then generate a non tiled
    heightmap with a resolution of 2049.

  2. Generate a splat map the same way, but make the resolution a power of two (rather than a power of two + 1).
    I am not 100% positive this is necessary; you may be able to get a way with a power of two + 1 splatmap.

  3. In an image editing program such as Photoshop, open the generated splatmap and generate four separate images, one for each channel.
    You can use Gimp for this, though Photoshop supports higher texture resolutions. Just google “Creating images from channels,” or something
    similar to find out how to performt his step for your image editing software.

  4. Configure your World Machine tile settings.

    a) Under Tiling Options, leave the "Share edge vertices" option enabled, but disable all other options.
    
    b) Change the Tile Resolution and Tile per Side to whatever you desire. Just make sure the settings make sense.
       If your original heightmap is 2049, and Tiles per Side is 4, the Tile Resolution should be 513.
    
    c) Set Blending Percentage to 0.
    
    d) Disable Pad coordinate digits. I also recommending changing the "Tiles start numbering at" option to 1 | 1 and 
       "Naming string" to _%y_%x, but this is not required. Note that %y = Row and %x = Column when configuring the import settings in Unity (This step is only required when using my tool).
    
  5. Add a File Input Device and load the heightmap you generated in Step 1. Make sure to choose the “Place from Current” button under
    “World Placement.” Hook this up to a Height Output device and configure the output device however you wish. Make sure “Participate
    when building tiled worlds” is enabled, and then run a tiled build by clicking on the Green sphere with the cross on it.

  6. Once your heightmap tiles are generated, it is time to generate your splatmap tiles. Go back to your world machine settings and adjust the
    tile resolution so it is a power of two rather than a power of two + 1.

  7. Add four file input devices, one for each image you generated earlier (for the R, G, B, and A channels). Load each image and press the
    “Place from Current” button.

  8. Hook the R, G, and B File Input Devices to a Channel Combiner Advice, and then run that Channel Combiner Device to a Bitmap Output device (top input).
    Hook the A File Input Device to the bottom input of this same Bitmap Output Device. Configure the Bitmap Output device, making sure that
    “Participate when building tiled worlds” is checked. All other World Machine Settings configured in step 4 can be left the same.
    Run another tiled build.

  9. You should now be ready to import the tile set.

xrumer888@outlook.com

jarrybrown@outlook.com