Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larger Map Size - Gas Doesn't Dissipate #9

Open
Mr-Ouija opened this issue Jul 29, 2023 · 2 comments
Open

Larger Map Size - Gas Doesn't Dissipate #9

Mr-Ouija opened this issue Jul 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Mr-Ouija
Copy link

TL;DR: With just Harmony, SCGF, Knockout Gas loaded, gas lingers forever on maps where both axis are >= 400

Was having an issue with gas not disappearing, and after narrowing 400+ mods down to nothing, I eventually discovered it was an issue between SCGF and my map size.

Tested with just Harmony, SCGF, and Knockout Gas enabled.

To replicate:

Settings > Dev > "Enable test map sizes"
New Game
Planet Screen > Advanced > 400x400 Map Size
Start game, spawn launcher, launch gas at colonist
4x and wait

You'll see that some gas disappears, but not all of it. You can see the same with Rot Stink if you kill some animals, debug rot the corpses, then destroy them after gas builds up. The gas lingers forever. While on a vanilla 400x400 with just base + DLCs loaded, the rot stink disappears within seconds.

Oddly enough, the other debug map size (350x350) works fine. So I did some further testing with Better (custom) Map Sizes. 399x399 worked fine. 400x399 worked fine. 1000x399 even worked, so it's not a cell count issue. Seemed to take longer to dissipate, probably because of TPS. But as soon as both axis are >=400, the gas just won't disappear.

Apologies if this is an issue on my end, but I went as far as temporarily clearing Rimworld's AppData for a clean boot.

Unrelated, but since I'm here, any plans on making it so gas vents cause gas to spread, filling up rooms and halls? The current area of effect (which, also seems smaller on larger maps but maybe I've gone crazy trying to figure this all out lol) makes them kind of ineffective, and requires you to spam them around if, for example, you needed to fumigate a cave base for roaches. Also ideas: floor vents, tank + pipe network for filling up 1 location to distribute where needed.

All that being said, I do like the mod for what it does and prefer it over its alternatives. Appreciate the work you've done on it and the effort to keep it performance-friendly. Thanks for your time.

@Mr-Ouija Mr-Ouija added the bug Something isn't working label Jul 29, 2023
@NachoToast
Copy link
Owner

Thanks for making this issue, as well as providing step-by-step instructions to reproduce it! I'll get around to hopefully fixing this over the weekend sometimes, seems very strange how different map sizes are affecting gas behaviours.

Pipe networks aren't on the todo list atm since that would be quite complicated, but there have been talks about merging this framework with a certain other one that has pipe networks as well ;)

Vents being underpowered can be addressed however, I'll look into doings some polls later down the line.

@NachoToast
Copy link
Owner

Yeah this one is really weird, I've done some testing and it seems some of the gas tiles dissipate normally (although I think slower than they would on a normal map size, again super weird stuff going on here), while other tiles don't, becoming stuck at either 100% or 20% density.

image

My immediate thought is that this could be due to floating point rounding errors, as the ExtendedGasGrid.Tick() method gets cells in a random order to tick, however this behaviour is 1:1 with what vanilla does, plus you said it works fine on larger map sizes, so this is unlikely to be the cause.

int area = map.Area;
int num = Mathf.CeilToInt((float)area * (1f / 64f));
List<IntVec3> cellsInRandomOrder = map.cellsInRandomOrder.GetAll();

I will keep working on solving this issue, but it is quite low down on the priority list due to its obscure and relatively less-impactful nature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants