Skip to content

Sketch: M41 and MilSO reload resume as data - #2287

Closed
sunzenshen wants to merge 13 commits into
NeotokyoRebuild:masterfrom
sunzenshen:sketch-zr68c-m41-milso
Closed

sunzenshen wants to merge 13 commits into
NeotokyoRebuild:masterfrom
sunzenshen:sketch-zr68c-m41-milso

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Sketch, not for review. This draft tests whether the ZR68C MVP's reload-resume code (#2285) extends to more weapons as data only. It adds the M41 and the MilSO pistol, each resuming after the unload step. Nothing has been run in game, and the M41 and MilSO sounds are placeholders.

The branch contains the MVP commits. The notes below describe only what it adds.

Result

No reload C++ changed. Only data and // NEO TODO comments:

  • weapon_m41.txt and weapon_milso.txt: the #base line for the phases file and an empty "ReloadPhases" block.
  • game_sounds_weapons.txt: the M41 sound pieces (4) and the MilSO load piece (1).

Two MVP choices made this data only: the table is looked up by the sequence that plays, and each row's resume key names its resume sequence.

How the pistol fits

  • reload (tactical) and reloadempty (dry) each have their own table and their own resume: resume_after_1_unload and resume_after_1_unload_empty.
  • The slide release is reloadempty's 3_cycle row.
  • The resume fills the clip at the load, so no empty idle follows; drawempty stays the fallback for a model without the resume.

Open items

Recorded as comments in the weapon scripts and the phases files:

  • M41: naming for a gun with one reload; fire point at the clip end or ReloadReadyBeforeEnd; whether to ship recompiled base models; share clips across the M41 family or not.
  • MilSO: a resume after the load on a dry pistol needs the full slice's keep-clip resume; a tactical resume zeroes the clip although the pistol holds a chambered round; holster vs holsterempty is picked at random during a dry resume.
  • All tests.

Toolchain

  • Linux GCC Distro Native (Linux Mint 22.3, GCC 13.3.0): the MVP code builds unchanged; this branch adds no C++ other than comments. Not run.

Linked Issues

A weapon script may list, per viewmodel reload sequence, the reload
phases it credits (drop, seat, bolt), when each counts and when each
sound piece plays. Weapons without the block parse no tables, which
keeps them on the existing reload.
Behind sv_neo_reload_experimental (default 0), a weapon whose script
has a ReloadPhases block credits the drop of its old magazine during
the reload. A switch after the drop keeps that phase, and the next
draw plays the weapon's draw-resume sequence, which seats the fresh
magazine and pulls the bolt. A switch before the drop cancels the
reload as before.

The reload itself, its sound and its ready-time load are unchanged.
Weapons without the block, and every weapon with the flag off, run
the existing code.
The ZR68C reload credits the magazine drop at 0.700 s. The
draw_resume_drop_dry sequence seats at 1.433 s and bolts at 2.367 s,
with the seat, slap and bolt sound pieces at their transients.
The drop credit no longer empties the clip: an uninterrupted reload
shows the clip as master's does, which bots read to tell an empty
weapon. The old magazine is lost only when the draw resumes the
reload. The seat sets the ready time, so FinishReload loads as on
master and the end-of-reload hook goes away.

A switch or a drop now stops the sound pieces, as the player stops
the single reload sound. A dropped weapon, also on death, cancels its
reload, so the next owner does not resume it. The resume no longer
sends drawempty in the same deploy.
Describe what sv_neo_reload_experimental does in its help text and bound
it to 0-1 like the other weapon cvars. Hoist the parser's name tables to
file scope, group FindReloadTable with the other methods, and word the
comments without reference to the base branch. No behavior change.
weapon_zr68c.txt includes its ReloadPhases rows with #base from
weapon_zr68c_reload_phases.txt, which neoAssets ships and times from
the Blender markers, so the sound and credit times follow the
animation. A missing file leaves the block empty; the parser then warns
and the weapon reloads without phases, as it does without the flag.
The configure copy of neoAssets is ignored by git.
Use the step names neoAssets now ships: phases 1_unload, 2_load and
3_cycle (RELOAD_PHASE_UNLOADED, LOADED, CYCLED), the resume sequence
resume_after_1_unload_empty, the row keys ammo, sound and sound2 (sound
names under sound_name, sound2_name), and sound entries named after
their step. No behavior change.
A resume sequence's ReloadPhases block may give a 4_ready time: the
reload is done and fire is allowed there, and the clip plays on to
its end unless a shot interrupts it. Without the key, fire waits for
the end of the sequence as before.
Drop the 4_ready time: the resume clip now ends where the hands are
at rest, so the reload finishes and fire is allowed when it ends.
Reload() now times the phases of the sequence the viewmodel plays,
not a fixed "reload", so a gun whose empty reload is reloadempty gets
that table. A row's "resume" key names the sequence that resumes a
reload interrupted after its step; Holster keeps the phase and the
table that names it, and a second switch before a resume's first step
plays that resume again. This replaces the hardcoded resume name.

Sound pieces stop from the playing table only.
Sketch, not a product. weapon_m41.txt includes the M41 phases from
neoAssets, and the three-step reload pieces get sound entries.
No C++ change is needed for the resume after the unload.
Sketch, not a product. weapon_milso.txt includes the pistol phases
from neoAssets, and the load step gets a sound entry. No C++ change
is needed for tactical and dry resumes after the unload.
@sunzenshen

Copy link
Copy Markdown
Contributor Author

This PR is not ready for review, it was mostly intended to sketch out what it would look like to integrate multiple weapons for partial reloads, so that the code in #2285 ideally mostly survives with the end goal in mind. The idea is know how much code needs to be added in order to add another weapon to the partial reload feature set.

I plan to rebase this branch as other PRs get merged, to get an idea of what is left to integrate as far as the code stubs go.

@sunzenshen sunzenshen closed this Nov 10, 2026
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