Skip to content

Partial reloads 07: Resume a reload after the magazine is attached - #2292

Closed
sunzenshen wants to merge 1 commit into
stack/reload-zr68c/30-mvpfrom
stack/reload-zr68c/40-attach
Closed

sunzenshen wants to merge 1 commit into
stack/reload-zr68c/30-mvpfrom
stack/reload-zr68c/40-attach

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Depends on NeotokyoRebuild/neoAssets#178 (layer 07: the drawtocycle_reload clip and its phases rows).

Partial reloads 07: resume a reload after the magazine is attached. This PR builds on #2293 (06: the resume after
the unload) and pairs with neoAssets layer 07. Next: #2294 (08, the bolt cycle: a chambered round, reload_skipcycle, bots).

With #2293, a ZR68C reload interrupted after the fresh magazine is seated (2_load) cancels: the next draw is a
plain draw with a full magazine and no bolt pull. With this PR the draw resumes the reload instead: it plays
drawtocycle_reload (the draw, a reach to the bolt, the bolt pull, 1.733 s), keeps the 30 rounds, and allows fire
at its end.

How it works

  • Resume after the load: Partial reloads 06: Resume a ZR68C reload after the magazine is unloaded #2293 already keeps the phase and table at a switch when the step's row names a resume,
    and the neoAssets layer 07 phases file now names drawtocycle_reload on the 2_load rows of reload and
    drawunloaded_reload. The one code change: ResumeReload empties the clip only for a resume after 1_unload;
    after 2_load the fresh magazine is already in.
  • After a full reload: reload gains its 3_cycle row in the phases file, so an uninterrupted reload ends at
    3_cycle and a later switch finds nothing to resume.
  • Third person: the reload gesture is about 2.7 s, the resume after the load 1.733 s. A resume's reload event now
    carries its first-person length; the gesture then plays only its end for that long and blends in over 0.2 s
    (hl2mp_playeranimstate, the RELOAD_EVENT_RESUMED marker of Partial reloads 06: Resume a ZR68C reload after the magazine is unloaded #2293 becomes this data). A resume as long as the
    gesture (drawunloaded_reload) still plays it whole. A reload event without data runs master's code.
    RELOAD_GESTURE_KEEP_START (a reload from the start that ends early) is used first by layer 08.
  • Drop: a dropped weapon still cancels its pending resume; the next owner gets 30 rounds and a normal draw.

How to review

  1. ResumeReload in weapon_neobasecombatweapon.cpp: the clip line and the gesture call.
  2. hl2mp_playeranimstate.{h,cpp}: PackReloadGestureData, StartReloadGesture, UpdateReloadGesture. Each
    returns first for an event without data.
  3. The neoAssets layer 07 phases file (four new or changed rows).
  4. Test in game: "How to test".

How to test

  1. Load a map (the flag is 1 by default during review). Take the ZR68C.
  2. Empty or partly fire the magazine, press reload, and switch to the secondary after the new magazine is seated
    (about 1.4-2.2 s in). Switch back: the draw should reach for the bolt, pull it, and end with 30 rounds.
  3. Repeat with a switch after the unload (about 0.7-1.3 s in): the Partial reloads 06: Resume a ZR68C reload after the magazine is unloaded #2293 resume should play as before.
  4. Repeat with sv_neo_reload_experimental 0 (set before the map loads): a switch cancels the reload as on master.

Results

Linux Debug client and dedicated server, 0 compiler warnings, neoAssets layer 07 assets. Client runs used a listen
server with one bot replaying the owner's inputs (bot_mimic), seen as a remote player.

check result
New: dry reload, switch at +1.65 s (after the load at +1.335 s), back drawtocycle_reload at +2.175 s, clip stays 30 (HUD: 30 rounds, 2 magazines, no dip), idle at +3.915 s (1.740 s); bolt pull visible in the frames; reload_cycle plays once per source, no other reload sound on the resume
New, third person bot gesture cut at cycle 0.575 at the switch; on the resume it starts at 0.350 and ends at 0.988 after 1.666 s (first-person 1.733 s); without the fit it replayed whole for 2.7 s
New case, flag 0 plain draw, clip 0, then a fresh reload 0 to 30: master behavior
03 tactical reload, flag 1 clip 20 to 30 at +1.335 s, end +2.715 s, no resume, gesture whole
03 resume after the unload drawunloaded_reload, clip 0 to 30 at draw +1.41 s, end draw +2.775 s; load, tap and cycle pieces once each; gesture whole (2.67 s)
03 switch before the unload plain draw, clip 10 kept
03 flag 0 plain draw, clip 0, fresh reload: master behavior
03 fire held through the resume draw no shot before the resume ends; first shot at the next-attack time
Headless TDM, 12 bots, 1 round, flag 1 PASS, match_end=True, 0 asserts

The only client assert is the engine baseline shadow-leaf assert, outside the reloads.

Known limits

  • A switch after the load and before the bolt pull loses no rounds, as before; the resume only adds the bolt pull.
  • A drop after the load cancels the pending bolt pull (layer 08 keeps it for the next owner, with the chamber).

Toolchain

  • Linux GCC Distro Native (Linux Mint 22.3, GCC 13.3.0)

Linked Issues

A switch after 2_load now resumes when the phase table names a resume
for that step (drawtocycle_reload on the ZR68C, the bolt pull). The
fresh magazine is already in at that point, so the resume keeps the
clip; only a resume after 1_unload empties it.

The resume after the load is about a second shorter than the reload
gesture, so others saw the magazine change go on after the gun was
ready. A resumed reload now plays only the end of the gesture, for as
long as its first-person sequence, blended in. A reload event without
data still plays the whole gesture, so flag-off play is unchanged.
@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/30-mvp branch from 86d98ed to 17e65e5 Compare November 10, 2026 02:10
@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/40-attach branch from 5db897e to 7f065b7 Compare November 10, 2026 02:10
@sunzenshen sunzenshen changed the title Partial reloads 04: Resume a reload after the magazine is attached Partial reloads 07: Resume a reload after the magazine is attached Nov 10, 2026
@sunzenshen
sunzenshen marked this pull request as ready for review November 10, 2026 04:47

@sunmachine sunmachine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@sunzenshen

Copy link
Copy Markdown
Contributor Author

Closing to clear the board in favor of
sunzenshen#35

@sunzenshen sunzenshen closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Animations Animation stuff. Including the syncronizing of animations between client and server based on state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants