Treat the void ray as armed despite missing weapon data - #247
Open
JustinAWei wants to merge 1 commit into
Open
JustinAWei wants to merge 1 commit into
JustinAWei wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
October 2, 2026 16:40
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_groundandcan_attack_airwereFalseground_rangeandair_rangewere0Bots 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_VOIDRAYnext toUNIT_BATTLECRUISERandUNIT_ORACLEinsc2/constants.py, and to the same special cases insc2/unit.py:can_attackandcan_attack_ground: with the battlecruiser and oraclecan_attack_air,ground_rangeandair_range(6): with the battlecruiserground_dpsandair_dpsstay0, matching how the battlecruiser is handled today.Tests
test_units_without_weapon_dataintest/test_pickled_data.pybuilds a void ray from the pickled game state and checks the properties above. It fails without this change.test_pickled_data.pypasses: 19 tests, including the new one.ruff checkandruff format --checkare clean.🤖 Generated with Claude Code