Page 1 of 1
How to add a mineable fluid resource that only spawns one entity per patch?
Posted: Tue Sep 16, 2025 2:19 pm
by Zeritor
After reading through all the prototypes around resources and map gen settings/autoplace settings, I can't see a way to make it only spawn one of the entity.
I want a fixed yield, with a fixed size and just one to appear anywhere the resource is "rolled". I can't see an easy way to do this. Is it to with the noise generation? Do I need a basically black/white noise distributed to roughly what I'm after?
Re: How to add a mineable fluid resource that only spawns one entity per patch?
Posted: Tue Sep 16, 2025 3:07 pm
by robot256
I don't remember exactly how it's done, but Krastorio does this for Immersite deposits. You could check the source code there for reference.
Re: How to add a mineable fluid resource that only spawns one entity per patch?
Posted: Tue Sep 16, 2025 4:55 pm
by Zeritor
I was trying to think of all the mods that did this and rememebered some from my K2SE playthrough, then ruled it out as SE isn't 2.0 yet... Totally forgetting Immersite is from K2. Thank you, I will do just that.
Re: How to add a mineable fluid resource that only spawns one entity per patch?
Posted: Fri Sep 19, 2025 12:41 pm
by Natha
Also pyrawores does that with e.g. aluminium rock. It's basically a very low spawning probability
Re: How to add a mineable fluid resource that only spawns one entity per patch?
Posted: Fri Sep 19, 2025 8:41 pm
by meifray
In vanilla, we use EntityPrototype.map_generator_bounding_box to indirectly limit how much it can be created in a patch.