Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Official Worldbuilding

Discussion in 'Open Projects' started by cirocontinisio, Jun 25, 2021.

  1. cirocontinisio


    Jun 20, 2016
    In the past 3-4 weeks we've done a lot of work on building the final version of the game's world, so I wanted to start a new thread and update you all on how the work is going, what is going great, and on what challenges we're facing.

    First: the island is BIG. Despite all the efforts to keep it as contained as possible, it feels pretty big and it's super cool to go through all the scenery - and the changes in the time of the day.

    Here's an aerial shot, taken from a scene called IslandMaster, which I use to bake skyboxes.


    The whole island is divided into 9 scenes, which pertain to 5 "biomes" (beach, field, town, mountain and forest). We refer to these as the Locations. The "biomes" are reflected in the scene name, and the only thing they dictate for now is the change in music. So for instance, when moving between Beach and Field_Hill the music will change, but between Field_Hill and Field_Farms it won't.

    Note that Field_Hill is what we used to call Glade


    Entry / Exit points

    Every scene has 1 or more entry point, and 1 or more exit. Exit points write into an SO called PathTaken (in ScriptableObjects/Gameplay) that stores the last scene you came out of, and which exit you took. Whenever a scene is loaded, the player is spawned in an entry point depending whether the path in PathTaken matches any entry point. Otherwise, they get spawn in a default location (which is the one under the prefab SpawnSystem, called DefaultSpawnLocation)


    You can relocate this point when testing thanks to a beautiful little custom inspector made by a contributor (Place at Mouse Cursor), since this is also the one used when you just press Play in a random scene.


    This default entry point is only ever used in-game in the very first scene, the Beach, where the player initially spawns next to the boat.

    In some scenes, exit points are used as a "fall-catcher". For instance, in the Field_Hill, if you jump down the hill from any side, the Beach scene is loaded and the player will spawn at the entry point that connects them.
    Similarly, the scene Town_Upper has a few catcher colliders that will take you to Town_Inner, Town_Market, Mountain or Forest_Entrance, depending on where you fall. We can use this system to prevent the player from going too far into the water, which is possible for now.

    MortyJHin and itsLevi0sa like this.
  2. cirocontinisio


    Jun 20, 2016

    As planned a while ago, we have a scene (IslandMaster) where we bake skyboxes containing the geometry that is so far away that it doesn't make sense to have it in 3D. So for instance from the Forest, the whole block of the Beach, Field_Hill, and Field_Farms is rendered by a reflection probe that is in turn connected to a custom Cubemap asset:


    When we press Bake, the probe captures the scene into the right cubemap asset (in Art/Skyboxes/Captured) which is already connected to the right skybox material (in Art/Skyboxes/Captured/Materials) which is in turn already used as a sky in the right Location scene.


    So you open the scene Forest, and voilá:


    The close geometry on the left (Town_Upper, Town_Market) is 3D, while the Beach/Field block is in the background.

    We will continue to fine tune this workflow as we go.
    Harsh-NJ, JoNax97 and itsLevi0sa like this.
  3. cirocontinisio


    Jun 20, 2016
    Scene chunk Prefabs

    Every Location scene is made of dozens of prefabs that break it into "chunks". They are mostly rocks, walking ground (the "landmasses"), trees, and town structures. By bringing all of the right prefabs into an empty scene, you would be able to reconstruct the whole scene with all its details. All prefabs are massive containers so they don't need to be positioned, just drop them in a scene from the hierarchy and their position should be already correct.

    Chunks can be of two types. At the beginning, I've blocked out all the game world with rough chunk prefabs, using as less rocks as possible to just block the mass of the island. These "low fidelity" chunks are used for faraway shots, and you will see a lot of them in the IslandMaster scene - so they also appear in skyboxes.

    However, when you are playing in the scene, all of the close prefabs are a different version whose name ends with _CL (stands for "close", the ones you see from up close). These contain detailed geometry, precise colliders, and all of the little details (flowers, bushes, grass, etc.).

    So in Beach, what you see is this. All of the beach prefabs are there (palms, shells, small rocks, rocks in the water) and all the rocks that are close are in their CL version. The rocks on the back of the hill are in their "low detail" version (orange arrows):


    When you go up the hill, you get the trees, the fine details (grass, rocks, flowers) that were not present in the Beach scene, plus all the rocks surrounding you are now in their CL version. The prefabs pertaining to the farms (left) are in their low detail version, flowers are not there, and they are baked at half or less resolution. Similar for the Beach (no shells, no grass, no little stones, no small palms, no canes):


    When you go past the hill and cross the bridge to the Farms, what you see is this. The hi-res stones are only the ones facing the farms, while all of the others are in their blockout low-res version. The beach prefabs are completely gone


    This system allows to keep the baking times low, as only what's close is baked at full resolution, while all of the far away objects are forced to bake at lower res, sometimes 0.5, but sometimes as low as 0.1.
    This is done using the parameter Scale in Lightmap on each object's MeshRenderer, and is saved in the scene as an override (so never Apply on scene prefabs, unless it's a _CL one):


    Landmasses and ProBuilder meshes

    When working with ProBuilder-made meshes (mostly landmasses, but also the waterfall, the foam, and some walkable areas made of dirt) you should always go inside the Prefab to modify them. Never modify them outside the prefab and then Apply. Due to how ProBuilder handles the resulting mesh, there might be a mismatch and we'd have to go around all scenes and Revert all landmasses to get in the original mesh. Long story :D


    Summing up and next steps

    This is all for now, have fun exploring the scenes! Not all of them are fully done: for instance Mountain is still a draft, and many _CL prefabs haven't been created yet. For now it would be great to first have some feedback on the general layout (you can use this thread), then we can open a few tasks of decoration once the layout are fully set in stone.
    Eyap, Amel-Unity, JoNax97 and 2 others like this.
  4. cirocontinisio


    Jun 20, 2016
  5. aby_gamemaker


    Nov 5, 2020
    How about all these islands used to be a single sprawling kingdom but now only ruins of some sections remain this far out.
    On this island we could find fallen stone columns and totems. Insignia marked on some cave walls. As of yet unusable secret pathways that were emergency escape routes for the royal family.
    We could make it so that the king(or his descendants)and his trusted few are still fighting their enemies on a far away central island which is home to a giant volcano where all Phoenix are born. Tiki's mom is a full grown phoenix who serves the head wizard to the king. She somehow managed to get her chicks out of the island when things heated up there.

    If you like this idea then we could scatter some objects pointing towards that kingdom on this island.