-
Notifications
You must be signed in to change notification settings - Fork 0
Lag Prevention
If there are objects that contain complex shapes, it is best to not use that shape to create the colliders as the mesh collider used would have many vertexes, this should especially be managed if that object can be cloned a lot such as the bottles in this project.
You can often combine colliders if you want a more complex shape for example if you want a cylinder collider you can use a capsule collider for most of it and then a box collider to give the flat bottoms.
Some meshes are super complex and create multiple vertices/triangles that will eventually lag the game when the object is spawned frequently. If possible, the mesh should be reduced in its quality in order to prevent lag.
Free Unity Mesh Optimizer : https://assetstore.unity.com/packages/tools/modeling/mesh-optimizer-154517 The unity add-on gives the user a script to run for optimizing meshes. This script is called "Optimize Mesh". Add the script to the item being optimized and choose the quality of the item.
0 means less quality. 1 means more quality. Preferably the mesh quality should be as low as possible without affecting the general shape and view of the object. Once the user clicks the button from the script component to optimize, they must save the mesh using Save Mesh button.
Some objects might contain multiple meshes that can take the engine a longer time to generate them due to the amount of batches for each individual mesh. In order to reduce the batch load, which will also help with fps, we will combine meshes. However this step is rather tricky due to it combining the children, meaning you will no longer have access to manipulate the children after the combine.
Free Unity Mesh Combiner : https://assetstore.unity.com/packages/tools/modeling/mesh-combiner-157192 The unity add-on gives the user a script to run for combining meshes. This script is called "Mesh Combiner". Add the script to the item being combined and choose the settings for combination.
Before combining the meshes, it is recommended to make a copy to test the combination. This is because once combined, you cannot go back to its separate form as Ctrl + z will not revert any changes.
It is recommended tick the "Create multi-material mesh" option as it will allow you to change individual material in the object later on. It is up to the user to decide to tick "deactivate combined children" or "destroy combined children". Deactivating will save the children that were combined and allow future modifications. Deletion saves more space but will make it unmodifiable in the future.
Make sure to choose where to save the combined meshes.
- Current Branch Descriptions
- Version 1 Game Flow Overview
- Version 2 Game Flow Overview
- Localization and Start Screen Canvas Organization
- Overview of Scripts and Connections
- Machine Scripts
- Order Releases
- Demand
- Stage Controller
- Data Collection
- Video Recording
- Money Tracking
- Quest Systems for Levels and Tutorials
- Object Pooling
- Time Controller
- Forklift Scripts
- OpenAI Assistant Integration
- Ray Casting
- Camera Script
- General Purpose Object Collision