Skip to content

Modernisation - #289

Closed
hotsake-uk wants to merge 223 commits into
cortex-command-community:developmentfrom
hotsake-uk:modernisation
Closed

hotsake-uk wants to merge 223 commits into
cortex-command-community:developmentfrom
hotsake-uk:modernisation

Conversation

@hotsake-uk

Copy link
Copy Markdown

No description provided.

hotsake-uk and others added 27 commits October 3, 2026 19:27
Five 2D radiance cascades at half resolution: glows add light along
rays, foreground terrain and objects stop them and re-emit last frame's
lit colour (GIBounce) for multi-bounce light. Cascades are merged top
down and cascade 0 averaged into a quarter-resolution irradiance the
composite adds to the light; it replaces the screen-space indirect
light when on. ~0.3 ms on the stress scene. Enabled by the Ultra
preset, toggles in F6 and the Graphics Lab, GI-only debug view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e ignores the editor panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Explosions and fast terrain hits spawn purely visual particles through
a thread-safe queue (impacts budgeted per frame). They move in sim time
with their own RNG and only read terrain to bounce. Sparks are emissive
streaks (glow, bloom, GI), debris chips are drawn lit in the scene, and
dust puffs are lit over the HDR scene by a new lit-particle pass (kept
out of the depth buffer so backgrounds keep their own lighting).
EffectsParticles setting, part of Extra Effects and quality presets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Smoke particles (air-material MOSParticles that float up) register
their position, size and remaining life when drawn; they are splatted
into a half-resolution density buffer and the dynamic light plus GI
passing through is added to the HDR scene, so fire, flashes and lamps
glow through smoke. SmokeScattering setting and presets; RenderTest
smoke column scenario (SmokeNight/SmokeNightOff).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blood (any colour, via own-colour pixels) and oil drops splashing on
terrain queue render-only stains (thread-safe, budgeted) that are
stamped into a world stain map alongside the scorch map; the terrain
shader tints terrain towards the stain colour while keeping its
texture. Stains setting, part of Extra Effects and presets. Effects
colours now resolve material colours robustly (RGB, else palette
index; index 0 is the mask colour), fixing magenta-tinted chips.
RenderTest Stains scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terrain vegetation (palette colours flagged in the emissive palette's
G channel) sways with wind gusts, leaning more towards the tips, and is
pushed outward by passing blast fronts. Snow settles a few pixels deep
on ground under open sky (skyline test) while snowing and melts later;
rain darkens exposed surfaces and they dry slowly. All in the terrain
shader, bitmaps untouched. LivingWorld setting, part of Extra Effects
and presets; classic test scenarios turn the new effects off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Freezes time, hides HUD and screen text, free camera (right drag or
arrow keys), look sliders, and screenshots saved as shown or at 2-4x
the internal resolution by re-running the window present into an
offscreen target. Look changes are reverted on close unless kept.
F6/F8 are now handled from the SDL event loop so they work while the
sim is frozen, and function keys always reach the game even when an
ImGui window has focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TerrainFire ticks every 3 sim updates with its own seeded RNG; ignitions
from explosions and fire/flame/napalm particle hits are queued
thread-safely and sorted before use, so it stays deterministic. Fuel
kinds come from material names (grass/vegetation burn away, wood/cloth/
rubber burn from the surface to ash, oil burns fast); only exposed
pixels catch and fire climbs. Burning cells spawn Flame Hurt particles
and smoke, register flickering lights, glow as flame tongues and throw
render-only embers. TerrainFire gameplay setting and F6 toggle;
RenderTest Fire/FireNight scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After big explosions, checks around the crater (0.5 s and 1.5 s later)
flood-fill for detached pieces of terrain (8-connected, up to 2500 px,
not touching concrete/metal/military materials or the world's edge).
Detached pieces fall as rigid chunks through the terrain, accelerating
each sim update, and land with a dust burst. Deterministic: sorted
checks, no RNG. TerrainCollapse gameplay setting and F6 toggle;
RenderTest Collapse scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FluidSim: liquid terrain pixels fall, slide diagonally and run sideways
to find their level, processed bottom-up and applied immediately so
columns fall together; only recently moved or disturbed pixels are
simulated (explosions and collapses wake them). Deterministic: sorted
active set, own seeded RNG. Water extinguishes fire; lava is viscous,
glows, ignites flammable terrain, spawns hurt particles and sets to
stone with steam on contact with water; acid dissolves soft terrain.
New Lava (165) and Acid (167) materials. The terrain shader draws
water see-through with shimmer and a surface highlight, lava as glowing
currents with a crust, acid with bubbles (palette flags in the
emissive palette's B channel). SceneMan:PourLiquid Lua API,
FlowingLiquids gameplay setting, F6 toggle, Liquids test scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cone lights: SceneLight carries a direction and cone cosine, passed to
the point light shader through a new LIGHTCONE vertex attribute, with a
soft cone edge, a little spill, and a faint visible beam drawn over the
HDR scene. At night living soldiers register headlamp cones along their
aim; LookForMOs rays shrink with darkness (to 50%, or 80% with a lamp)
when NightAffectsAI is on. New buyable Flare device (red flickering
light and glow for 45 s). Lights skip occlusion within 8 px of
themselves so lamps lying in terrain still light their surroundings.
Headlamps/NightAffectsAI settings and F6 toggles; FlareNight scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ImGui background draw list at window resolution: a minimap of the
terrain (rebuilt every few seconds) with the view rectangle and units
coloured by team, health and ammo bars for the controlled unit with
outlined labels, and a fading feed of units lost. Off by default;
ModernHUD setting, Video settings checkbox and F6 toggle. Hidden in
photo mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ImGui is scaled with the window height (720 px = 1x, up to 2.5x) for
big screens and handhelds, and uses Roboto rasterized at 2x and drawn
at half scale so text stays sharp. Gamepad navigation was already on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ang-format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loading any saved game aborted: the saved terrain layers exist only as
in-memory PNGs, which GetAsBitmap finds in the bitmap cache but the
GPU renderer's GetAsTexture didn't, so it looked on disk and aborted
(and the abort handler's emergency save then deadlocked). GetAsTexture
now uses the in-memory images the same way.

Saved games now also store terrain fire (burning pixels and the fire's
random state) and flowing liquid (moving pixels and random state) as
TerrainFireState/FlowingLiquidState, restored when the loaded scene
starts. FluidSim serializes from a width cached at update instead of
touching the terrain mid-save. RenderTest FireSave/PlainSave scenarios
(script quicksaves; press F9 to load).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two buttons in the activity configuration cycle Time (scene default,
dawn, noon, dusk, night) and Weather (scene default, clear, rain,
snow). The choice overrides the scene and player atmosphere for that
activity (kept on restart, cleared when loading a saved game).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SmokeGrid: a coarse smoke-density map rebuilt each sim update from
  floating air particles. Units can't spot targets through thick smoke
  (AHuman/ACrab LookForMOs), and the human AI loses track of targets
  hidden by it (SceneMan:SmokeBlocksSight Lua binding). Gameplay setting
  SmokeBlocksSight, toggle in the F6 World Debug window.
- Smoke Grenade: a thick, lingering smoke screen. Not in the AI's
  grenade group, so the AI doesn't smoke itself out of targets.
- Toxic Gas Grenade: a green cloud that hurts anyone inside it for
  about ten seconds and blocks sight like smoke.
- Fix copied presets with their own SpriteFile drawing the copied
  preset's frames on the GPU path (MOSprite textures weren't cleared).
- RenderTest: Grenades / GrenadesNoBlock scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Liquid drops that settle into the terrain in their liquid's own colour
  join FluidSim and flow (blood, drawn in water, stays put). Burning
  particles set the flammable pixel they settle as alight.
- Oil is a flowing liquid. Fire on a pixel whose fuel has flowed or
  been blown away goes out instead of clearing whatever is there now.
- Water douses fire where it splashes (queued, applied in a fixed order).
- Napalm Flamer: burning fuel that splashes, runs downhill and burns
  where it pools. Water Cannon: knocks people back, puts fires out.
  Acid Sprayer: globs that sting and eat soft ground. All refits of
  the Concrete Sprayer with recoloured bodies.
- Lua: SceneMan:GetBurningPixelCount(), GetFlowingLiquidPixelCount().
- RenderTest: LiquidWeapons scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd drives fire

- Rain (and less so snow) makes terrain fire spread less and burn out
  sooner. Wind makes it spread downwind, and in dry weather carries
  embers a few pixels downwind to start new fires.
- Snow slows walking and running by up to 15%.
- WeatherEffects.h reads the game's weather (scene, scenario setup or
  player settings), which stays fixed through a game.
- RenderTest: WeatherCalm/Rain/Snow/WindRight/WindLeft scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uid; soak scenario

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New "Sandbox" game mode: play as a god with a free camera. Every unit
  is AI-run, including your own side's, and the game never ends.
- F7 sandbox window (also a debug panel in other games):
  - Spawn: units from every faction (squad size, loadout, orders),
    brains, items and bunker pieces, with search, for four sides.
  - Orders: hold, attack nearest enemy (re-targets when the target
    dies), hunt brains, patrol, rally point, do nothing; per spawn or
    for a whole side.
  - Take control of any unit; F7 goes back to the god view.
  - Paint fire/liquids/smoke/gas and terrain; grenade, bomb, napalm
    and lightning strikes; weather, time, slow motion.
- Actions are queued and applied in the sim update on the main thread.
- Lua: SandboxDo(tool, pos, side, order, count, preset) and
  SandboxCountUnits(side).
- RenderTest: Sandbox / SandboxBattle scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "Build bunkers with the build menu" opens the game's own build menu
  mid-game (new GameActivity free build mode): it places straight into
  the world, and finishing returns to the battle without needing a brain.
  Money is kept topped up. Lua: SandboxBuildMode(true/false).
- Sides use the game's team colours (Red, Green, Blue, Yellow), so the
  colour you pick matches the icons over units' heads.
- Faction default loadouts no longer hand out grenade bandoliers, which
  delete themselves when held. Mass battles strewed dozens of them,
  the likely trigger of a crash deleting loose items.
- Pausing no longer resets the sandbox; entering build mode releases a
  unit you were controlling.
- RenderTest: SandboxStress scenario (hundreds of units).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ActorFire: flames, napalm, burning ground and lava set units alight.
  Burning units take damage, panic and run, set grass and nearby units
  alight, and burn out or are put out by water (pools, water cannon,
  heavy rain). Deterministic; gameplay setting BurningUnits, F6 toggle.
- Steam: water putting out fire, and lava meeting water, throw up white
  steam puffs that rise, fade and block sight like smoke.
- Only real water drops douse fire (blood is water-material but red).
- Fuel Barrel: leaks flowing oil where shot, and explodes in burning
  fuel when fire reaches it or it's shot to pieces. Buyable, in the
  build menu's Bunker Systems.
- Lua: SceneMan:IsBurningNear(pos, radius), GetBurningUnitCount().
- RenderTest: FireUnits scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…amera

- Drop squad: units arrive by dropship or rocket over the clicked point.
- Auto battle: each side gets a faction and budget, buys waves of that
  faction's units and drops them in to attack until one side is left;
  the winner is announced. Scoreboard in the Orders tab.
- Command tool: drag a box to select units, click ground to move them
  or an enemy to attack it; give the selection any orders.
- Follow tool and "Follow the action": the camera follows a unit or the
  closest fighting; moving the camera by hand stops it.
- Attack re-targeting leaves burning (panicking) units alone; crafts
  don't count as a side's units.
- Lua: SandboxAutoBattleSide, SandboxStartAutoBattle; SandboxDo
  "Drop squad", "Select", "Command", "Follow".
- RenderTest: SandboxArmies scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A global AI pause (sandbox window, F6 World Debug, Lua SandboxPauseAI):
AI-run units stand still and hold fire while physics, fire and liquids
carry on. Craft keep flying so drops don't fall; player-controlled units
still move. An on-screen banner shows while paused, and a new game
starts with the AI running. RenderTest: PauseAI scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hotsake-uk hotsake-uk closed this Oct 4, 2026
@hotsake-uk
hotsake-uk deleted the modernisation branch October 4, 2026 14:38
@hotsake-uk
hotsake-uk restored the modernisation branch October 4, 2026 14:42
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.

2 participants