Tile_Parent

Table of Contents

Summary

Tile_Land_Foundation

Tile_Ocean_Foundation

Camera_Detection_Plane

Attached Scripts

Summary

The Tile_Parent prefab is instantiated at each point in the grid specified by the RL World Generator window. The tile contains the models necessary to represent many different biomes, and is instantiated during development in order to avoid instantiating at runtime/while the players is playing the game build.

The top level game object named Tile_Parent holds scripts that manage tile-wide parameters and helper functions that modify the tile. Tile_Land_Foundation represents land-based tiles (deactivated when the tile is Ocean-based). Tile_Ocean_Foundation represents ocean-based tiles (deactivated when the tile is Ocean-based). The Camera_Detection_Plane deactivates Tile_Ocean_Foundation AND Tile_Land_Foundation when the player (or you, as the developer, looking through the editor) can no longer see the the tiles and reactivates them just before they come into view.

Tile_Land_Foundation

Activated when this tile is considered ‘land’.

Foundation_Additions has no real purpose other than to serve as a parent to all of the aesthetic models added (such as the rocks that can be seen) and can be safely ignored (or added to).

Tile_Toppers is far more important, and represents the ‘land’ that shows up in many biomes. In the picture above, it’s the purple-colored rectangle that the mountain is resting on. It serves as the parent to all of the different biomes.

Tile_Ocean_Foundation

Activated when this tile is considered ‘ocean’.

Foundation_Additions has no real purpose other than to serve as a parent to all of the aesthetic models added (such as the rocks that can be seen) and can be safely ignored (or added to).

Camera_Detection_Plane

Warning: This is a runtime component that should NOT be used during training or inference. In other words, you should only let the player see tiles when the world has completed generation.

The Camera_Detection_Plane serves a significant performance role; it turns off Tile_Land_Foundation and Tile_Ocean_Foundation when the player cannot see the tile anymore. It does this by using the Renderer.OnBecameVisible() to turn Tile_Land_Foundation and Tile_Ocean_Foundation on when the Camera_Detection_Plane itself is visible and Renderer.OnBecameInvisible() to turn Tile_Land_Foundation and Tile_Ocean_Foundation off when the Camera_Detection_Plane itself is no longer visible to the player.

Note: The script remembers which was activated last (Land or Ocean) and will only reactivate the previously active Foundation when the player comes into view.

Attached Scripts

Tile_Parent/Camera_Detection_Plane/Render_When_Visible.cs

Inputs

  • tile_land_foundation: While viewing Tile_Parent in the Prefab Mode, drag and drop the Tile_Land_Foundation GameObject to this input in the Inspector.
  • tile_ocean_foundation: While viewing Tile_Parent in the Prefab Mode, drag and drop the Tile_Ocean_Foundation GameObject to this input in the Inspector.

Table of Contents

Summary

Tile_Land_Foundation

Tile_Ocean_Foundation

Camera_Detection_Plane

Attached Scripts


Summary

The Tile_Parent prefab is instantiated at each point in the grid specified by the RL World Generator window. The tile contains the models necessary to represent many different biomes, and is instantiated during development in order to avoid instantiating at runtime/while the players is playing the game build.

The top level game object named Tile_Parent holds scripts that manage tile-wide parameters and helper functions that modify the tile. Tile_Land_Foundation represents land-based tiles (deactivated when the tile is Ocean-based). Tile_Ocean_Foundation represents ocean-based tiles (deactivated when the tile is Ocean-based). The Camera_Detection_Plane deactivates Tile_Ocean_Foundation AND Tile_Land_Foundation when the player (or you, as the developer, looking through the editor) can no longer see the the tiles and reactivates them just before they come into view.


Tile_Land_Foundation

Activated when this tile is considered ‘land’.

Foundation_Additions has no real purpose other than to serve as a parent to all of the aesthetic models added (such as the rocks that can be seen) and can be safely ignored (or added to).

Tile_Toppers is far more important, and represents the ‘land’ that shows up in many biomes. In the picture above, it’s the purple-colored rectangle that the mountain is resting on. It serves as the parent to all of the different biomes.


Tile_Ocean_Foundation

Activated when this tile is considered ‘ocean’.

Foundation_Additions has no real purpose other than to serve as a parent to all of the aesthetic models added (such as the rocks that can be seen) and can be safely ignored (or added to).


Camera_Detection_Plane

Warning: This is a runtime component that should NOT be used during training or inference. In other words, you should only let the player see tiles when the world has completed generation.

The Camera_Detection_Plane serves a significant performance role; it turns off Tile_Land_Foundation and Tile_Ocean_Foundation when the player cannot see the tile anymore. It does this by using the Renderer.OnBecameVisible() to turn Tile_Land_Foundation and Tile_Ocean_Foundation on when the Camera_Detection_Plane itself is visible and Renderer.OnBecameInvisible() to turn Tile_Land_Foundation and Tile_Ocean_Foundation off when the Camera_Detection_Plane itself is no longer visible to the player.

Note: The script remembers which was activated last (Land or Ocean) and will only reactivate the previously active Foundation when the player comes into view.


Attached Scripts

Tile_Parent/Camera_Detection_Plane/Render_When_Visible.cs

Inputs

These can be set in the Editor mode of the Unity game engine. They will not be overwritten.

  • tile_land_foundation: While viewing Tile_Parent in the Prefab Mode, drag and drop the Tile_Land_Foundation GameObject to this input in the Inspector.
  • tile_ocean_foundation: While viewing Tile_Parent in the Prefab Mode, drag and drop the Tile_Ocean_Foundation GameObject to this input in the Inspector.

Tile_Parent/Tile_Properties.cs

Inputs

These values are automatically set. They will be overwritten at runtime.

  • elevation: Oceans are typically low elevation, Land is average elevation, and Mountains are high elevation.
  • temperature: Deserts and Jungles/Swamps are typically higher temperatures, while Arctic is typically low temperature.
  • moisture: Deserts are typically low moisture, while Jungles/Swamps are typically high moisture.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: