Skip to content

Allow Hide Names in Rumble - #117

Open
Chase-san wants to merge 3 commits into
robo-code:mainfrom
Chase-san:rumble-hide-names
Open

Chase-san wants to merge 3 commits into
robo-code:mainfrom
Chase-san:rumble-hide-names

Conversation

@Chase-san

Copy link
Copy Markdown

This PR makes hidden names available to the rumble client and fixes a bug for names relating to certain ways robots compare names (RougeDC willow is one such robot massively negatively effected without this bug fix).

The engine, the battle dialog and .battle files can already hide enemy names
from robots, but the rumble client always ran battles with names shown, so a
competition could not use it.

With HIDENAMES=YES in a rumble's configuration, the client runs its battles with
hidden names and adds hidenames=YES to each upload, so a server can refuse
results from a client that did not. The default is NOT.
A hidden name was built again on every call, so each event carried a new String.
Real names are one object, and many robots compare them with == or !=.
Copilot AI balanced review requested due to automatic review settings November 1, 2026 02:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Queued results can be mislabeled after HIDENAMES changes because retries use the current configuration instead of the battle’s original setting, which must be persisted per result.

1 open issue
What changed in this PR

This PR adds optional hidden enemy names to the RoboRumble client and stabilizes anonymous name objects for robots that compare names by reference.

Changes:

  • Adds a HIDENAMES option to rumble configurations and passes it into battle setup.
  • Includes hidden-name mode in result uploads.
  • Caches anonymous names and adds a regression test for name hiding and reference identity.
File Description
robocode.tests/​src/​test/​java/​net/​sf/​robocode/​test/​robots/​TestHiddenNames.java Tests hidden names and stable object identity.
robocode.tests.robots/​src/​main/​java/​tested/​robots/​HiddenNames.java Adds a robot that reports names and reference changes.
robocode.roborumble/​src/​main/​java/​net/​sf/​robocode/​roborumble/​netengine/​ResultsUpload.java Adds hidden-name mode to upload data.
robocode.roborumble/​src/​main/​java/​net/​sf/​robocode/​roborumble/​battlesengine/​BattlesRunner.java Applies HIDENAMES when creating battles.
robocode.core/​src/​main/​java/​net/​sf/​robocode/​host/​RobotStatics.java Reuses a cached anonymous name object.
robocode.content/​src/​main/​resources/​roborumble/​twinduel.txt Documents HIDENAMES, disabled by default.
robocode.content/​src/​main/​resources/​roborumble/​teamrumble.txt Documents HIDENAMES, disabled by default.
robocode.content/​src/​main/​resources/​roborumble/​roborumble.txt Documents HIDENAMES, disabled by default.
robocode.content/​src/​main/​resources/​roborumble/​meleerumble.txt Documents HIDENAMES, disabled by default.

Review effort: Balanced

The upload read HIDENAMES from the configuration, but results can wait in the
results file until a later upload. If the setting changed in between, those
results were labelled with the new setting instead of the one they were played
with. BattlesRunner now saves the setting in each battle's header, and the
upload reads it from there. A header saved by an earlier client has no setting,
which counts as NOT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants