KAZIK/docs/native-buckshot.md
Artvasil09 3ad5bf4c9d Develop assembly-only casino scenes and native games
Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
2026-10-08 22:39:19 +03:00

4.6 KiB

Native Buckshot Scene

Runtime rendering, input, AI, animation and settlement are MASM32. No Python, C or C++ is required when playing. This change is limited to the existing Buckshot table; it does not replace the hall or other games.

First-person Scene

The generated room, seated dealer, pump-action shotgun and hands are separate layers in the existing 640x480 framebuffer. Cartridge loading repeats for the actual magazine count, followed by a pump cycle. Shooting forward has aim, trigger, recoil, smoke, pump and return poses. The self-directed shot pitches the view toward the table and raises the muzzle from below into the viewpoint. The magazine cap stays closed; it is not a second barrel. The self-shot has an eight-frame head-on blast/smoke atlas. Its ignition anchor is aligned with the bore, and the flame expands toward the camera, not as a sideways jet. Blank cartridges have no flame or blood effect.

Fatal dealer hits animate a stylized head burst and slump. Fatal player hits use first-person blood, darkness and no third-person player body. A large medical robot then enters, moves its arms/scanner/paddles, and restores the victim. Blood and recovery now use the full 640x480 game frame, without the inventory/status panels covering them. The medical atlas has 32 poses, sixteen for each viewpoint, played once in chronological order. Both characters are alive on the result screen. Recovery is visual: it does not reverse the result or trigger another payment.

Controls And Rules

  • Up/Down or the +/- controls adjust the stake from $50 to $5000.
  • Space or Play starts a paid round. Again starts the next round in one press.
  • 1 shoots the player; 2 shoots the dealer. Target buttons also accept the mouse.
  • 3 magnifies the next cartridge, without revealing it to the other actor.
  • 4 uses the saw: the next live hit deals two health units instead of one.
  • 5 drinks beer and ejects the next cartridge without a shot.
  • 6 uses cuffs to skip the opponent's next turn.
  • Escape pauses a paid round, including death/recovery. Escape from ready or result returns to the hall. F11 retains the existing fullscreen toggle.

Each actor starts with one of each item and four health units. A blank shot at oneself keeps the turn; other shots pass it. An empty magazine is reloaded with 4-8 cartridges, always including both live and blank rounds. The dealer uses items and makes decisions from revealed information or remaining counts, never from the hidden cartridge order.

The stake is deducted and saved at round start. A dealer death returns three times the stake; a player death loses it. Settlement is saved before the medical animation. Cartridge use, damage, item effects and payout are guarded against repeated animation updates.

Assets And Verification

Selected built-in image_gen outputs and complete prompts are in assets/sprites/buckshot/. The offline packer tools/generators/pack_buckshot_assets.py normalizes common scales/anchors, preserves transparent cutouts and writes twelve ANM1 BGRA packs into assets/animations/buckshot/. There are 148 distinct sprite/VFX poses plus the room. Missing/invalid packs show an error instead of a primitive substitute.

tools/tests/test_casino_actions.ps1 runs the actual MASM input/state machine: trigger timing, blank self-shots, dealer self-death, item effects, cuffs, bank conservation, one-time payout, death/recovery, 100 reloads, 250 complete rounds and 30 native framebuffer snapshots. Each player item also goes through input and drawing before/after its effect, with both possible inspection results. The inspection text pointer is preserved across panel drawing; previously EAX was clobbered and dereferenced as a string, causing a crash. The dealer shot no longer draws both its held weapon and a tabletop weapon during the first 140 ms. Saving and sound playback are disabled in this test build. tools/tests/check_buckshot_frames.py checks packs and snapshots, and makes a contact sheet/keyframe preview in build/actions/.

The same test object also links build/actions/buckshot-preview.exe: an interactive fullscreen QA scene with a temporary $10000 bank, no profile reads/writes and no launcher. This is not the shipping game.

The preview resolves its asset root with the same InitPaths3D routine as the shipping entry point. tools/tests/test_buckshot_paths.ps1 links a tiny alternate entry point against the actual game object, then verifies loading all twelve packs from the project root and an unrelated TEMP working directory, without opening a window. This covers direct launches from build/actions as well as the normal root/bin launchers.