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

Better Gas masks - Model concentration better, and make gas mask cartiges last longer #68570

Merged

Conversation

MorvarchPrincess
Copy link
Contributor

@MorvarchPrincess MorvarchPrincess commented Oct 9, 2023

Summary

Balance "Gas mask cartriges last quite a bit longer, and lower concentration gas takes less charges"

Purpose of change

Per issue #68554, our gas masks last a really short amount of time. I considered just about tripling the gas mask charge costs to bring it in line with estimates mentioned in the issue, but decided it would be better to have a concentration calculation in the charge buildup.

Describe the solution

My aim is to have an additional entry for gasses that is "concentration" that acts as a multiplier on charges spent, so thick toxic gas burns through your charges quicker than thin gas. I'll then go adjust numbers for gasses so that thick toxic gas means your gas mask will last about 20 minutes, and less problematic substances (read normal smoke) arn't as bad.

I also switched how the gas_absorption_factor works, it's now no longer what percent of a charge it uses per tick, its now how long a full 100 charge filter lasts in a concentration 1 gas.

Finally I also added another little message to the player when their gas mask charges go under 10. IRL a gas mask gets harder to breathe in as the filter clogs up, so it made sense for players to get a warning as they are running out.

Describe alternatives you've considered

I could just not add concentration, which would just require adjusting the gas absorption numbers, but it would still leave light gasses to unrealistically burn through charges.

I also considered basing the multiplier on intensity, but that doesn't work great as that number is primarily used for the amount of effect, and as such the numbers don't line up (toxic gas and thick toxic gas have the same number at 4) and could get modified and cause unintentional changes to gas mask charges.

Finally, I could have left gas absorption values the same, but it ended up with some very messy calculations so I decided it was better to change how the system works to be more based on how we measure gas mask lifetime in real life.

Testing

Tested both manually and via walking through code.

I booted up the game and spawned a gas vent in a small building. then waited till the room filled up. I then both watched the calculation via stepping through code, and confirmed it was taking the appropriate amount of charges off by waiting in the cloud with a mask on.

Additional context

@github-actions github-actions bot added Game: Balance Balancing of (existing) in-game features. [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Oct 9, 2023
src/field_type.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Oct 9, 2023
data/json/field_type.json Outdated Show resolved Hide resolved
data/json/field_type.json Outdated Show resolved Hide resolved
data/json/field_type.json Outdated Show resolved Hide resolved
src/field_type.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Oct 9, 2023
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/field_type.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Oct 9, 2023
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels Oct 9, 2023
src/iuse.cpp Outdated Show resolved Hide resolved
src/field_type.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
Add linting suggestions

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Oct 9, 2023
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Oct 9, 2023
doc/JSON_INFO.md Outdated Show resolved Hide resolved
doc/JSON_INFO.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 9, 2023
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions and removed astyled astyled PR, label is assigned by github actions labels Oct 9, 2023
@Maleclypse Maleclypse merged commit 7c8fdbd into CleverRaven:master Oct 13, 2023
22 of 26 checks passed
detahramet pushed a commit to detahramet/Cataclysm-DDA that referenced this pull request Nov 6, 2023
…iges last longer (CleverRaven#68570)

* Some initial work on better modelling of gas mask usage, doesn't work as I can't get the intensity level

* add absorbtion calculation

* Modify calculation to make gas mask last 20 minutes from full charge in thick toxic gas

* Add low gas charges warning

* Change gas_absorption _factor to be a timescale

* Fix loading of concentration

* Add documentation

* linting C++ code

* Apply suggestions from code review

Add linting suggestions

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

* Better documentation clarity

* Update src/iuse.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zhilkin Serg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Game: Balance Balancing of (existing) in-game features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants