Implement optimized collision detection system using NumPy

- Introduced a hybrid collision detection approach that utilizes NumPy for vectorized operations, improving performance for games with many entities (200+).
- Added a spatial grid for efficient lookups and AABB (Axis-Aligned Bounding Box) collision detection.
- Implemented a new `CollisionSystem` class with methods for registering units, checking collisions, and managing spatial data.
- Created performance tests to benchmark the new collision system against the old O(n²) method, demonstrating significant speed improvements.
- Updated existing code to integrate the new collision detection system and ensure compatibility with game logic.
This commit is contained in:
2025-10-24 19:13:30 +02:00
parent 47028c95ae
commit 12836dd2d2
17 changed files with 1591 additions and 64 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
"Player1": {
"name": "Player1",
"created_date": "2024-01-15T10:30:00",
"last_played": "2025-08-24T21:49:04.187787",
"last_played": "2025-10-24T19:07:22.052062",
"games_played": 25,
"total_score": 15420,
"best_score": 980,