Mods / Granary

Category: #Food #Other #Storage
Author: Pursec
Side: Both
Created: Jan 26th at 7:57 PM
Last modified: Feb 2nd at 5:44 AM
Downloads: 5100
Follow Unfollow 77

Latest file for Various v1.19.x:
Granary.zip 1-click install


This mod adds coal-style piles for Grain, Flour, Rot, and Salt all using the Piles! Library. It is a requirement to be installed

These piles all work in game just like coal or charcoal piles do, shift-right clicking with the items on the ground creates a pile of its type, piles grow and collapse just like coal do - one might even say they are exactly like them!

This mod is meant to serve as an example of the Piles! library.

if you want to create your own piles like these then have a look there and feel free to ask any questions, feedback is greatly appreciated too.


A note about perishable piles like grain and flour, these piles do rot like normal items and are subject to environmental temperature, such as cellars and winter slows their decay. When rotted they will still appear as the pile they were (ex: Flax pile) and interacting with them will yield rot (which can be made into its own pile) at roughly the correct conversion rate (testing showed variation but always hovering around the correct amount, occasionally more, occasionally less, but never a diff more than a couple). 

As flour and grain take quite long to rot and the conversion is plus or minus 1-3 rot than if left in an inventory normally, it should not be an issue gameplay wise and transitioning/perishable piles consistency is a WIP for the library.  

If you wish to support me do so at:
Ko-fi
Patreon

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.1 4552 Feb 2nd at 5:44 AM Show Granary.zip Install now
v1.0.0 548 Jan 26th at 8:05 PM Show Granary.zip Install now

27 Comments (oldest first | newest first)

💬 PursecAuthor, May 23rd at 4:53 PM

MrTango 

Been ultra busy irl with travel and working on A Culinary Artillery but its smth ive considered, hard to figure out a nice balance point to not make them just "better" than storage vessels outright, this is also actually why I started out only with Grains and Salt and Rot as they were the least problematic to design for as the grain perish time is super long already so it wouldnt be a constant issue/janky dealing with them rotting. I still need to come up with a system to perhaps dynamically swapping to a rot style pile and just dealing with transitioning items in these piles period. Ive learnt a lot more about Vintage Story's systems in general from working on ACA so when I finally get back to this ill have some major updates and improvements. One of my current thoughts rn is to add in a system for applying a small perish modifier to piles via an attribute in the json, so ultimately its configurable via patching and new/external piles can use their own values. I also want to double check the rates taking into account things such as being in a cellar to verify that it is working correctly, and perhaps having an additonal attribute to allow setting a custom modifier for that circumstance too. 

Ultimately though no promises on what timescale ill get to it, ACA is taking up most of my modding time atm. 

💬 MrTango, May 21st at 9:44 PM

Would be nice if the piled grain had similar decay rate as clay vessel (maybe with being in a cellar as a requirment to this rate?), that way piles would be equally as good as storing as items in vessels.

💬 Maltiez, Apr 16th at 10:10 AM

Would be nice to have pile for clay too (including clay from other mods)

💬 Auios, Mar 24th at 6:13 PM

Please add the verion in the file name

💬 PursecAuthor, Feb 12th at 9:34 AM

Maamessu nope! They should be fine together, only would run into issues if you have overlapping pileable items, but none of the piles in Granary are shared with those in Stonepiles. (in fact I tried to avoid overlapping bc I didnt want to try and compete or make their mod seem obsolete)

💬 Maamessu, Feb 12th at 7:12 AM

Out of curiosity, if I wanted to run the older Stonepiles mod alongside this plus your Piles! library... would things explode?

💬 DarkThoughts, Feb 5th at 10:33 AM

xCoiotex RTFM?

"A note about perishable piles like grain and flour, these piles do rot like normal items and are subject to environmental temperature, such as cellars and winter slows their decay."

💬 xCoiotex, Feb 3rd at 4:54 AM

yo this mod would be nice if it counted like a "cellar" but better for grains, dunno if it does that 

💬 PursecAuthor, Feb 3rd at 1:30 AM

bringitonwimps I can certainly do that going forward

💬 bringitonwimps, Feb 3rd at 1:01 AM

could you please add a version name to your files so i   can tell if my sertver is at newest version.  It's rewally hard to keep it updated.

mods great though, thanks

💬 PursecAuthor, Feb 2nd at 5:46 AM

