Skip to content

Partial reloads 24: Model the Supa-7 tube and chamber - #2309

Closed
sunzenshen wants to merge 1 commit into
stack/reload-zr68c/175-supa7-pumpfrom
stack/reload-zr68c/180-supa7
Closed

sunzenshen wants to merge 1 commit into
stack/reload-zr68c/175-supa7-pumpfrom
stack/reload-zr68c/180-supa7

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Partial reloads 24: the Supa-7 tube reload. This PR builds on layer 23 (#2312, the pump after the first shell).
It has no neoAssets pair: the Supa-7 plays its shipped clips and the reloadpump of layer 23
(NeotokyoRebuild/neoAssets#197).

With sv_neo_reload_experimental 1, the Supa-7 holds six rounds in a tube and one in the chamber, seven in all as on
master. The tube and the chamber are networked and predicted. The HUD shows the rounds through the chamber queries of
the phase code (#2293, made virtual in #2301).

  • Inserts: each shell enters the tube at the reloadinsert frame where the hatch closes behind it. A switch, a
    drop or a shot before that frame leaves the shell in the reserve; a switch after it keeps the shell.
  • Last shot: the shot that empties the tube leaves its hull in the chamber (layer 23's no-pump shot).
  • Rack in the reload: with no live round chambered and a round in the tube, the reload racks right after its
    first insert with layer 23's reloadpump; the round is fed when the pump is home, and a shot waits for it. The
    reload then fills the tube and ends with reloadendshort, so a dry reload ends at 7 (6 + 1). A slug loaded as
    that first round ends the reload with the shipped reloadend rack instead.
  • Rack on the trigger: a dry gun with rounds in the tube (a switch before the pump) plays the shipped reloadend
    rack on the trigger. A switch or a drop cancels a rack that has not fed its round.
  • Without reloadpump in the viewmodel, the last shot pumps as on master and a dry reload fills the tube, then
    racks with reloadend: it ends at 6 (5 + 1).
  • Slugs: a slug loaded on a live shell goes into the tube, so the shell fires first. A held alt-fire queues one
    slug at a time.
  • Kept from master: reload input, the shell cadence, early fire during a reload.
  • The flag: every change sits behind TubePhasesOn* hooks; each checks the flag itself. With the flag at 0 (the
    default since Partial reloads 22: Disable experimental reloads by default #2308) the Supa-7 behaves as on master.

How to review

  1. weapon_supa7.h: the chamber query overrides, the tube state (m_nTubeCount, m_nTubeSlugs, m_nChamber,
    m_nInsert and the two times) and the hook list.
  2. weapon_supa7.cpp: master's functions gain one-line hook calls; the hooks and the tube helpers follow.
    Layer 23's checks now read the tube: UsesPumpAfterInsert (flag and model), IsLastShotWithoutPump (tube
    empty), and TubePhasesOnNextInsert starts the pump; IsRackPending holds a shot until the feed.
  3. Test in game: "How to test".

How to test

  1. Set sv_neo_reload_experimental 1 and load a map. Take the Supa-7.
  2. Fire three and reload: shells go in one by one; fire during the reload: the gun fires at once.
  3. Fire it empty and reload: one shell goes in, the gun pumps it into the chamber, then the tube fills (7 in all).
  4. Reload and switch away after the first shell is in, then back: that shell stays; reload again to fill.
  5. Fire one, alt-fire a slug: the next shot fires the chambered shell, the one after it the slug.
  6. Repeat with sv_neo_reload_experimental 0 (set before the map loads): master behavior.

Results

Layer 24 build (this PR on layer 23 + neoAssets layer 23), Linux Debug, ntre_engage_ctg, owner Supa-7 plus a
bot_mimic bot of the same class (Assault) with the same gun. Times are from the reload press, from the owner's state
samples.

case flag 1 flag 0
dry from 0 (shells) last shot fire2 without the pump, hull stays; reloadstart, insert 1, reloadpump at +0.885 s chambers it (+1.455 s), the tube fills: 7 (6 + 1) at +4.71 s, reloadendshort, idle +5.22 s master: altfire with its pump; 7 at +3.95 s, reloadend rack, idle +4.97 s
slug on a live shell, fire, slug as the last shot, reload the slug goes in behind the shell; it fires as fire1 with no pump; the reload pumps after its first shell and refills -
empty gun, alt-fire (slug) master's one-slug load into the tube, then the shipped reloadend rack chambers it; reload then fills with shells to 7 -
switch away after insert 1 of a dry reload, back, trigger hull chambered, 1 in the tube: the trigger plays the shipped reloadend rack; reload then loads on -
the same, back, reload reloadstart, then reloadpump at once, then the inserts to 7 -
headless TDM, 12 bots (Assault), 1 round, flag 1 PASS, match_end=True, 0 asserts, 0 crashes (Supa-7 use by the bots not confirmed) -

The dry, switch and flag-0 cases give the same owner states as the same sequences with layer 25 on top. Cases this
layer shares with its previous base and that layer 23 does not touch (tactical reload from 4, a switch after the first
shell, a slug behind a live shell, held alt-fire) were measured before layer 23 went in below this PR and are not
repeated here.

Toolchain

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

Linked Issues

With sv_neo_reload_experimental, the Supa-7 holds six rounds in a tube
and one in the chamber, seven in all as before. The tube and the chamber
are networked and predicted, and the HUD shows the tube count and the
chambered round through the chamber queries of the phase code.

Reload input, the shell cadence, slugs and early fire stay as they were;
a held alt-fire queues one slug at a time. Each round enters the tube at
the reloadinsert frame where the hatch closes behind it, so a switch or
a shot before then leaves it in the reserve. A slug loaded on a live
shell goes into the tube. With no live round chambered, the gun plays
the reloadend rack before it can fire, and the round is fed when the
pump is home. A switch or a drop cancels a rack or an insert that has
not reached that point.

The tube logic sits in TubePhasesOn* hooks, so master's reload, fire,
drop and frame functions gain one-line calls. Each hook checks the flag
itself: with the cvar at 0 the weapon behaves as before.

The pump after the first shell moves onto the tube: the shot that
empties the tube leaves the hull chambered, the step after the first
insert racks it with reloadpump (the pump's home frame feeds the
chamber from the tube), and a shot or the trigger rack waits while
that feed is pending.
@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/170-flag-off branch from 5582e1f to 94fae98 Compare November 10, 2026 02:11
@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/180-supa7 branch from 4ea1cac to 4bbc0a5 Compare November 10, 2026 02:11
@sunzenshen sunzenshen changed the title Partial reloads 20: Model the Supa-7 tube and chamber Partial reloads 23: Model the Supa-7 tube and chamber Nov 10, 2026
@sunzenshen
sunzenshen force-pushed the stack/reload-zr68c/180-supa7 branch from 4bbc0a5 to f1a2ab9 Compare November 10, 2026 03:37
@sunzenshen sunzenshen changed the title Partial reloads 23: Model the Supa-7 tube and chamber Partial reloads 24: Model the Supa-7 tube and chamber Nov 10, 2026
@sunzenshen
sunzenshen changed the base branch from stack/reload-zr68c/170-flag-off to stack/reload-zr68c/175-supa7-pump November 10, 2026 03:37
@sunmachine sunmachine added the Animations Animation stuff. Including the syncronizing of animations between client and server based on state. label Nov 12, 2026
@sunzenshen

Copy link
Copy Markdown
Contributor Author

Closing to clear the board in favor of the PR stack of sunzenshen#34

@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