Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Ammo Extended

Is a mod for the Highfleet Modloader that allows customization and addition of the ammos in the game. Changes are made through the ammo_extended.json configuration file. Extensive documentation created from Rust is provided in each release in the doc folder.

Ammo Extended requires a Highfleet Modloader build with the shared Patchy service. Use the Ammo Extended build that matches your Steam executable (1.151 or 1.163). On unsupported versions or externally patched executables, Ammo Extended warns and still attempts to initialize.

Changing behaviour

For both versions, three independent fields control ammo selection and behavior:

  • caliber: ammo identifier matched by a weapon's m_weapon_caliber in OL.seria.
  • behavior: selects vanilla projectile spawning code, including its spread and muzzle flash.
  • logic: selects projectile behavior such as laser guidance or proximity fuzing.

Normally the game uses the ammo's caliber identifier to select spawning code. Ammo Extended instead stores behavior in native padding at offset 0xCC and patches the game to read it.

Use a vanilla spawning behavior for a new caliber. Regular shell behaviors include 5, 10, 15, 20, 25, 30, and 40. Rocket behaviors include 51, 52, 54, and 55.

Behavior 60 spawns mines with fixed damage; 70 has an unknown purpose; 80 applies a short-range force pulse. The shipped config also contains 90 for harpoon, 100 for KAZ, and 0 for special entries including aircraft bombs and K-13.

These values are not an exhaustive validation enum. The loader accepts a u32 without enforcing a behavior whitelist.

Rocket firing sounds

Cannon shells already take their firing sound from the ammo record. The gun-launched rocket cases used to ignore those fields and always play the hardcoded missile_launch set. The shared FireShell sound blocks used by behaviors 51, 52 and 55 now select the rocket sound the same way as a cannon shell:

  • shell_out when the player's ship fires and the camera is zoomed in.
  • shell_far when the shot is distant (zoomed out).
  • shell_enemy when a non-player ship fires and the camera is zoomed in. Steam 1.151 has no shell_enemy field, so it uses shell_far for those shots.

The selector also applies to rockets fired by aircraft, which reach the same FireShell cases.

Behavior 54's FireShell case has no launch sound in vanilla, so there is nothing to reroute for it.

Like the cannon sound fields, these values name a sound set (shell_out_med, which expands to shell_out_med_01..04), not an individual sound file.

shell_in is unchanged: the game already reads it when a round is loaded into a magazine, and rockets use that same path.

Rocket launch speed

Cannon shells already use speed as their launch velocity. Gun-launched rockets (behaviors 51, 52 and 55) used to ignore it: they inherited only the firing ship's velocity and then ramped up from their thrusters. They now add speed along the rocket's heading at launch, on top of the firing body's velocity. A 220 mm rocket with "speed": 150.0 leaves the tube at 150 units/second before its thruster adds more.

  • Steam 1.163 and Steam 1.151 are both supported.
  • speed is taken as written: 0.0 keeps the vanilla launch, and a negative value launches backwards.
  • The rocket's own random spread is included, because the speed is applied to the angle the game has already randomised.
  • Behavior 54 (the 300 mm rocket, logic 132) is not affected. Vanilla logic 132 replaces the velocity with its master body's velocity on the first tick, which would discard a launch speed.

Shrapnel count, damage and fuse time

Each ammo entry accepts three independent optional overrides for shrapnel projectiles (logic: 150):

{
  "caliber": 999,
  "behavior": 25,
  "logic": 150,
  "shrapnel_count": 20,
  "shrapnel_damage": 3.5,
  "shrapnel_fuse_time": 0.75
}

This is a partial entry; keep the other required ammo fields. The overrides are stored per ammo entry, independently of caliber identifiers. They only affect shrapnel runtime logic; other logic values do not use them.

  • shrapnel_count sets the number of fragments per burst. Omit it to keep the vanilla count of 10. It accepts an unsigned 32-bit integer (0 through 4294967295) without a custom range check or clamping. Larger counts are expensive.
  • shrapnel_damage sets each fragment's explosive_power, not its final HP damage. Omit it to keep the vanilla value of 2.
  • shrapnel_fuse_time overrides the parent shrapnel shell's fuse in seconds. Omit it to keep the vanilla calculation: 100 world units divided by initial speed. State updates are quantized. Therefore the actual burst occurs on a state update rather than necessarily at the exact configured instant.

