Commit Graph

2 Commits

Author SHA1 Message Date
ydy0615 fc9f98aa3d feat(backend): integrate dual AI strategies with conditional switching and A* pathfinding
- Add imports for server0 and server1 modules
- Modify start_game, plan_next_actions, and game_over to invoke both strategies
- Implement dynamic strategy selection based on player prison counts
- Add A* pathfinding with danger weights for attacking players, including safe/dangerous position calculations and opponent avoidance
- Update traditional pathfinding for defenders and flag carriers in enemy territory
- Include binary updates to .DS_Store files (likely system artifacts)
2025-12-28 13:39:06 +08:00
ydy0615 2593d31346 feat(ctf): add backend policy module with pathfinding logic
Introduce a new `CTF/backend/mypolicy` Python module that implements a comprehensive game policy for the capture‑the‑flag bot. The file defines a global world model, thread‑safe state handling, and a `Map` class that builds a grid representation of the game map, generates traversable edges, and provides BFS‑based `guideance` and `length` methods for pathfinding and distance calculation. This policy enables the bot to make informed movement decisions based on safe zones, walls, allies, and enemies. Additionally, macOS `.DS_Store` placeholder files were added to the repository.
2025-12-27 20:54:40 +08:00