Skip to content

Commit

Permalink
Props placement go exemple
Browse files Browse the repository at this point in the history
  • Loading branch information
TomRuisseau committed Jul 17, 2024
1 parent f8101b8 commit 2523e45
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Doc/Steps/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Cuurently there are 2 main rules :
- **Beds** : They are more likely to be placed in nodes close to the walls, and is aligned with the wall.
- **Fridges and sofa** : They are more likely to be placed in nodes close to the walls, and oriented with their back against the wall.

They are implemented in the ```QuadTreeNode.cs``` script.

### "Spawner" props

Some props place other props around them when they are instantiated. This helps having a coherent placement, while still having a random aspect. The props instancianting other props are the following :
Expand All @@ -33,4 +35,15 @@ To create a new prop prefab, the game object needs some mandatory components :
- **Accurate colliders** : The colliders must be as close as possible to the mesh, to avoid overlapping with other props. They need to have ```SimObjPhysics``` as tag.
- **A box collider** : It will be used to check which nodes are containing the prop, it doesn't need to be accurate. However, it needs to be on the ```Ignore Raycast``` layer and to have the ```BoundingBox``` tag.
- **```props.cs``` script** : You need to attach this script to the prop, link the prop's perfab and the bounding box collider. You also need to set the prop's type from a list.
- **```PropsSpawner.cs``` script (optional)** : If the prop is a spawner, you need to attach this script to the prop. Then, link the list of prefabs to spawn,as well as the list of spawn points, and indicate the type of the prop.
- **```PropsSpawner.cs``` script (optional)** : If the prop is a spawner, you need to attach this script to the prop. Then, link the list of prefabs to spawn, as well as the list of spawn points' transforms, and indicate the type of the prop.

<div style="text-align: center;">
<img src="../../Img/Prefab_component.png" alt="Prefab components example" style="width:45%; margin:10px; vertical-align: top;">
<img src="../../Img/Prefab_tree.png" alt="Prefab tree example" style="width:30%; margin:10px; vertical-align: top;">
<br>
<em>Figure: Prefab components and tree example</em>
</div>

<br>

Once the prefab is created, it needs to be added in the props list of the ```RoomGenerationData.asset``` scriptable object, located in ```Assets/Data```.
Binary file added src/Img/Prefab_component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Img/Prefab_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2523e45

Please sign in to comment.