A test hook for src/app/main.cpp, which the headless tools bypass. With
OPENBMH_ROBOT=<script> and OPENBMH_ROBOT_LOG=<file> (usually with the SDL
dummy video and audio drivers) the game reads clicks and keys from the script
instead of the mouse, waits after each command until the picture has settled
and writes its fingerprint; OPENBMH_ROBOT_SHOTS=<dir> also saves the pictures.
The events go through SDL's queue, so they take the path of real input.
Hooks: app::present() replaces the 31 SDL_RenderPresent calls of main.cpp,
QuitConfirmation::poll() lets the robot queue its next command when no input
is waiting, and a robot run answers the quit question itself. Without the
environment variables nothing changes.
Verified: a script of 234 commands (title, new career, season start
presentations, every desk icon, two matchdays with the live match) gives the
same file in three runs; 211 of 211 tests; careers and UI walk identical.
Co-Authored-By: Claude <noreply@anthropic.com>
serve_flow_request was one function of about 2,000 lines with 53 branches.
Its body now lives in FlowRequestServer: the arguments as reference members
under their parameter names and one member function per kind of request
(open_league_table, handle_bank_action, play_matchday, handle_savegame_file,
open_manager_join, ...). serve() asks the handlers in the original order and
keeps the guards between them. The code of every branch moved verbatim; six
lambdas that captured a parameter by name now use an init-capture of the same
object.
This is also the first step towards replacing screens one by one: a request
kind has a name and one place.
Verified: 211 of 211 tests; 9 headless careers and the UI walk (German and
English, about 5,460 steps each) identical.
Co-Authored-By: Claude <noreply@anthropic.com>
- json_quote, original_to_utf8 and utf8_to_original lived in ui/manager, the
manager dialog, although every screen, the console client and the app use
them. They move byte for byte to formats/text_encoding (namespace bmh);
ui/manager.hpp keeps them visible as bmh::ui::... .
- The app sources (career session, window/desktop actions, controller) are
object libraries on MSVC too, compiled with /utf-8 like the game. Before,
the MSVC build compiled the 9,000 line career_session.cpp again for each of
about forty tests and tools.
Verified: 211 of 211 tests; 9 headless careers identical; the UI walk
differs only on the stadium screen, as expected from the 96,000 place
limits merged from main (reference re-recorded).
Co-Authored-By: Claude <noreply@anthropic.com>
other_games_ui_tests and ui_preparation_tests still expected "Nobody"; the
manager dialog offers "OpenBMH", so the attachment check rejected the fixture.
Co-Authored-By: Claude <noreply@anthropic.com>
The extension to 144,000 places of 1.0.3 is withdrawn: the match broadcast of
the original has no room for attendances of 100,000 and more and showed them
wrongly. Limits, unit prices and construction weeks now come from the edition
unchanged (3.7: 8/18/8/14 thousand per block, 30/37/30/25 weeks). A savegame
with a larger stadium keeps its places but cannot extend such a block further.
Co-Authored-By: Claude <noreply@anthropic.com>
67 file-local helpers (fill/rect/copy/copy_region/... in 39 screens) now call
draw::fill, draw::copy_clipped or draw::copy_unclipped. Only the loops moved:
every screen keeps its own wrapper with its bounds check and error text, so
the contracts are unchanged. Eight helpers with special behaviour stay as
they are (bank, season promotion, toto, tax animation, ...).
Verified: 9 headless careers and the scripted UI walk (German and English
data, 38 screens, about 5,460 steps each) give the same fingerprints as
before. ctest: 209 of 211; other_games_ui_tests and ui_preparation_tests
fail the same way without this change.
Co-Authored-By: Claude <noreply@anthropic.com>
- game/digest: fingerprint of the whole game state (saved stream, unsaved
run-time values, both random generators)
- season_sim: SIM_DIGEST=<file> writes one digest per desk; SIM_LEAGUE picks
the start league
- tools/ci/compare_digests.py compares two directories of digest files
- ui_walk (tool): replays an input script against the UI flow and the
production controller without a window, one picture/state fingerprint per step
- openbmh_ui --frames: the same fingerprints for its scripted mode
No change of game behaviour. Reference files live outside the repository.
Co-Authored-By: Claude <noreply@anthropic.com>
The six side strengths of an indoor round depend on the chance weather kept
from the last chance of the round before (a runtime value the savegame does
not hold). With WEEK_PREV_WEATHER the kick-off of all eleven recorded rounds
equals the real 3.7. week_check gets that switch plus development helpers for
weather, line-up and formation table; the measurement document is updated.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The name column was clipped at 78 pixels (about 17 characters). The real 3.7
shows 19 character names completely and the games column covers the overlap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The footer replaced the club name by feedback texts; the original has no
such line. The text stays in state_json(), it is just not drawn.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Compared pixel for pixel with the recording of the real game: the pressed
picture in the bottom rows of KB/20.VGA is 36x36 (minus x 0, plus x 36), not
38x38 at x 0/38, and it is drawn two pixels right/down of the raised button
over the clean background. Raised and pressed now match the recording except
for the mouse cursor.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The buttons of the game setup (and of the joining manager's setup) use the darker
picture from the bottom of the setup atlas while the mouse button is held, as in a
recording of the real game; the release redraws even when the value is at its limit.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The calculator panel and its keys (bank, offer editor, advertising, contracts, stadium,
balance plan, alternate game end) and the window frame (ten dialogs) are drawn by
ui/calculator_widgets.hpp and ui/dialog_frame.hpp; a test compares them with the former
drawings. The calculator keys of bank, offer editor, advertising and contracts now show
the pressed look while the mouse button is held.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Transfer market, pitch, lineup, bank, offer editor, advertising, manager, player card,
player detail, club info, league pairings, other games, top scorers, stadium,
training, game end and the contract tabs drew the same button frame with their own
copies. They now call draw_wide_button_frame (ui/button_frame.hpp), which a test
compares pixel for pixel with the former drawing. Buttons whose drawing differs by a
pixel (statistics rankings, team statistics, opportunities, analytics) are left alone.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Advertising offers and notices, the player card, the training camp booking and
notice, the file dialog (page button, overwrite question) and the bank notices
and credit fee question now draw the pressed look from the mouse press until
the release. Manager notices share source_dialog_button_at for their OK/Ja/Nein.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The back, send and switch buttons below the contract offer and team premium
panels and JA/NEIN of the manager confirmation are drawn pressed while the
mouse button is held, using the shared frame of ui/button_frame.hpp.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bank (stocks, property, savings, credit), the offer editor footer, the lineup
bottom buttons and the pitch page buttons Daten and Kurz are drawn in the
pressed look from the mouse press until the release, like the friendly match
question. The frame drawing is shared in ui/button_frame.hpp.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Assets with openbmh.dat are a complete game; without that file the launcher asks
for BMH.EXE (FLTD.EXE) as before. With both present the executable is used.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The numbers of the Diamond 3.7 executable and of Football Limited stay built in,
the game texts go into data/openbmh.dat, which the release ships next to the
programs (found in OPENBMH_DAT, the game folder, the program folder, the current
folder). Without the file those texts are empty. A replay of a recorded session
gives the same output as with the real BMH.exe when the file is there, and differs
only in the seven text lines when it is missing. week_check no longer counts its
probe re-rating of the team as draws of the port (the apparent deviation from
minute 10 of the DOSBox recording was this measuring error).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The game no longer needs BMH.EXE or FLTD.EXE. The numbers and the game texts of
the Diamond 3.7 executable and of the English Football Limited are generated into
formats/diamond_constants.inc and formats/fltd_constants.inc (tools/diamond_constants).
A missing BMH.exe loads the embedded German image, an English installation without
FLTD.EXE gets the embedded English image; an executable that is present is used as
before. The default manager name is OpenBMH. The launcher accepts directories and
archives that hold only the asset files. Replays of a recorded session give identical
output with and without BMH.EXE, and the English image equals the translated one.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
VERKAUFEN on a player who stands on the transfer list only showed a message
when no offer had arrived yet. The original first asks whether the player
should be taken off the transfer market: yes frees the list slot (the player
stays in the squad), no continues to the offers. Controller and UI tests cover
both answers.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The source package verifies the pinned archive hashes, so the vendored files
must not be line-ending converted, and ChangeLog.md/readme.md are included.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The release asset download returned HTTP 504 for hours and blocked the Windows
build. miniz (MIT) is two source files, so it now lives in third_party/miniz and
the public-tree check skips that unmodified third-party directory.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- The notice dialog refused Source notices it did not know, which silently refused the whole action: the agreement of a
poached player ("Ihr erstes Angebot wird angenommen!") made the Angebot button of the Abwerben dialog fail, and the new
search boxes never appeared. Both text families are known now; the test turns every notice of the transfer routes into
its dialog like the graphical client does.
- Suchen/Vorschlag/Abwerben and the other market buttons are drawn pressed while the mouse button is held.
- Confirming the search dialog first reports "Ihre Scouting-Abteilung ..." (text 0xAF25C) as in the original, then the matches.
- A refused transfer or offer action shows its reason, writes it to stderr and the debug log.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TransferMarketScreen gets the dialog of the original (KB/69.VGA panel at 184,20, seven bar rows from the
EXE table, click rules of sub_19409, confirm button, price estimate). Suchen opens it with the stored
profile, Vorschlag with the suggestion the squad asks for (computed in the projection). Closing posts a
store_search_profile request; the controller stores it and announces the matching listings through the
notice presenter, like the original's message boxes. Right button or Esc leaves with the search switched
off. Controller test drives the whole route.
The market list showed the asking fee scaled by 0x30d4 (older Diamond); 3.7 rounds to 10000
(sub_3C940), now also in the projection. Four tests computed the old base and follow.
Fixes#79
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two controller tests: an own listing with a bid is reviewed from the roster, the offers reach the
presenter and accepting sells the player; a listing that expires with a declined offer leaves the
list and the player can be listed again from the roster. Both pass; the reported "cannot review
offers / cannot list again" could not be reproduced on this route. app_controller_tests gets a
--market-only switch.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CareerSession gets search_profile, suggest_search_profile and dispatch_search_profile (owner and
modal-state checks, revision only when the stored profile changed). The console replaces the
OpenSearch placeholder with three commands and documents them; with apply the matching listings
are reported with the original's "Spieler ... ist interessant!" message. search_profile_valid
separates a refused profile from a switched-off one.
Part of #79 (the dialog in the graphical client is still open)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New game/search_profile.* holds the 18-byte search profile of a human manager (manager record
+0x1f6): the dialog's closing rule, the suggestion generated from the squad (original sub_18F06),
the position strengths (sub_19A38) and the listing match (sub_190B5). search_profile_news in
month.cpp now uses the same matching rule. Compared with the Diamond 3.7 routines in the
emulator harness on 10 savegames (306 runs, 406 matched listings, no difference; a deliberately
changed profile is detected).
Part of #79 (the dialog in the graphical client and the console commands follow)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The engine asks the selling manager and the buyer a yes/no question when a poaching offer
is decided (hooks.confirm). The graphical client only supplied the notice presenter, so the
engine refused the offer, the controller swallowed the reason and the ANGEBOT button appeared
to do nothing. The client now shows the question with the existing yes/no dialog.
Fixes#80
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Strength of the new player is the youth-team strength setting, the academy is
skipped when the squad's youth average is more than 25 above it, up to two rounds
need W(0, 3) == 0, and the retirement/retire rules use the 3.7 slot range. The
age test was inverted: only a player older than the roll W(t, t + 3) is recycled
(found by comparing with the 3.7 programme in an emulator, 192 runs on whole
savegames, no difference). Removes the old strength-band deviation entries.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kFacilityValue (entries 1, 2, 5), the per-visitor facility income table and the
season-ticket price of the first division. Checked against the 3.7 programme in
an emulator on whole savegames: weekly statistics now match without difference.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Credit limit 8 million, fee base 10000 per 10000 of value, DFB fee 150 %,
championship bonus 700000, club-popularity premiums 400000/850000/1000000/850000,
periphery prices, advertising base 0x87, start capital step 3 million, the
broke limit -4 million, the training-injury chance, retirement after an injury
of more than 20 matchdays (1 in 40), the contract-talk limit and the side
rhythm (human: no balance term, computers: at least 48). Values read from the
3.7 programme; the earlier build the engine was derived from used other numbers.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Injury chance 1 in 31 (was 1 in 39), no-booking roll W(0,3), straight red 1 in 34
(was 1 in 28), the injury type thresholds (match injuries now types 3-30), the
duration table, 1/4 longer for a player injured before (was 1/8) and the club
doctor's cut (/8, capped only for the heavy types 20-30). Values read from the
3.7 programme, measured against the earlier build the engine was derived from.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Function and section comments for ui/stadium, ui/preparation_flow, the
transfer market, contract, outgoing and incoming transfer screens, and for
app/main, app/window_actions and app/desktop_actions. Comment lines only;
full build and runnable tests unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Function and group comments for ui/flow, app/controller and app/career_session:
the request/acknowledge model, the revision and identity checks, staged copies
that are committed on success, and the national-coach desk identity. Comment
lines only; full build and runnable tests unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>