<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=SpaceGod.Game%2FEffects</id>
	<title>SpaceGod.Game/Effects - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=SpaceGod.Game%2FEffects"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=SpaceGod.Game/Effects&amp;action=history"/>
	<updated>2026-12-06T16:29:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=SpaceGod.Game/Effects&amp;diff=2723&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=SpaceGod.Game/Effects&amp;diff=2723&amp;oldid=prev"/>
		<updated>2026-12-02T18:58:17Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= World effects: exhaust clouds and the rest (US-T447) =&lt;br /&gt;
&lt;br /&gt;
The owner: &amp;quot;needs more special effects and cloud exhaust&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Every thrusting hull now leaves its exhaust as clouds: soft, lit puffs that billow out of each nozzle, glow in the drive&amp;#039;s colour while they are young, then cool into pale vapour, spread and thin out behind the hull. They are left in world space, so a turning hull lays a curving trail and a moving one leaves its trail behind it. Around that, a set of effects for flight, fights, drives and gates. All of it is drawing only: nothing in the simulation is read back or written, so co-op peers stay in lockstep (each draws its own) and the bench (&amp;lt;code&amp;gt;tools/bench.ps1&amp;lt;/code&amp;gt;) is untouched (SpaceGodCore is not changed).&lt;br /&gt;
&lt;br /&gt;
Every tunable is in one place: &amp;lt;code&amp;gt;Views::EffectsTune&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Cpp/Source/SpaceGod/Views/EffectsTune.h&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== What is drawn ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Effect&lt;br /&gt;
! When&lt;br /&gt;
! What it looks like&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Exhaust clouds&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a main engine lit (the hull&amp;#039;s own flames, &amp;lt;code&amp;gt;HullThrusters&amp;lt;/code&amp;gt;, US-T432)&lt;br /&gt;
| clouds out of every nozzle along its own axis, born hot in the drive&amp;#039;s blue, cooling to pale vapour, growing several times their nozzle&amp;#039;s width and thinning away. A fighter&amp;#039;s are thin, quick and short-lived (0.9 s); a freighter&amp;#039;s or a capital&amp;#039;s denser, slower and long (3.0 s). Rate, size, speed and density scale with the throttle (the jet&amp;#039;s level) and the hull&amp;#039;s heft (its length, a freighter or a miner heavier than its length)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Boost&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a hull&amp;#039;s boost charge falling (a fighter or a gunship opening up past cruise)&lt;br /&gt;
| the kick: a ring of hot puffs round the nozzles and a flash on them; while it burns, twice the clouds, bigger, hotter, faster&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;RCS vapour&amp;lt;/strong&amp;gt;&lt;br /&gt;
| any RCS jet or retro lit (US-T433)&lt;br /&gt;
| a small cold puff of white vapour out of the jet, a little stream while it holds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Venting&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a damaged hull&amp;#039;s breaches burning (&amp;lt;code&amp;gt;ShipView&amp;lt;/code&amp;gt;&amp;#039;s breach fires, by hull damage)&lt;br /&gt;
| gas streaming out of each breach, now and then a puff with fire in it; a wreck smokes darker and longer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Impact&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a hit on a hull (&amp;lt;code&amp;gt;FxKind::Impact&amp;lt;/code&amp;gt;)&lt;br /&gt;
| sparks spraying off the plating, a few specks of it tumbling clear, a puff of hot smoke&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Blast&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a hull lost (&amp;lt;code&amp;gt;UnitDestroyed&amp;lt;/code&amp;gt;), a part shot out (&amp;lt;code&amp;gt;SubsystemDestroyed&amp;lt;/code&amp;gt;, a third the size)&lt;br /&gt;
| over BattleFx&amp;#039;s fireball: a shockwave ring racing out and a slower one behind, sparks, glowing embers drifting off and cooling red, and a debris cloud that glows orange as it cools to dark smoke and hangs for about 8 s&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Breach jet&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a boarding pod&amp;#039;s breach (&amp;lt;code&amp;gt;FxKind::Breach&amp;lt;/code&amp;gt;)&lt;br /&gt;
| a jet of air streaming out of the hole for 1.6 s&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;FTL jump&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a hull jumping out of a fight (&amp;lt;code&amp;gt;FxKind::FtlJump&amp;lt;/code&amp;gt;), the helm&amp;#039;s FTL drive engaging or arriving&lt;br /&gt;
| a flash, a ring, and a streak on along the heading (arriving: the streak it came in on)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Cruise engage&amp;lt;/strong&amp;gt;&lt;br /&gt;
| the helm&amp;#039;s in-system cruise drive engaging&lt;br /&gt;
| a shock ring off the stern, a flash and a burst of hot exhaust&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;strong&amp;gt;Gate transit&amp;lt;/strong&amp;gt;&lt;br /&gt;
| a hull going out through a jump gate (its index&amp;#039;s ship turns &amp;lt;code&amp;gt;GateDeparted&amp;lt;/code&amp;gt;), or a hull new to the system&amp;#039;s fleet beside a gate&lt;br /&gt;
| going: space folds shut on it (a violet ring closing), then a white flash and a streak on through, ionised wisps left hanging; coming: the flash first, the fold opening out round it, the streak it came in on&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Shield hits already ripple across a hex lattice on the struck arc (BattleFx, U.SPC-T40); muzzle flashes, tracers and the fireball are BattleFx&amp;#039;s as before. Docking and berth lights are not part of this ticket.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Views::WorldFx&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Views/WorldFx.*&amp;lt;/code&amp;gt;) holds three pools and draws them as two dynamic meshes of camera-facing quads:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Clouds&amp;lt;/strong&amp;gt;, drawn with the new &amp;lt;code&amp;gt;M_Smoke&amp;lt;/code&amp;gt; material (&amp;lt;code&amp;gt;Shared/Plugins/SpaceGodRender/Shaders/Smoke.ush&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;spacegod_render_materials.py&amp;lt;/code&amp;gt;&amp;#039;s &amp;lt;code&amp;gt;build_smoke&amp;lt;/code&amp;gt;; translucent, two-sided, sort priority 5 so the additive glows and fire draw over it), sorted back to front every frame. Each quad is a ball of cloud: a billowing edge from two octaves of value noise turned and shifted by the particle&amp;#039;s seed, shaded as a sphere under it lit by the system&amp;#039;s star (wrapped, so the night side still reads, with its folds darker), a bright fringe when it is backlit, and a hot core in the vertex colour that fades with the particle&amp;#039;s heat. Per vertex: colour = tint and opacity; Unity uv0.zw (TexCoord1) = albedo level + seed, heat.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Sparks and embers&amp;lt;/strong&amp;gt;, and &amp;lt;strong&amp;gt;flashes&amp;lt;/strong&amp;gt; (radial glows, rings, streaks), with &amp;lt;code&amp;gt;M_Fx&amp;lt;/code&amp;gt;&amp;#039;s own shapes (no new material; &amp;lt;code&amp;gt;Fx.ush&amp;lt;/code&amp;gt; gains a thin ring, shape -1, crisp at any radius, for the shockwaves, the gate&amp;#039;s fold and the drives&amp;#039; rings).&lt;br /&gt;
&lt;br /&gt;
Every particle moves on a closed form of its age (&amp;lt;code&amp;gt;P0 + V0 (1 - e^(-drag t)) / drag&amp;lt;/code&amp;gt;; its size, opacity and heat are functions of age too), so nothing is integrated frame by frame. That is what keeps the hold rewind working: the effects run on &amp;lt;code&amp;gt;UnitySpaceApp::HoldRewindFxClock&amp;lt;/code&amp;gt;, so while a hold plays the past back they run backward with it (a puff shrinks back into its nozzle, a blast&amp;#039;s cloud contracts to the blast); nothing new is emitted then; when the hold ends (&amp;lt;code&amp;gt;HoldRewindFxEnded&amp;lt;/code&amp;gt;) the effects born in the moments undone go and the rest carry on from the moment played on from, exactly as BattleFx does.&lt;br /&gt;
&lt;br /&gt;
The app wires it (&amp;lt;code&amp;gt;UnitySpaceApp.Effects.*&amp;lt;/code&amp;gt;): &amp;lt;code&amp;gt;BeginWorldFx&amp;lt;/code&amp;gt; sets the frame&amp;#039;s clock in &amp;lt;code&amp;gt;UpdateViews&amp;lt;/code&amp;gt; before BattleFx runs, so BattleFx can hand over each new event (&amp;lt;code&amp;gt;BattleFx::HandToWorld&amp;lt;/code&amp;gt;: impacts, blasts, breaches, jumps); at the end of &amp;lt;code&amp;gt;UpdateViews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;UpdateWorldFx&amp;lt;/code&amp;gt; reads every fleet hull whose full model is on screen (&amp;lt;code&amp;gt;ShipView::Shown&amp;lt;/code&amp;gt;): its jets (&amp;lt;code&amp;gt;ShipView::JetsView&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;HullThrusters::Jets&amp;lt;/code&amp;gt;: each nozzle&amp;#039;s position, axis, width and level, in the hull&amp;#039;s frame, turned into scene coordinates through its view&amp;#039;s own root), its burning breaches (&amp;lt;code&amp;gt;ShipView::Vents&amp;lt;/code&amp;gt;) and its boost charge; then every battle craft (&amp;lt;code&amp;gt;UnitKind::Fighter&amp;lt;/code&amp;gt;, drawn by FighterViews) as a single nozzle astern; then the gate and drive edges; then draws. A hull&amp;#039;s velocity is read from its scene position frame to frame (smoothed), and each cloud keeps 12% of it: the rest is left behind, which is the trail. Clouds are spread back over the frame along the hull&amp;#039;s path (born where the nozzle was then, that long ago), and enough of them are made to keep the trail whole however far the hull went.&lt;br /&gt;
&lt;br /&gt;
== Performance and limits ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Budgets&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;EffectsTune&amp;lt;/code&amp;gt;): at most 5,000 clouds, 3,000 sparks and embers, 400 flashes alive; one hull at most 260 clouds; past a budget the oldest go first. These are the standard sizes: the render budget&amp;#039;s &amp;lt;strong&amp;gt;World effects budget&amp;lt;/strong&amp;gt; setting (&amp;lt;code&amp;gt;lod.worldEffects&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;WorldFx::EffectsBudget&amp;lt;/code&amp;gt;, US-T796; 25% to 200%, default 100%) scales all four, beside BattleFx&amp;#039;s own &amp;lt;strong&amp;gt;Battle effects budget&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;lod.battleEffects&amp;lt;/code&amp;gt;) for beams, tracers, flak and fireballs. A fleet hull throws exhaust, vapour and venting only while the render budget (US-T719) draws its full model (&amp;lt;code&amp;gt;ShipView::Shown&amp;lt;/code&amp;gt;), so the full-model cap bounds those emitters too.&lt;br /&gt;
* &amp;lt;strong&amp;gt;LOD by apparent size&amp;lt;/strong&amp;gt;: a hull under 7 px long on screen throws no clouds; between 7 and 220 px its rate falls to 18% with clouds up to 1.9 times bigger, so a far hull&amp;#039;s trail is a few big puffs rather than many tiny ones. Clouds under 0.6 px are not drawn. A hull moving more than 60 of its lengths a second (high time warp) or jumping more than 6 of them in a frame leaves no clouds (they would be strung out, not a trail).&lt;br /&gt;
* The cost per frame is one pass over the live particles, a sort of the clouds (n log n, a few thousand at most) and two mesh uploads; the smoke shader is two 3-octave value noises per pixel. Big clouds near the camera are overdraw: a capital&amp;#039;s exhaust seen from close behind is the heaviest case.&lt;br /&gt;
* Comfort: &amp;lt;strong&amp;gt;Reduce flashes&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;PlayerOptions::FlashScale&amp;lt;/code&amp;gt;) dims every flash (and BattleFx&amp;#039;s white explosion flash, which it did not before); &amp;lt;strong&amp;gt;reduced motion&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;UiMotion::ProfileReducesMotion&amp;lt;/code&amp;gt;) drops the sweeping shockwave and drive rings and keeps 40% of the sparks and embers.&lt;br /&gt;
* Limits: clouds already gone are not brought back by a hold rewind (BattleFx keeps a history of finished effects; the clouds do not, to stay cheap); only those still alive run backward. A hull arriving through a gate is recognised as one new to the system&amp;#039;s fleet within three gate diameters of a gate. The helm&amp;#039;s cruise and FTL flashes are read from the drives&amp;#039; state changing (&amp;lt;code&amp;gt;SystemCruiseActive&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;InFtlCruise&amp;lt;/code&amp;gt;); other hulls&amp;#039; cruise is not shown. Vents sit on the breach fires&amp;#039; spots in the hull&amp;#039;s frame, so on a wreck whose halves drift apart they stay where the halves were joined.&lt;br /&gt;
&lt;br /&gt;
== Checking it: &amp;lt;code&amp;gt;sg.Effects&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;./tools/play.ps1 -Offscreen -Capture &amp;amp;#39;&amp;#039; -Seconds 300 -ExecCmds &amp;quot;sg.Effects shot R:/Temp/effects quit&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sg.Effects [shot &amp;amp;lt;dir&amp;gt;] [quit]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;EffectsCommand.cpp&amp;lt;/code&amp;gt;) stages a battleship, a freighter and a fighter in open space with their main engines lit (&amp;lt;code&amp;gt;sg.ThrustersLit 2&amp;lt;/code&amp;gt;, new: the mains alone) and screenshots (&amp;lt;code&amp;gt;effects-*.png&amp;lt;/code&amp;gt;): the capital&amp;#039;s exhaust from astern and abeam, the freighter&amp;#039;s, the fighter&amp;#039;s; the fighter&amp;#039;s boost opening (its charge drained as a boost drains it) and burning; the freighter with every jet lit (RCS vapour); the freighter&amp;#039;s cruise drive engaging and the capital&amp;#039;s FTL jump (played on them directly); a destroyer spawned just inside a jump gate (the arrival read as in play) and then sent out through it (&amp;lt;code&amp;gt;Destroyed&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;GateDeparted&amp;lt;/code&amp;gt;, as a transit retires a hull); then a fleet action off Uranus: the furball, a hit on a hull and its smoke, a hull blown apart (blast, shockwave, the debris cloud 3 s on), the most damaged hull venting, a fighter in a dogfight watched from beside it (its curved trail) and a craft on its boost. Each shot logs the live clouds (and how many were drawn), sparks and flashes.&lt;br /&gt;
&lt;br /&gt;
Checked on 2026-11-21 (24 shots): the capital&amp;#039;s and the freighter&amp;#039;s exhaust billow out of their nozzles and spread and thin into a trail several hull lengths long (about 300 to 450 clouds alive with three hulls lit); the fighter&amp;#039;s is thin and quick; the boost&amp;#039;s kick is a hot white puff on the nozzles; the freighter with every jet lit stands in its own RCS vapour; the FTL jump is a flash, a thin ring and a streak; the gate transit a violet fold and flash at the ring&amp;#039;s scale; in the fight, small craft lay curving cloud trails through their turns, a hit leaves sparks and a puff of smoke, a hull lost throws two thin shock rings, sparks and embers and leaves an orange-lit cloud hanging; a damaged hull vents from its breach. The fight adds about 100 to 300 sparks and embers and 100 to 200 clouds at its busiest.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[SpaceGod.Game]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/SpaceGod.Game/blob/main/docs/Effects.md SpaceGod.Game/docs/Effects.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:SpaceGod.Game]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>