Skip to content

Treat the void ray as armed despite missing weapon data - #247

Open
JustinAWei wants to merge 1 commit into
BurnySc2:developfrom
JustinAWei:voidray-no-weapon-data
Open

JustinAWei wants to merge 1 commit into
BurnySc2:developfrom
JustinAWei:voidray-no-weapon-data

Conversation

@JustinAWei

Copy link
Copy Markdown

The game data lists no weapon for the void ray (data/data.json: "name": "VoidRay", "weapons": []), the same gap the battlecruiser and oracle already have special cases for. So for a void ray:

  • can_attack, can_attack_ground and can_attack_air were False
  • ground_range and air_range were 0

Bots that pick threats with these properties treated void rays as harmless. Our bot's army-composition counter skipped them entirely, so it kept building ground-only units against 20 void rays.

Change

Adds UNIT_VOIDRAY next to UNIT_BATTLECRUISER and UNIT_ORACLE in sc2/constants.py, and to the same special cases in sc2/unit.py:

  • can_attack and can_attack_ground: with the battlecruiser and oracle
  • can_attack_air, ground_range and air_range (6): with the battlecruiser

ground_dps and air_dps stay 0, matching how the battlecruiser is handled today.

Tests

test_units_without_weapon_data in test/test_pickled_data.py builds a void ray from the pickled game state and checks the properties above. It fails without this change. test_pickled_data.py passes: 19 tests, including the new one. ruff check and ruff format --check are clean.

🤖 Generated with Claude Code

The game data lists no weapon for the void ray (data/data.json: VoidRay
"weapons": []), so can_attack, can_attack_ground and can_attack_air were
all False and both ranges 0, as already handled for the battlecruiser and
oracle. Bots filtering enemies by can_attack_* treated void rays as
harmless.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@JustinAWei
JustinAWei marked this pull request as ready for review October 2, 2026 16:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant