Skip to content

Latest commit

 

History

History
175 lines (91 loc) · 10.8 KB

create_background_terrain.md

File metadata and controls

175 lines (91 loc) · 10.8 KB

How to create a background terrain

To create a background terrain for the Farming Simulator map, you need to open the *.obj files with the terrain, obtain the satellite images as described in the Download high-resolution satellite images tutorial to use them as textures and export your results to the *.i3d format.

ℹ️ In this tutorials it's assumed that you have already generated the map and downloaded satellite images from the previous step: Download high-resolution satellite images.

Let's go straight to the deal:

  1. Download and install the Blender software.
  2. Download and install the Blender Exporter Plugins from the official Giants Software website.
  3. Activate the Blender Exporter Plugins in the Blender.
  4. Now, you can import the *.obj. Go to File -> Import -> Wavefront (.obj) and select the *.obj file.

Import obj

  1. Select the imported object, right-click on it, click on Set Origin -> Origin to Geometry.

Origin to geometry

  1. Click on the arrow icon or press the N key.

413003

  1. In the Item tab, change the Location [2] to 0, 0, 0 and the Rotation [3] to 0, 0, 0.
    Set the Dimensions [4] of the background terrain in meters. It's calculated as map size + 2048 * 2. For example, if the map size is 4096x4096, the size of the terrain should be 8192x8192.

Transformation

  1. Switch to the View tab and change the End value to 100000 or something like that. It's just to make sure that the terrain is visible, otherwise it may partially disappear.

Item end

  1. Now we need to add a Modifier to the terrain. Click on the Modifiers tab, then click on the Add Modifier.

Add modifier

  1. In the dropdown menu, select the Decimate modifier.

Select decimate

  1. Now you need to adjust the Ratio value. The Ratio value will determine how much the terrain will be simplified. The lower the value, the more simplified the terrain will be. It depends on your actual terrain, but a good starting point is something like 0.05 and lower. Remember, that this is a background terrain, which almost not visible in the game, so it's quality doesn't really matter. And the more simplified the terrain is, the less resources it will consume.

Apply decimate

  1. Select the object, right-click on it, and select Shade Smooth. It will automatically smooth the terrain. Note that it may not work perfectly, so you may need to Ctrl + Z it, change the value of the Decimate modifier, and try again. And again: it's a background terrain, so it doesn't need to be perfect.

Shade smooth

The object should look more like a terrain now with the Shade Smooth applied.

After shade smooth

  1. It's time to add a material to the terrain. Click on the Material Properties tab, then click on the New button.

Material

  1. Go to the Surface section, click on the Base Color CIRCLE (not the color itself), and select the Image Texture. Provide the path to the satellite image you want to use as a texture.

Image texture

  1. Go to the Emission section, click on the Color THE COLOR ITSELF now (not the circle), and select completely black color. Otherise, you wont be able to see the material in the Giants Editor.

Emission

  1. Open the UV Editing tab, and in the right tab change the view to Top by pressing 7 on the numpad or holding the Z key and selecting the Top.

UV editing

  1. Now ensure that the texture has a correct orientation relative to the terrain. If it's not, you can rotate the texture image before moving on. After you ensured that the texture is correctly oriented, switch to the right tab and select everything by pressing A. Everything on the right side should be selected (orange). Now press the U key and select one of the Unwrap options. Recommended one is Unwrap -> Angle Based. It should work fine for the most cases. The second one is Project from View (bounds). It will project the texture from the view you are currently in. Note that it should be done in the Top view, otherwise the texture may be projected incorrectly.

Unwrap

  1. Now return to the Layout tab, press and hold Z and select Material Preview. You should see the terrain with the texture applied. Now you can adjust the scale of the object in the Transform tab. Note, that you can do it later in the Giants Editor as well.

Materail preview

Cutting out the center of the map

Now we will need to cut out the center of the map from the mesh. There are two aprroaches to do it. Using the Boolean modified and using the Knife Project tool. The Boolean modifier is more straightforward, and usually it works much better, so it's highly recommended to use it, not the second one.

ℹ️ This tutorial was added after the main one, so it will contain different untexutred terrain, don't be scared of it!

Using the Boolean modifier

  1. Press Shift + A and add a Cube to the scene.

Add cube

  1. Set the size of the cube X and Y the same as a map size. For example, if the map size is 4096x4096, the size of the cube should be 4096x4096. The Z can be any value, but it should be bigger than the terrain itself!

Set cube size

  1. Make sure that the cube FULLY cuts through the terrain (higher and lower than the terrain).

Cuts through

  1. Now select your background terrain, go to the Modifiers tab, click on the Add Modifier.

Add modifier

  1. Type Boolean in the search bar and select the Boolean modifier.

Select boolean

  1. Click on the Dropper icon.

Dropper

  1. Now click on the cube in the scene.

Click on cube

  1. Click on the Fast option.

Fast

  1. Now you can hide the cube by clicking on the eye icon and ensure that the terrain is cut out correctly.

Hide cube

We are done! You can now move to the final step: Export the object.

Using the Knife Project tool

❌ This method is not recommended, as it's much more complicated and usually doesn't work as expected. Use it only if for some reason the Boolean modifier doesn't work for you.

Click to expand
  1. Press Shift + A and add a Plane to the scene.

Add plane

  1. Set the size of the plane X and Y the same as a map size. For example, if the map size is 4096x4096, the size of the plane should be 4096x4096. The Z can be any value, but the plane must be well above the terrain.

Set plane size

  1. Press Tab and then A to select all vertices of the plane. Press U and select Project from View (Bounds). Switch to the Top view.

Top view

  1. Ensure that your terrain is selected, then Ctrl + Click on the plane.

Ctrl click

  1. Now click on the Mesh and select Knife Project.

Knife project

  1. After a while, you'll see that the central part of the terrain is selected.

Selected

  1. Press Delete and select Faces.

Delete faces

  1. The central part of the terrain should be removed now.

Removed

Pay attention to the fact this method can produce artifacts. Remember that it's not recommended to use it, but if you have no other choice, you can try it.

Artifacts

Exporting the object

  1. It's finally time to export our object as an *.i3d file. Open the side panel by pressing N and select the GIANTS I3D Exporter tab. If you can not see it here, that means you did not installed the Blender Exporter Plugins (step 2) or you did not activated it (step 3). Now ensure that the object is selected [1], specify the path to the output file [3], and click on the Export selected button [4]. You can also use the Export all option, but ensure that you don't have any other objects in the scene, for example by default Blender adds a camera and a light source and a cube.

Export to i3d

Now we can go to the final section of the tutorial: Import the i3d files to Giants Editor. Or you can go back to the previous step: Download high-resolution satellite images.