Yandere Simulator Performance Optimization Review

Nov 15, 2024

Yandere Simulator Code Review Notes

Introduction

  • The review was based on the May 15th build, with updates on June 1st, June 15th, and July 2nd.
  • Key issues: slow development and poor game performance.
  • Detailed investigation into game performance and architecture issues.
  • No bullying reminder.

Initial Performance Analysis

  • Benchmarks run via wine with Lutris installer; missing text noticed.
  • Game crashes when the window is unfocused.
  • FPS counter showed less than 60 FPS despite good PC specs.
  • CPU/GPU not maxed out, suggesting a potential bottleneck elsewhere, but could be a wine issue.

Profiling the Game

  • Utilized Unity's profiler for detailed analysis.
  • High rendering time, especially for drawing opaque geometry.
  • Excessive geometry in student models, sourced from volunteers lacking optimization knowledge.
  • Need for major optimization sweep on assets.

Optimization Techniques

  • Use of combined meshes to reduce draw calls.
  • Level of Detail (LOD) partially implemented; not effective for students.
  • Active use of occlusion culling to reduce rendering of non-visible objects.

Specific Rendering Issues

  • Heart rate monitor inefficient due to incorrect culling mask.
  • Physics calculations heavy due to unnecessary colliders.
  • Animation calculations significant, partially mitigated by stop animation script.

Scripting Efficiency

  • Scripts take 8-10ms per frame to run.
  • Specific functions like uirect.update and aiBase.update are resource-heavy.
  • High number of UI components active at once; need for optimization.

Architectural Issues

  • YandereScript and StudentManagerScript are complex but necessary.
  • StudentScript is overly complex and should be restructured.
  • Suggestions for separating student-specific and generic behavior.

Implementation Details

  • Save files are large and inefficiently structured.
  • Interaction system can be optimized for dynamic prompts.
  • School map rendering is inefficient, could use an image instead.

Common Code Criticisms

  • Use of if-else chains instead of switch cases; not a significant performance concern.
  • Misuse of array indexing and hard-coded values.
  • Excessive public booleans for state tracking; suggested use of enums.

Potential Improvements

  • Utilize Unity's job system for multi-threading.
  • Consider using DOTS for better performance (major refactoring required).

Conclusion

  • Yandere Simulator exemplifies technical debt issues.
  • Game architecture needed refactoring much earlier.
  • Encouragement and acknowledgment of community support.

Final Thoughts

  • Importance of proper code organization and refactoring.
  • Need for unit tests in game development to catch bugs early.
  • Gratitude for viewer support and engagement.