Skip to content

Risks and Technical Debt

This section acknowledges known limitations and potential future challenges.

Technical Risks

  • Physics Tunneling: At very high speeds (e.g., high BotSpeed or fast bullets), objects might "tunnel" through thin walls because the collision check is discrete per frame.
    • Mitigation: Cap maximum speeds; use smaller DT if necessary; consider raycasting for bullets.
  • AI Performance: If many bots are added to a very large map, the BFS/Dijkstra pathfinding might impact the frame budget.
    • Mitigation: Cache pathfinding results; use a tiered "thinking" interval (implemented in Autopilot.timeSinceLastUpdate).
  • Browser Resource Limits: Playing many sounds or rendering complex effects (smoke particles) can lead to audio stuttering or frame drops in some browsers.
    • Mitigation: Object pooling for particles; limit concurrent sound channels.

Technical Debt

  • Legacy Type Casts: Some parts of the engine still use any or explicit casts after the JS -> TS migration.
    • Impact: Reduced type safety and harder refactoring.
    • Planned Action: Gradually refine types and interfaces to eliminate as any.
  • Inheritance Depth: The reliance on deep inheritance (GameObject -> Tank) can make behavior overrides complex.
    • Impact: High coupling between base classes and subclasses.
    • Planned Action: Consider moving towards more composition for specific capabilities in the future.
  • Grid Limitations: The AI pathfinding is strictly tied to the tile grid, making it difficult for bots to navigate around dynamic obstacles (like other tanks) within a tile.
    • Impact: Less "intelligent" bot movement in crowded areas.
    • Planned Action: Enhance the Autopilot logic with local steering behaviors (Boids/Avoidance).
  • Missing Multiplayer: The local-only architecture makes adding real-time online multiplayer a significant future refactoring effort.
    • Impact: Project is limited to local-play and bots.
    • Planned Action: Acknowledge as a current project scope limitation.