Skip to content

Commit

Permalink
Docs update.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Dec 16, 2024
1 parent 9c080d3 commit 90e7cea
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 16 deletions.
104 changes: 99 additions & 5 deletions docs/create_background_terrain.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Let's go straight to the deal:

![413003](https://github.com/user-attachments/assets/c3b74d01-624a-4c1f-b5ad-ef620cbb33d4)

7. In the `Item` tab, change the `Location` to `0, 0, 0` and the `Rotation` to `0, 0, 0`.
7. 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](https://github.com/user-attachments/assets/3fa04f93-12c2-420d-9313-a5cf0186e686)
![Transformation](https://github.com/user-attachments/assets/bdd0be37-2a38-44e7-bbb8-21e1a0929756)

8. Swtich to the `View` tab and change the `End` value to `10000` or something like that. It's just to make sure that the terrain is visible, otherwise it may partially disappear.
8. 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](https://github.com/user-attachments/assets/e838aa9c-09b7-4ede-b666-de83eb82fbbe)

Expand All @@ -37,7 +38,7 @@ Let's go straight to the deal:

![Select decimate](https://github.com/user-attachments/assets/1524ec71-a252-491e-8d39-84e7435980cd)

11. 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.5` 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.
11. 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](https://github.com/user-attachments/assets/c7111d5d-a32a-4264-9810-bcfd948d8cd3)

Expand All @@ -47,7 +48,7 @@ Let's go straight to the deal:

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

![After shade smooth](https://github.com/user-attachments/assets/c3006eba-0e5b-470f-88be-04cab9dd4139)
![After shade smooth](https://github.com/user-attachments/assets/2128a862-7a9c-4fdc-ab2f-316eadd9496e)

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

Expand All @@ -73,6 +74,99 @@ The object should look more like a terrain now with the `Shade Smooth` applied.

![Materail preview](https://github.com/user-attachments/assets/30f8434b-0e68-4b67-b39b-cdd91d2a68d1)

### 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](https://github.com/user-attachments/assets/57732730-f388-42b9-960d-3ca668cdca27)

2. 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](https://github.com/user-attachments/assets/2bf22467-85ac-4b01-84fd-5dd74a6f58f6)

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

![Cuts through](https://github.com/user-attachments/assets/85361f53-e267-4892-86d2-d6db460f26f2)

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

![Add modifier](https://github.com/user-attachments/assets/6718a948-3353-4375-a569-07a4a1e5d8f8)

5. Type `Boolean` in the search bar and select the `Boolean` modifier.

![Select boolean](https://github.com/user-attachments/assets/11b4be71-c4d7-431a-9e75-f7fe39368003)

6. Click on the `Dropper` icon.

![Dropper](https://github.com/user-attachments/assets/292dcfaa-d6cc-4b42-be1f-1b83e03951c4)

7. Now click on the cube in the scene.

![Click on cube](https://github.com/user-attachments/assets/9fc8272b-5d4f-4477-8460-506d1007116f)

8. Click on the `Fast` option.

![Fast](https://github.com/user-attachments/assets/9e54b078-da25-471c-98e8-cd71c635cf91)

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

![Hide cube](https://github.com/user-attachments/assets/6ee61673-bc35-4942-a31a-8e2b55883e83)

We are done! You can now move to the final step: [Export the object](#exporting-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.

<details>
<summary>Click to expand</summary>

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

![Add plane](https://github.com/user-attachments/assets/7d66f878-24dc-4b83-aa44-949dc78a100b)

2. 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](https://github.com/user-attachments/assets/89ac8cd5-a9de-4c46-b3d4-59e594d876b0)

3. 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](https://github.com/user-attachments/assets/9cb1ce28-980b-4e02-b4cb-6fe89794927d)

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

![Ctrl click](https://github.com/user-attachments/assets/7c67713b-6346-4189-b595-3f5cfbbaaf40)

5. Now click on the `Mesh` and select `Knife Project`.

![Knife project](https://github.com/user-attachments/assets/eded9fba-af0e-44f0-948f-436ad06a8088)

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

![Selected](https://github.com/user-attachments/assets/33187de6-26ee-4d31-bf0b-a7809766a2cf)

7. Press `Delete` and select `Faces`.

![Delete faces](https://github.com/user-attachments/assets/76328118-03d7-48cc-a9fc-b845cfe8c9e6)

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

![Removed](https://github.com/user-attachments/assets/bf787700-2e12-4b4b-96fc-3ec9042cd2ed)

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](https://github.com/user-attachments/assets/e9df0436-54d7-474c-9cbe-76c950f31a53)

</details>

### Exporting the object

19. 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.

Expand Down
23 changes: 12 additions & 11 deletions docs/import_to_giants_editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,30 @@ Here's what you need to do:

![Import](https://github.com/user-attachments/assets/32145805-6583-4147-ac04-4c69d041b554)

4. Postition the terrain in the correct place. You can use the `Transform` panel to move, rotate, and scale the terrain.

![Position](https://github.com/user-attachments/assets/8202b2f5-2286-4213-8785-c3779e9ad88a)

5. If after the import you can't see the texture on the terrain, you need to add the texture manually.
4. If after the import you can't see the texture on the terrain, you need to add the texture manually.
Open the `Material Editing` panel (if it's not visible click on the `Window` menu and select `Material Editing`) and ensure that you've selected the correct object in the `Scenegraph` panel. Find the `Albedo map` and click on the `...` button to select the texture for the terrain.

![Albedo map](https://github.com/user-attachments/assets/20a197cd-dadf-4e61-8ad2-c6752d60fb17)

6. The new window will appear, click on the `...` button and select the texture for the terrain.
5. The new window will appear, click on the `...` button and select the texture for the terrain.

![Select the texture](https://github.com/user-attachments/assets/29940c6d-1c18-4077-a0f0-ce525a9bc503)

7. If you did not convert the textures to the `.dds` format, you will see the warning message asking you `Convert now?`. Click on the `Yes` button to convert the texture to the `.dds` format.
6. If you did not convert the textures to the `.dds` format, you will see the warning message asking you `Convert now?`. Click on the `Yes` button to convert the texture to the `.dds` format.

![Convert now](https://github.com/user-attachments/assets/1778363a-1701-4c49-9fc7-67a1e67b3257)

8. You should be able to see the texture on the terrain now. So now you only need to adjust the position of the terrain in the world.
7. You should be able to see the texture on the terrain now.

8. If you have used the method of cutting out the center of the map from the previous tutorial, you only need to adjust the `Translate Y` and `Scale Y` values which will be different for each terrain.

ℹ️ This examples were added later, so they will contain different untexutred terrain, don't be scared of it!

![Adjust the terrain](https://github.com/user-attachments/assets/d5b6aec2-8e81-47e4-92f1-752a8df7fd69)

![Terrain with texture](https://github.com/user-attachments/assets/a5da03a6-42b3-4010-997e-787c0d9bee38)
And it should be perfectly aligned with the rest of the map.

So, we'are done here.<br>
ℹ️ Please note, that is almost no way to align all background terrain with map perfectly without editing them in the 3D editor, Blender for example. You can find a lot of tutorials on YouTube on how to do it, this won't be covered here. Or you can just leave it as is and find the best possible position for the terrain, and maybe hiding the edges with some objects. It's up to you.<br>
![Aligned terrain](https://github.com/user-attachments/assets/e31e8f27-032c-4096-8043-20e94dfed6ac)

If you want, you can go back to the previous step: [Prepare the i3d files](create_background_terrain.md).<br>

Expand Down

0 comments on commit 90e7cea

Please sign in to comment.