Skip to content

Conversation

@mszabo-wikia
Copy link
Contributor

Changes

  • Increase both minimum spread density and dissipation threshold tenfold so as not to simulate minuscule smoke clouds that all get rendered as "0 PPM" and have no appreciable impact on gameplay.
  • Apply a minimum dissipation rate of 0.001 / tick so that smoke clouds < 10 PPM still dissipate in a reasonable amount of time (this should hit the 3 PPM dissipation threshold in ~3mins on speed 3).
  • Use a fixed tick interval of 15 ticks for smoke.
  • Double the propagation interval for smoke and also double the amount of smoke spewed by fires within this interval to compensate.
  • Calculate smoke spread to adjacent cells in parallel.
  • Apply black smoke-related hediffs via a postfix on GasUtility.PawnGasEffectsTickInterval() rather than a per-tick call in Smoke.

Reasoning

Our black smoke is a Thing-based gas, like all gases were prior to Biotech. This results in noticeable overhead when a large amount of smoke is present on the map, which is further exacerbated by dissipation being proportional to smoke density and thus causing small smoke clouds to take forever to disappear. Sadly there aren't really good options for modded gases these days short of creating a bespoke implementation of our own, but we can nonetheless endeavor to make the current situation better.

Alternatives

  • Use an existing system that allows for modded gases - the only one I'm aware of is Simple Gas Framework, which depends on Fish and Prepatcher and therefore doesn't work in 1.6. Even if Fish gets updated someday, adding a dependency on 3 mods, where one of the authors is inactive could cause us problems the next time RimWorld updates.
  • Jerry-rig a vanilla GasGrid into a MapComponent and use that for black smoke mechanics. This actually seems workable, but we'd have little control over dissipation and other functionality without ripping out parts of the code, so the end result would behave quite differently to the current black smoke.
  • Implement our own bespoke gas grid for black smoke - seems like a pain to manage in the longer term.

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • Playtested a colony:

Savefile: smoke test.rws.zip

Overhead from smoke without these changes:

20260101234249_1

Overhead from smoke with these changes:
20260101234640_1
20260101234645_1

Our black smoke is a `Thing`-based gas, like all gases were prior to
Biotech. This results in noticeable overhead when a large amount of
smoke is present on the map, which is further exacerbated by dissipation
being proportional to smoke density and thus causing small smoke clouds
to take forever to disappear. Sadly there aren't really good options for
modded gases these days short of creating a bespoke implementation of
our own, but we can nonetheless endeavor to make the current situation
better.

So:
* Increase both minimum spread density and dissipation threshold
  tenfold so as not to simulate minuscule smoke clouds that all get
  rendered as "0 PPM" and have no appreciable impact on gameplay.
* Apply a minimum dissipation rate of 0.001 / tick so that smoke clouds
  < 10 PPM still dissipate in a reasonable amount of time (this should
  hit the 3 PPM dissipation threshold in ~3mins on speed 3).
* Use a fixed tick interval of 15 ticks for smoke.
* Double the propagation interval for smoke and also double
  the amount of smoke spewed by fires within this interval to
  compensate.
* Calculate smoke spread to adjacent cells in parallel.
* Apply black smoke-related hediffs via a postfix on
  GasUtility.PawnGasEffectsTickInterval() rather than a per-tick
  call in Smoke.
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-20647208972.zip

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Download in Comments This PR has a zipfile download available.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants