Player View & Perception
Unlike many other strategy games, Seawars provides Global Vision. You have access to the entire game state through the PlayerView object, with one specific exception (Algae Poison Status).
The PlayerView Object
Your bot logic receives a PlayerView object each tick. This object serves as the single source of truth for the game state.
Accessing PlayerView
Indirect Access Preferred
In most cases, you do not need to interact with the PlayerView object directly. The helper functions provided in GameAPI, BotContext, and Utilities cover almost all common use cases (finding nearest entities, pathfinding, checking global stats, etc.). Use the raw playerview only when you need custom filtering or data not exposed by the helper methods.
Global Fields
- tick: Current game tick (0 to 500).
- scraps: Your current global currency count.
- algae: Your current score (total permanent algae secured).
- bot_id_seed: The starting ID for your next spawned bot.
- bots: A list of all your own alive bots with full status details.
Visible Entities (Enemies & Scraps)
The visible_entities field contains dynamic objects on the board.
- Enemies (
visible_entities.enemies): A list of ALL enemy bots currently on the board. You know their ID, Location, Scraps held, and Abilities. - Scraps (
visible_entities.scraps): A list of scraps dropped on the ground from destroyed bots.
Filtering Enemies
Permanent Entities (Map Features)
The permanent_entities field contains static or semi-static map features.
- Banks: Locations of all banks.
- Energy Pads: Locations and status of energy pads.
- Walls: Locations of all wall tiles.
- Algae (
permanent_entities.algae): A list of ALL algae resource tiles on the board.
Structure Reference
The PlayerView object follows this structure:
The Poison Mechanic (Hidden Info)
While you know the location of every algae tile from the start, you do not inherently know if it is safe or poisonous.
Algae Properties
Each Algae object in permanent_entities.algae has an is_poison field with three possible values (defined in AlgaeType):
1. "UNKNOWN": The default state. You know algae is there, but not if it's safe.
2. "TRUE": Confirmed Poisonous.
3. "FALSE": Confirmed Safe.
Poison ability
The algae properties are updated when scouts go near the algae. It does not take into account when the opponent uses their poison ability.
Revealing Poison (Scouting)
To reveal the is_poison status, you must use the Scout ability.
- Ability:
SCOUT - Range: 2 tiles (Manhattan Distance).
- Effect: Any algae within 2 tiles of a bot with the
SCOUTability will have itsis_poisonfield updated to "TRUE" or "FALSE" in yourPlayerView.
Important
This is the only "Hidden Information" in the game. Enemy movement and map layout are fully visible.