Not logged inOpenClonk Forum
Up Topic Liquid container branch

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Marky
I got the liquid items to work, but in my opinion they are a step back. Liquid containers now contain a liquid object (water, oil, laval acid, fuel, as well as a generic renamable liquid). This liquid can enter liquid containers only, and disperses when not inside a liquid container for 1 frame. Dispersion means: The object gets removed, it can spray material pixels or particles equivalent to the liquid amount, though.
This has advantages and drawbacks though:
+ liquid objects are one object, similar to a "stackable" object
+ the barrel does not need an implementation for emptying, it just ejects the liquid object which then sprays its contents
+ the steam engine can contain "fuel" now, displays the amount of fuel as contained liquid object "fuel"
- the code of the liquid container is not as intuitive anymore, because it has to contain code for handling a liquid object, instead of handling liquid type and volume: The liquid object contains that information, and the container has to save that object and delegates calls to that object. However, the logic for creating new objects and partially transferring liquid from one liquid object to the container is convoluted, even though I tried to keep it as straight forward as possible
- the producer library does not benefit from the liquid objects: a liquid container can have only one type of liquid, so you have several options: a) allow several liquids in a producer (one could limit this, but why would you put 100x water and 50x lava in a bakery for example. This is the same as putting water or lava barrels into it), b) allow one type of liquid per producer only (which seriously limits producers that produce objects that rely on multiple liquids, such as oil and/or water)
- the producer library does not benefit from the liquid objects: only the steam engine can have a pipe connection at the moment.
- the producer library does not benefit from the liquid objects: it has to distinguish between liquid containers ("IsLiquidContainer" - barrels, can partially remove liquid from it), "real" liquid objects ("IsLiquid" - water, liquid can be partially removed), and "pseudo" liquid objects ("IsLiquid" - ice, does not really contain liquid and gets removed entirely)

Would be nice to get some feedback on this. The latest version is available on my fork, branch "liquid_container"

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill