Improve black smoke performance #4412
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
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
GasGridinto aMapComponentand 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.Testing
Check tests you have performed:
Savefile: smoke test.rws.zip
Overhead from smoke without these changes:
Overhead from smoke with these changes:

