Atavism (Unity) best Practices

- Plan Ahead: Map out the architecture of your game in advance. This involves considering things like game mechanics, levels, assets, scripts, physics, audio, lighting, etc. This is a critical stage where you can foresee potential issues and prepare for them.
- Use Version Control: Unity projects often involve multiple people and it’s important to keep track of changes. Git, SVN, Perforce, and Unity Collaborate are popular choices. Remember to include a good .gitignore file for Unity projects if using Git.
- Scene Organization: Unity projects can get complex quickly, so it’s important to keep your scenes clean and organized. Name things properly, use folders and subfolders to manage assets, scripts, and prefabs. Consider each scene as a separate unit and try to keep things modular.
- Prefab Usage: Use prefabs for game objects that will be reused. Prefabs allow you to set up a complex object once and reuse it throughout your scenes. They also allow changes to be propagated to all instances of the object.
- Script Organization: Use namespaces to categorize scripts and avoid naming conflicts. Also, consider using SOLID principles to design your scripts. Keep scripts single-purpose and simple for better readability, debugging, and reusability.
- Optimization: Be mindful of performance from the start, especially if targeting mobile or VR. This includes optimizing graphics, physics, scripts, and minimizing memory usage. Profiling regularly is a good practice.
- Testing: Implement a robust testing strategy. Unit testing for individual scripts, integration testing for how they interact, and playtesting for overall game experience. Unity’s Test Runner can be utilized for automated tests.
- Consistent Coding Style: If working in a team, establish a consistent coding style. This includes things like naming conventions, commenting, formatting, etc. It helps in maintaining the codebase in the long run.
- Continuous Learning: Unity’s capabilities are continuously evolving. Keeping up with Unity’s latest features and updates can help you solve problems more efficiently and create more impressive games.
- Documentation: Keep documentation for your code and project up to date. This will help others understand your code better and will also assist in future updates and debugging.
- Asset Store: Take advantage of the Unity Asset Store. There are many high-quality assets, scripts, shaders, etc., which can save you a lot of time. However, be careful not to overly rely on them, as they may not always fit your needs perfectly.
- Backup Regularly: Even with version control, it’s essential to regularly backup your project to an external source.
When creating a project, always start with creating a new folder for your company or project name as the first thing you do. Any item that you customize should be made into a prefab and saved into this folder structure.
As assets and items are added to the project, this can be further expanded to the assets within this folder structure. This ensures clean asset management for projects.