Skip to content

Fix the noise rate parameters written by PlayerTypeT - #122

Merged
hidehisaakiyama merged 2 commits into
developfrom
fix/player-type-json-noise-rate
Nov 23, 2026
Merged

hidehisaakiyama merged 2 commits into
developfrom
fix/player-type-json-noise-rate

Conversation

@hidehisaakiyama

Copy link
Copy Markdown
Member

Summary

rcsc::rcg::PlayerTypeT::toServerString() and toJSON() wrote the value of dist_noise_rate
for focus_dist_noise_rate, land_dist_noise_rate and land_focus_dist_noise_rate (v19).
The bug was introduced in #72.

Impact

The rcg files written by librcsc had the wrong values for these parameters of the player types:
the tools that rewrite rcg files (rcgrenameteam, rcgreverse, rcgverconv) and soccerwindow2 when it saves an rcg file.
With the default values of rcssserver, land_dist_noise_rate and land_focus_dist_noise_rate
became 0.0125 instead of 0.00125. The rcg files written by rcssserver are not affected.

Changes

  • rcsc/rcg/types.cpp: write the matching member for each parameter in both functions.
    The rounding of the values is not changed.
  • New unit test run_test_rcg_types (CppUnit, CMake and Autotools).
    Besides checking the four parameters, it sets a different value to every parameter printed
    by PlayerTypeT and checks that each one is written with its own value in both formats,
    so the same mistake is detected when a parameter is added.
  • Plan: docs/plan/2026-11-24-01_player-type-noise-rate.md. Release notes and docs/build.md are updated.

Tests

  • The new test fails without the fix (Expected: 0.0225, Actual: 0.0125) and passes with it.
  • CMake: all 16 tests pass (./cmake-helper.sh test).
  • Autotools: make check and make distcheck with --enable-unit-test pass.

rcg::PlayerTypeT::toServerString() と toJSON() が、focus_dist_noise_rate・
land_dist_noise_rate・land_focus_dist_noise_rate に dist_noise_rate の値を
出力していたのを修正した。librcsc で書き直した rcg (rcgrenameteam、
rcgreverse、rcgverconv、soccerwindow2 の保存) で値が誤っていた。

- 単体テスト run_test_rcg_types を追加 (CMake・Autotools)
- 計画書を追加し、リリースノートと docs/build.md を更新

Fix rcg::PlayerTypeT::toServerString() and toJSON(), which wrote the value of
dist_noise_rate for focus_dist_noise_rate, land_dist_noise_rate and
land_focus_dist_noise_rate. The rcg files written by librcsc (rcgrenameteam,
rcgreverse, rcgverconv and soccerwindow2) had the wrong values.

- Add the unit test run_test_rcg_types (CMake and Autotools).
- Add the plan, and update the release notes and docs/build.md.
計画書に PR #122 と CI の結果を記録し、ステータスを完了にした。

Record PR #122 and the CI results in the plan, and mark it as completed.
@hidehisaakiyama
hidehisaakiyama merged commit 212f5e7 into develop Nov 23, 2026
5 checks passed
@hidehisaakiyama
hidehisaakiyama deleted the fix/player-type-json-noise-rate branch November 23, 2026 16:46
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