Bug Fix's 1.4.1


  1. Culling Mechanism:
    • Cull Distance: The game implements a cullDistance variable that determines how far away entities can be rendered. This limits the number of objects being drawn to the screen based on the player's distance, improving rendering performance.
    • Dynamic Adjustment: The cull distance can dynamically adjust based on frame rate. The game reduces the culling distance if the frame rate drops below 30 FPS and increases it if the FPS exceeds 50. This balancing helps maintain performance on varying hardware.
  2. Particle System Management:
    • Active Particle Systems Cleanup: The code includes a cleanup routine for particle systems that checks if they have reached their maximum lifetime (e.g., maxLifetime) and removes them from the scene. This helps in reducing the number of active objects in the scene, conserving processing power.
    • Velocity and Position Updates: Particle systems manage their velocities and positions efficiently, modifying only what's necessary during each frame, which can improve performance when many particles are present.
  3. Bullet Management:
    • Bullets are removed from the scene if they exceed a specific lifespan (5 seconds) or if they move beyond a designated distance from the player (determined by cullDistance). This reduction in the number of active bullets reduces the number of collision checks and rendering calls each frame.
  4. Zombie and Health Kit Updates:
    • The visibility of zombie health bars and health kits is managed based on their distances to the player. Health bars are only shown when zombies are near the player, saving rendering time for distant entities that are not currently relevant.
  5. Animation and Movement Handling:
    • Updating the player animation and obstacles (trees, health kits, etc.) occurs only for those in proximity to the player, minimizing unnecessary calculations and updates for distant objects.
  6. Batch Rendering Techniques:
    • Although not explicitly stated, using instanced rendering for similar objects (like multiple zombies or trees) can be inferred as a strategy that could be leveraged in further optimizations to reduce draw calls.
  7. Efficient Update Polling:
    • Stat updates, such as checking player health or XP, are managed less frequently (every statsUpdateInterval rather than every frame), which reduces the frequency of computations and DOM updates.
  8. Use of Buffers for Geometry:
    • By using BufferGeometry for particles and other configurable mesh shapes, the efficiency of geometry handling is improved, as it reduces memory overhead and processing time compared to standard geometries.

Leave a comment

Log in with itch.io to leave a comment.