New version uploaded along with a new version of the the library. Piles can now be placed unstable and adhere to gravity, piles now also render their falling sub-piles correctly due to improvements with the library. More details can be found in its changelog and the github.

💬 PursecAuthor, Jan 30th at 6:08 PM

Posted some WIP video showcases for the pile physics in the mod discord thread: here

Ive gotten the pile collapsing to be rendered properly, piles act like sand and other falling blocks - allowing them to drop and merge to other piles rather than breaking - aswell as placing piles free floating in air for dropping. This is all very WIP and all will be added to the library as features/options. I will likely include them to the piles in Granary to support ideas of top-loading granary constructions and to further showcase the pile physics as a feature

💬 Noobly20932, Jan 30th at 5:32 AM

What about compost, phosphate, lime, borax, and bonemeal? And other stuff like that?

💬 PursecAuthor, Jan 29th at 10:49 PM

@Marlim Pretty much! But this is a showcase for a library for adding piles in general, so you can make your own piles that are far more efficient if you so desire. (Also I love useless mods see: Fish Jenga)

💬 Marlim, Jan 29th at 5:25 PM

The premise of the mod is cool, I liked it, but it's useless, clay containers will do the trick.
It would be interesting if granaries were more efficient than buried clay containers.

💬 MimiKitty, Jan 28th at 11:20 PM

that gating feels pretty arbitrary and I would prefer something being more immersive and realistic vs balanced. it's not a competitive game. The way I think of it if it should be in the game (added as a mod to my game or not) is "Is this something I would do? is this something people in this time period/type of world would do?" if yes then I am ok with it. DarkThoughts

💬 DarkThoughts, Jan 28th at 11:29 AM

MimiKitty I'm not sure about the animal feeding because animal husbandry is obviously meant to be gated via the saw (or a lucky ruin find). Maybe if there's a way to balance this wih some hefty downsides.

💬 PursecAuthor, Jan 27th at 9:49 PM

Also a rough progress status update: Labels for bulk add and bulk remove, including the ability to specify custom labels for them are implemented locally. I have been trying out making piles exist properly with gravity (ie: Fall like sand instead of breaking) with quite a good bit of sucess, as it turns out Vanilla piles are already pretty much setup to work but have a check forcing them to break, and I pressume due to a quirk/bug related to pile collapses - where a pile would collapse, merge onto an existing pile, which then caused that pile to collapse, leaving a small pile on top of a not full pile (ex: [2] on top of [15] ..... [x] = pile size), visually shown as the small pile hovering in air due to the gap created by the now not full pile below. However I already have a fix in place locally (instead of trying to collapse the pile it merged onto, try and merge the topmost pile - I also do this for interacting with the pile or else a collapse could technically occur when pulled from the bottom most pile and cause the entire pile to fall or under vanilla break. Which while funny for falling blocks, can get frustrating quick). I am currently looking into making piles when their collapse occurs, visibly render the falling pile. This is a bit of a rabbit hole and confusing so im still struggling to figure out why those falling ones dont already render and what I need to do to make them. 

💬 PursecAuthor, Jan 27th at 9:31 PM

MimiKitty It would! I might add in a property for the library for stuff like "canBeWashedAway: true/false" and have it be as simple as lowering the quantity if outside/unroofed in rain. Have to figure out the rate of decay obviously still, but a great idea for a simple feature. As for Animal/Entity interaction im not sure yet how I would implement such, I would have to look into how the seekfoodandeat AITask behaves and how troughs/their blockEntity are set up to work along side as a food source. Conceptually though I dont think it is impossible. Will have to see if it would be smth to configure per Pile as an attribute (to be considered a food POI) or as something I can have be generic setup on all piles

💬 PursecAuthor, Jan 27th at 9:19 PM

Aksyl Its a really neat idea but im curious about how to implement it (as a possibility for piles as a whole not just flour specifically,ex: someone wanted a blasting powder pile too) in a non-annoying way. Def something I want to play with, I love the idea of using the wonderful Firearms mod by Maltiez and Rusty Shell by Lastelle (check them both out if you havent) and having a proper powder storage, but need to come up with the best way to keep them explosive but not overly volatile to the point that like a 2 blasting powder or 4 grain on the flour can detonate your barn or bung it up, and instead actually consider the volume of a entire "chunk" or "set" of piles in proximity or the size of the stack block itself, among also the flamability, how to handle it on fire, and how easy it should spread. Also things to consider like if its just a on-fire check or if it does a temp calculation/reference and that controls it. Just loads of design questions. Thank you for asking, its a great idea to ponder. 

💬 Aksyl, Jan 27th at 6:43 AM

Any thought towards adding powder explosions?

💬 MimiKitty, Jan 27th at 1:41 AM

would be interesting if these piles could be accessed by things in the game. you could create a hay pile in an animal pen and they will eat from it so you could visually see the amount of feed lowering. if rain hits them it will slowly lower the quantity as they wash away!

💬 PursecAuthor, Jan 26th at 9:57 PM

DarkThoughts the whole block placement is a vanilla behavior with creative mode so long as you are holding in the item slot more than the max stack size, the ctrl modifier does work, by default it should be 4 instead of 2. Also I am working the bulk display labels rn, vanilla piles lack them too I only just realized, also testing out allowing the pile blocks to fall rather than break when there is space below them

💬 DarkThoughts, Jan 26th at 9:38 PM

Pursec Hm, I could've sworn the ctrl modifier didn't work for me. But maybe that was because I was in creative mode, which also behaved a bit weirdly by placing a full block pile right away instead of a single layer.

💬 PursecAuthor, Jan 26th at 9:25 PM

@DarkThoughts Yeah most of that is due to just how Vanilla piles operate, and in fact I already have included a few fixes for bugs with vanilla piles - such as item duplication and the piles breaking when building, not completely eliminated but happens in less circumstances than vanilla). The ctrl modifier is actually implemented just lacking the tooltip showing it, ill get a fix up for that soon. I was planning on looking into the spoilage time display at the same time as further working on transitioning/perishable piles in general, the current state of them while functional feels a bit jank and does have an odd bug/behavior with the amount of an item created when the transition ratio is not a clean integer, and it would be neat if say piles could actively transition into a new pile of the right type (ex: flax-grain -> rot).  All the other ideas about funnel behavior and abilty to fall through open trapdoors or creation from a side face of a block are def stuff I want to experiment with. Ultimately a lot of the behavior stems from the limitations/scope of how vanilla piles are designed and the fact they are sort of on a backburner (The actual BlockEntityItemPile is even relegated to a Legacy folder on the github) as a whole for the team it looks like. All that being said I want to look into expanding past purely vanilla emulation + bug fixes for piles in general, but may be relegated to an opt-in param or exist as its own seperate mod entirely. Lots of things to consider and iterate on. 

💬 DarkThoughts, Jan 26th at 9:02 PM

I really like the idea and I love the idea of more physical storage in general, but I've noticed some issues, which are probably vanilla behavior but still.

First of all, it'd be nice to add the ctrl modifier to add / remove larger amounts, like with firewood, coal, etc. It would also be nice if the tooltip displayed the spoil time of a pile to get at least a rough estimate for how long it would last.

Anyway, I tried making a top fed granary with this, but there isn't really a way to place the grain in a way that feeds them to the bottom. You can't place them against a wall, you also can't use trapdoors for this as you can't actually place them on top of them (even when aligned with the surface) and even if you could they'd likely not drop when you switch it open. I also tried break the block beneath but that turns the grain back into the item form. The only way I could figure out was to have a block where you overstack them, causing the excess to slide down, but that leaves some grain on top of said block and I think this sometimes also causes some grain to pop off (I've seen this also happen with coal so that's definitely a vanilla issue too). You also cannot use hoppers, as they just drop the actual item out.

Another issue I found was that when I removed the grain from the bottom, it would just pull down the grain from that same block axis. All the surrounding piles (I used a 3x3 design with the access hatch in the middle) would not actually collapse towards the centerblock until I added more grain from the top (a floating block in the middle so they'd fall onto the sides), which caused a lot of grain to pop off into items and some out of the granary (might work better with full blocks and solid corners? I used slabs and no corners to get a sleeker design).

When you force grain onto a trapdoor by placing it aligned in the middle it sometimes catches the piles, but then as you add more it starts to constantly break them. Really weird behavior, but again, probably would also happen with coal.

Maybe you can communicate with the devs to improve this all a bit. Because it actually would be kinda cool to have little silos for all this stuff, even if they are not as efficient as trunks or crates.

💬 CKitt, Jan 26th at 8:54 PM

I didn't realize how much I loved the idea of this until you uploaded this mod! I'll be giving it a go for sure.

(edit comment delete)