Warning: shrapnel_count: 0 does NOT disable fragments. The original do-while loop underflows its 64-bit counter and almost certainly freezes or crashes the game when the shell bursts. The mod logs a warning at config activation but accepts zero unchanged; it does not skip or clamp it.

Missile lifetime

Ammo using missile spawning behaviour honors its configured lifetime in seconds instead of the vanilla hardcoded 10-second lifetime.

  • Steam 1.163: uses the native ammo lifespan field. Set "lifespan": 25.0 for a 25-second missile lifetime.
  • Steam 1.151: accepts an optional lifespan field, replacing the old config name ttl. Omitting it preserves the vanilla 10-second missile lifetime. The mod stores this value in padding_164h, so that padding field is now reserved by the mod. Other 1.151 projectile lifetimes are unchanged.

For 1.163 shells with positive penetrative_power, the game forces lifespan to one second unless QoL's enable_unblocked_ttl patch is enabled.

Plane payloads

fire_delay controls plane payload release timing; larger values mean slower release. Standard guns are unaffected. salvo_size is the number of payload releases per plane strafe. aFter releasing this many times, the plane waits until it can break its strafe, gains distance, and approaches again.

fire_delay is separate from the aircraft gun reload time. The 37mm aircraft gun uses delay 0.1 and salvo size 10 in 1.151, versus delay 0.05 and salvo size 20 in 1.163. The 57mm aircraft gun has salvo size 7 in both versions.

aircraft_strength_contribution contributes to map-aircraft weapon-strength scoring, not projectile damage. The game scales it by carried quantity for some weapon categories; gun contributions can be unscaled.

Other fields

Other field meanings are extensively documented on highfleet::v1_151::Ammo and highfleet::v1_163::Ammo. You can find these in the docs folder of the release.

Steam 1.151 and 1.163 configuration: breaking schema change

Both versions now use the shared field names below. Old configurations are rejected. Missing required fields are errors.

Old config key New config key
shell_kind display_name
shell_kind2 display_name2
padding_cch behavior
caliber logic
index caliber
ttl lifespan
unknown_180h (1.163) / unknown_15ch (1.151) salvo_size
unknown_150h (1.151) shop_rarity
unknown_154h (1.151) shop_ammount
unknown_158h (1.151) fire_delay
unknown_160h (1.151) aircraft_strength_contribution
padding_184h (1.163, incorrectly classified as padding) aircraft_strength_contribution

Legacy keys unknown_16ch, unknown_174h, unknown_178h, and unknown_17ch are ignored. Use lifespan, shop_rarity, shop_ammount, and fire_delay, respectively. Other names, including milimeterage and shop_ammount, are unchanged.

When migrating, move the old caliber value to logic before moving index to caliber. These fields have distinct meanings, not interchangeable values. The shipped ammo_extended/ammo_extended_1_151.json and ammo_extended/ammo_extended_1_163.json are complete examples of the new schemas.

In old 1.163 configs, padding_184h contains the IEEE-754 bits of a float, not an integer strength value. Migration must reinterpret those bits: for example, 1065353216 becomes 1.0, not 1065353216.0. The shipped example has been converted without changing the underlying values.

1.151 has no shell_enemy field or native lifespan. Its new config accepts optional lifespan for missile spawning only, defaulting to 10 seconds.

City shops (Steam 1.163)

The 1.163 build adds a simple custom-ammo button grid to the city's supplies shop. It starts at the top left and fills downward before moving to the next column. Buttons show the ammo name, unit price, and city stock.

Entries are detected automatically by comparing configured item_name values with the original game definitions. Keep identifiers unique and leave the undefined entry at index zero. Custom entries need a positive shop_price. A button is shown when the city stocks the ammo or the player owns some to sell back. Invalid identifiers, nonpositive prices, and quantities/prices that exceed safe native arithmetic ranges are skipped.

For initial city stock, set shop_rarity and shop_ammount appropriately before starting a new campaign. The grid does not replenish stock or migrate existing saves. Existing campaigns only show custom ammo already present in city/player inventory. Preserve definition order when continuing a campaign; save compatibility after reordering definitions has not been established.

The grid uses the game's standard button/font resources, not per-ammo sprites. It is rebuilt with the native shop after transactions. Space is bounded by the viewport, with the bottom exit area reserved; if entries do not fit, the mod logs a warning.

Limitations

The custom shop grid is not implemented for 1.151 yet. Added finite ammo variations in that version still cannot be purchased through the vanilla shop display.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages