Skip to content

feat: Ground fluid pickup + dirty fluid flag removal and fluid reaction framework - #9864

Open
YukariMindGap wants to merge 56 commits into
cataclysmbn:mainfrom
YukariMindGap:spongeroberts-cubictrousers
Open

feat: Ground fluid pickup + dirty fluid flag removal and fluid reaction framework#9864
YukariMindGap wants to merge 56 commits into
cataclysmbn:mainfrom
YukariMindGap:spongeroberts-cubictrousers

Conversation

@YukariMindGap

@YukariMindGap YukariMindGap commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Purpose of change (The Why)

Currently, there's no way to pick up liquids on the floor; Once they're on the floor, they're impossible to get and is basically counted as lost. There's windows of frustration where you accidentally spill the gasoline your car needs, so it's an unacceptable flaw.

I also found out that the way the game handles ground fluids and dirty fluids needs to be reworked to fit the gameplay more, and the dirty flag from the old days has to go as a consequence. I also see the potential for a fluid transform framework for more interesting interactions with fluids.

Also Closes #9199

Describe the solution (The How)

Adds fluid_pickup iuse_actor types to recover some part of the spilled liquids. Adds three fluid pump-type items (hand, gasoline, and electric), each with distinct crafting recipe, itemgroup integration, and fuel requirements. Modifies sponge and mop to add these actions.

