No description
  • Python 61.1%
  • HTML 38.1%
  • Dockerfile 0.5%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-07 16:34:03 +02:00
assets Ingame picture 2025-12-25 00:04:39 +01:00
game Feedback 2026-09-07 09:18:48 +02:00
papers Revive, codes 2026-09-06 18:49:08 +02:00
swordmap_project Update swordmap_project/settings.py 2026-09-06 09:51:37 +02:00
utils + config tools 2026-04-16 00:30:32 +02:00
.dockerignore Docker 2025-12-31 02:10:16 +01:00
.gitignore Revive, codes 2026-09-06 18:49:08 +02:00
area.gpx Area update 2026-04-24 14:08:14 +02:00
docker-compose.yml Update docker-compose.yml 2026-09-06 09:34:12 +02:00
Dockerfile Docker 2025-12-31 02:10:16 +01:00
entrypoint.sh Fix db.sqlite problem 2025-12-31 03:39:49 +01:00
game_config.json Update game_config.json 2026-09-07 16:29:55 +02:00
LICENSE LICENSE 2025-12-24 19:52:55 +01:00
locations.gpx Púll 2026-04-24 13:46:31 +02:00
manage.py Init project 2025-12-24 19:50:54 +01:00
papers-out Revive, codes 2026-09-06 18:49:08 +02:00
README.md Update README to match updates 2026-05-11 15:28:09 +02:00
requirements.txt config'd 2026-09-05 20:26:01 +02:00
reset.sh reset script 2026-09-06 20:24:28 +02:00
RULES.md Update RULES.md 2026-09-07 16:34:03 +02:00

Swordmap Game

Swordmap (KSP bojovka) is an interactive, location-based territorial control game where teams compete to capture and hold zones on a real-world map.

Configuration

Edit game_config.json to define zones, bases, and their coordinates. Real-world coordinates (latitude, longitude) are now used instead of 2D coordinates:

{
  "teams": [
    {
      "name": "TeamName",
      "color": "#FFFFFF"
    }
  ],
  "zones": [
    {
      "id": 1,
      "name": "Zone Name",
      "latitude": 50.087,
      "longitude": 14.421,
      "is_base": true,
      "owner": "TeamName",
      "color": "#FFFFFF",
      "adjacent_zones": [2, 3]
    }
  ]
}
  • Teams are defined in the teams section of game_config.json. The owner field in the zones must match the name of a team defined there.
  • Running init_game_data will apply these configurations and reset all team scores to 0.

Setup (Docker)

The recommended way to run the application is via Docker Compose. Ensure your .env file is set up with PostgreSQL database credentials.

  1. Build and Run the Containers:

    docker-compose up -d --build
    
  2. Initialize Database Data:

    docker-compose exec web python manage.py migrate
    docker-compose exec web python manage.py init_game_data
    

Note: The game loop for processing real-time game state (score increments & captures) is handled automatically by the game_loop container defined in docker-compose.yml.

Usage

  • Navigate to http://localhost:8000/.
  • Join a Team (or connect as an Admin).
  • Check the Pravidla tab for complete game documentation and combat rules.
  • View real-time scores in the Statistiky tab.
  • Switch to the Hra tab, follow the OSM map using your live GPS location, and tap reachable nodes to capture them for your team!