Removes the old "dirty" flag system from liquids and replace them with a "reacts_to" JSON field where a fluid can transform into other fluids when certain conditions are met. For this PR, only ground contamination will be implemented with clean/mineral water reacting into water and gasoline/diesel reacting into dirty gasoline/diesel (which can't be used to fuel vehicles) I also added an item that can clean those dirty fuel fluids through a crafting interaction and integrated them through itemgroups that make sense

As a consequence of the removal of the "dirty" flag, you can now drink liquids from the floor

Describe alternatives you've considered

keep the water puddle being an elusive item to get and keep the old dirtiness flag causing jank interactions.

Testing

  • You walk up to a fluid spill on the floor.
  • You activate the item with the "fluid_pickup" tag
  • The menu for what to do with the fluid will open (the same menu for when you're filling or unfilling fluid containers, in fact)

Additional context

Look at this guy trying to pick up the puddle with their bare hands
image

Originally you can't do anything to the puddle after it's on the ground, but now a new friend the sponge!!
image

The sponge picks up the liquid and asks the guy where to put it
image

The guy, still wanting that liquid, pours it into the bottle.
image

Checklist

Mandatory

Optional

  • This PR used AI assistance.
  • This is a C++ PR that modifies JSON loading or behavior.
    • I have documented the changes in the appropriate location in the docs/ folder.
    • If documentation for this feature does not exist, please write it or at least note its lack in PR description.
    • New localizable fields need to be added to the lang/bn_extract_json_strings.sh script if it does not support them yet.
    • If applicable, add checks on game load that would validate the loaded data.
    • If it modifies format of save files, please add migration from the old format.

Translations

post changed stale missing
mod/json/reference/items/item_creation.md en ja, ko

Build Artifacts

PR build for commit 2482abf (Merge remote-tracking branch 'origin/main' into spongeroberts-cubictrousers) on 2026-08-26 20:51:33

Also made sponges and mop able to pick up fluids

assisted-by: opencode:deepseek-v4-flash
@github-actions github-actions Bot added src changes related to source code. JSON related to game datas in JSON format. labels Jul 12, 2026
@autofix-ci

autofix-ci Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

@github-actions github-actions Bot added the tests changes related to tests label Jul 12, 2026
Comment thread src/character.cpp Outdated
@mkrutov

mkrutov commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Hi! I kind of like this conceptually, but have a question: What is the plan for (dirty) liquid results? I don't think its reasonable from gameplay perspective to pour dirty gasoline into car, for instance, but it is reasonable to use it for something like a handmade weapon.

I also kind of think that may be the gasoline version of tool should be considerably slower (not just 1s slower than electric).

@YukariMindGap

Copy link
Copy Markdown
Contributor Author

Hi! I kind of like this conceptually, but have a question: What is the plan for (dirty) liquid results? I don't think its reasonable from gameplay perspective to pour dirty gasoline into car, for instance, but it is reasonable to use it for something like a handmade weapon.

I also kind of think that may be the gasoline version of tool should be considerably slower (not just 1s slower than electric).

I still have no idea of what to do with the dirty liquids. That's for a future PR to solve. Only one that's sure is dirty water having more potential to be sickening than normal water.

@github-actions github-actions Bot added the docs PRs releated to docs page label Jul 13, 2026
@mkrutov

mkrutov commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Does this also work for modded liquids? (Dragon Blood comes to mind - I dont' recall if it exists in MagicNights or only in Magiclysm..)

@YukariMindGap
YukariMindGap marked this pull request as ready for review July 13, 2026 17:33
@YukariMindGap

Copy link
Copy Markdown
Contributor Author

Does this also work for modded liquids? (Dragon Blood comes to mind - I dont' recall if it exists in MagicNights or only in Magiclysm..)

Should work with modded liquids.

@WishDuck WishDuck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is good in the current state
Gasoline zombies for instance will with this PR be a simple infinite source of fuel.
Let alone removing any punishment from fragile objects being destroyed, so that becomes less threatening.
Adding checks for is_dirty everywhere would also get scrungly fast.

Additional request: percentage return, some of these dont get 100% back for at least some resemblance of balance...

@YukariMindGap

YukariMindGap commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure this is good in the current state Gasoline zombies for instance will with this PR be a simple infinite source of fuel. Let alone removing any punishment from fragile objects being destroyed, so that becomes less threatening. Adding checks for is_dirty everywhere would also get scrungly fast.

Additional request: percentage return, some of these dont get 100% back for at least some resemblance of balance...

The item requirement is kind of a balancing point for the ability to get ground fluids, with the heavier the item, the more it can pick up, and also dirty fluids having (yet-unimplemented) bad effects compared to non-dirty fluids. I imagine dirty water would be more sickening than normal, untreated water. Dirty gasoline/diesel being less efficient than clean gasoline/diesel and increased chance of the engine failing to start.

Also I assume gasoline zombies would drop their gasoline at death or is it a constant +1 unit of gasoline puddles?

@WishDuck

WishDuck commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Each time gasoline zombies move they have a 1/5 chance to drop gasoline on the ground. There is no cap
See monmove.cpp line 2632

@YukariMindGap

YukariMindGap commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Each time gasoline zombies move they have a 1/5 chance to drop gasoline on the ground. There is no cap See monmove.cpp line 2632

How much do they drop anyways? One unit per proc? I imagine gasoline zombies would be quite rare. I should nerf gasoline zombies at a later PR

@YukariMindGap YukariMindGap changed the title feat: Ground fluid pickup + dirty fluid flag removal and fluid transform framework feat: Ground fluid pickup + dirty fluid flag removal and fluid reaction framework Jul 22, 2026
@YukariMindGap
YukariMindGap requested a review from WishDuck July 23, 2026 02:36
@YukariMindGap
YukariMindGap requested a review from mkrutov July 25, 2026 03:12
@YukariMindGap

Copy link
Copy Markdown
Contributor Author

I have completely reworked the PR and now the dirty flag is officially no more.
It's now replaced with a system of fluid reactions that can transform a liquid to another when certain criterias are met. For this pr, it's ground contamination.

@chaosvolt chaosvolt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the weird hack with dirty fuel types actually necessary? We'd have to specify dirty versions of every fuel in the game for this to make sense, which includes fuels not yet converted like ethanol since gasoline and turbine engines can use them.

In addition, got this error on trying to mop up some spilled mutagen into a container:

 DEBUG    : Failed to remove emptied liquid item from stack

 FUNCTION : use
 FILE     : D:\a\Cataclysm-BN\Cataclysm-BN\src\iuse_actor.cpp
 LINE     : 8641
 VERSION  : BN 535b6a7 (2026-08-03)

@shmakota

shmakota commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Just wanted to let you know I'm working on fixing this up so it's a bit better in regards to the above requested changes and upcoming fluid fields, so you can hold back on changes for now (might require me to open a separate PR though)

@YukariMindGap

YukariMindGap commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Is the weird hack with dirty fuel types actually necessary? We'd have to specify dirty versions of every fuel in the game for this to make sense, which includes fuels not yet converted like ethanol since gasoline and turbine engines can use them.

In addition, got this error on trying to mop up some spilled mutagen into a container:

 DEBUG    : Failed to remove emptied liquid item from stack

 FUNCTION : use
 FILE     : D:\a\Cataclysm-BN\Cataclysm-BN\src\iuse_actor.cpp
 LINE     : 8641
 VERSION  : BN 535b6a7 (2026-08-03)

Well, the alternative would be the old "dirty" flag that someone suggested to be removed. The implementation is too jank and weird so i replaced it with a fluid reaction system that you can extend with more than just ground contamination. Here is the quote from Wishduck:

I'm going to be completely honest. A magic filter which can filter anything, which mod authors could not block from filtering something is scrungly, merely because it is a large shift in balance without a way to say "this liquid cannot be used after being spilled.

We already have this in the form of "water" and "clean water." I could see certain liquids maybe getting a variable for a clean variant that they revert to

This was a suggestion from shmakota for a replacement of the dirty flag, which honestly makes more sense then the magic "Put dirty alpha mutagen in and get clean alpha mutagen out" filter.

This way cleaning is done via the crafting menu, as a recipe that takes the unclean itype and returns a clean itype. It doesn't break mod balance as mods have to opt into having a cleaning path.

It also allows for more expensive cleaning methods to be made. And above was

I don't think its reasonable from gameplay perspective to pour dirty gasoline into car, for instance, but it is reasonable to use it for something like a handmade weapon.

If we do it this way, it could become part of the ammotype used by handmade gasoline weapons, but not something engines which can use. Allowing for restrictions in our current systems without needing to add is_dirty checks to places.

For instance crafting, reloading, cloning, and I'm sure there are many others I cant think of would all need these checks, in comparison to this route.

Also Shmakota:

Just wanted to let you know I'm working on fixing this up so it's a bit better in regards to the above requested changes and upcoming fluid fields, so you can hold back on changes for now (might require me to open a separate PR though)

i've fixed what Chaosvolt requested and i think it's actually ready for merging. Please check this newly-updated PR and see if it needs improvement.

@chaosvolt

Copy link
Copy Markdown
Member

Shmakota said they were going to push some fixes and to hold off on tweaking it, bleh. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs PRs releated to docs page JSON related to game datas in JSON format. src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Items that allow "picking up" liquids on the floor

6 participants