Here's a relatively robust scenario for discussion and analysis.
Let's say our user wants to implement the following liquid-types in a game: water, oil, soap, poison-oil colloid (a oil liquid + a poison powder), paint.
The soap "breaks down" oil, which means (in this counter-realistic context) that it adds itself to an equal measure of oil, and magically transforms the two into water (without change of volume: 2 soap + 3 oil = 4 water + 1 oil).
Let's say that the paint is water-based, meaning that its solvent is the water, and it forms a homogeneous solution with water which does not (& cannot) separate into components. The soap is water-based also.
The poison-oil interacts with the water and with the soap the same as the oil does, for the purposes of mixing and separation, and for soap+oil "break down," etc. Filtering the poison-oil produces oil and poison powder. (The oil suspending the poison is the same as the other oil.)
Let's say the paint and soap are slightly poisonous, but the poison-oil is 100 times more poisonous.
The paint can be used to "paint" objects, but only if it's not too diluted. Also, the amount of paint needed to adequately cover an object remains constant for that object. So 2 measures of pure paint will paint my table, while 4 measures of an equal paint/water mix are needed to adequately cover my table with paint.
Although the paint is soluble by the water, it is denser than the water. (It weighs 12 pounds per gallon, and water weighs 8 pounds per gallon, say. 1/2 gallon water + 1/2 gallon paint weighs 10 pounds.)
The soap is the same density as water. The oils weigh 6 pounds per gallon.
The poison-oil colloid can be filtered to remove the poison particles. Also, the poison-oil colloid can be combined with an equal measure of soap, and transform the oil and soap into water. The poison particles are left over after this interaction, to sink or suspend depending on the surrounding liquid:
The poison particles will suspend in oil, or in a sufficiently dense paint mixture, say any paint/water ratio exceeding 1:1. Poison particles otherwise sediment, though they sediment slower in denser liquids. The combined weight and total volume of all the poison particles in the game are both negligible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, let's say that this is what we want. The "game messages" in this transcript are not necessarily in the desired format; I'm erring on the side of extreme clarity and description:
>x measuring cup
There are 2 measures of water, and floating on the water are 2 measure of poison-oil.
>put 1 measure of soap in cup
You put the soap in the cup.
It combines with some of the oil.
The result is 1 measure of poison-oil floating upon 3 measures of water.
Some of the poison powder is now mixed in with the water, and begins sedimenting on the bottom of the cup.
>x cup
There are 3 measures of water, and floating on the water is 1 measure of poison-oil. One quarter of the original poison powder is sedimented on the bottom of the cup. One quarter of the poison powder is still suspended in the water.
>z
Time passes...
The poison power suspension sediments completely.
>x cup
There are 3 measures of water, and floating on the water is 1 measure of poison-oil. Half of the original poison powder is sedimented on the bottom of the cup.
>stir cup
You mix the sedimented powder and oil and water, forming an emulsion/colloid.
>z.z.z
Time passes....
The poison powder seem to be recombining with the oil.
The oil gradually rises to the surface of the cup.
>x measuring cup
There are 2 measures of water, and floating on the water are 2 measure of poison-oil.
-------
So the poison powder needs to know how to suspend in water, and how to recombine with oil when it's mixed with an oil+water emulsion.
The soap needs to find oil in a mixture, and "break down" the oil as described previously.
The oil+water emulsion needs to know how to emulsify when mixed, and separate.
---------
The "pure liquid" solution would have a water+oil emulsion, a water+poison suspension, an oil+poison colloid, and a water+oil+poison emulsion/colloid. This would handle things reasonably.
The water+oil emulsion would gradually decrease its oil content as it created/increased the oil object on its surface.
The water+poison suspension would likewise gradually decrease its poison content as the poison sedimented.
The oil+poison colloid would handle like normal oil mostly.
The water+oil+poison emulsion/colloid would work like the water+oil suspension, but it would create/increase the oil+poison colloid on the surface as time passed, until it finally becomes pure water with the oil+poison colloid on the surface.
-----------
The component system for this is difficult for me to figure out, but I'll think about it some more....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Apparently, there needs to be a component for poison-powder, water, soap, and oil.
A chemistry op (mixer object) is needed for soap and oil. A separation mechanism (separation object? or daemon?) is needed to handle the separation of oil and water.
The chemistry op for oil+water will start the separation mechanism.
When the "stir" action moves the powder into the water/oil emulsion, the powder needs to recombine with the oil. Presumably the oil+powder chemistry op can handle this.
When we check if any given liquid instance is poisoned, we look for any component for which poison is true, and check its poison level, and its volume or amount. Some general handler will be in charge of this computation, perhaps Liquid or perhaps some mixture manager. (Note that whenever a new property is introduced by the user, he will need to modify Liquid or the manager so that the proper handling of the property can be carried out for all possible types of mixtures.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's a relatively robust scenario for discussion and analysis.
Let's say our user wants to implement the following liquid-types in a game: water, oil, soap, poison-oil colloid (a oil liquid + a poison powder), paint.
The soap "breaks down" oil, which means (in this counter-realistic context) that it adds itself to an equal measure of oil, and magically transforms the two into water (without change of volume: 2 soap + 3 oil = 4 water + 1 oil).
Let's say that the paint is water-based, meaning that its solvent is the water, and it forms a homogeneous solution with water which does not (& cannot) separate into components. The soap is water-based also.
The poison-oil interacts with the water and with the soap the same as the oil does, for the purposes of mixing and separation, and for soap+oil "break down," etc. Filtering the poison-oil produces oil and poison powder. (The oil suspending the poison is the same as the other oil.)
Let's say the paint and soap are slightly poisonous, but the poison-oil is 100 times more poisonous.
The paint can be used to "paint" objects, but only if it's not too diluted. Also, the amount of paint needed to adequately cover an object remains constant for that object. So 2 measures of pure paint will paint my table, while 4 measures of an equal paint/water mix are needed to adequately cover my table with paint.
Although the paint is soluble by the water, it is denser than the water. (It weighs 12 pounds per gallon, and water weighs 8 pounds per gallon, say. 1/2 gallon water + 1/2 gallon paint weighs 10 pounds.)
The soap is the same density as water. The oils weigh 6 pounds per gallon.
The poison-oil colloid can be filtered to remove the poison particles. Also, the poison-oil colloid can be combined with an equal measure of soap, and transform the oil and soap into water. The poison particles are left over after this interaction, to sink or suspend depending on the surrounding liquid:
The poison particles will suspend in oil, or in a sufficiently dense paint mixture, say any paint/water ratio exceeding 1:1. Poison particles otherwise sediment, though they sediment slower in denser liquids. The combined weight and total volume of all the poison particles in the game are both negligible.
Okay, let's say that this is what we want. The "game messages" in this transcript are not necessarily in the desired format; I'm erring on the side of extreme clarity and description:
>x measuring cup
There are 2 measures of water, and floating on the water are 2 measure of poison-oil.
>put 1 measure of soap in cup
You put the soap in the cup.
It combines with some of the oil.
The result is 1 measure of poison-oil floating upon 3 measures of water.
Some of the poison powder is now mixed in with the water, and begins sedimenting on the bottom of the cup.
>x cup
There are 3 measures of water, and floating on the water is 1 measure of poison-oil. One quarter of the original poison powder is sedimented on the bottom of the cup. One quarter of the poison powder is still suspended in the water.
>z
Time passes...
The poison power suspension sediments completely.
>x cup
There are 3 measures of water, and floating on the water is 1 measure of poison-oil. Half of the original poison powder is sedimented on the bottom of the cup.
>stir cup
You mix the sedimented powder and oil and water, forming an emulsion/colloid.
>z.z.z
Time passes....
The poison powder seem to be recombining with the oil.
The oil gradually rises to the surface of the cup.
>x measuring cup
There are 2 measures of water, and floating on the water are 2 measure of poison-oil.
-------
So the poison powder needs to know how to suspend in water, and how to recombine with oil when it's mixed with an oil+water emulsion.
The soap needs to find oil in a mixture, and "break down" the oil as described previously.
The oil+water emulsion needs to know how to emulsify when mixed, and separate.
---------
The "pure liquid" solution would have a water+oil emulsion, a water+poison suspension, an oil+poison colloid, and a water+oil+poison emulsion/colloid. This would handle things reasonably.
The water+oil emulsion would gradually decrease its oil content as it created/increased the oil object on its surface.
The water+poison suspension would likewise gradually decrease its poison content as the poison sedimented.
The oil+poison colloid would handle like normal oil mostly.
The water+oil+poison emulsion/colloid would work like the water+oil suspension, but it would create/increase the oil+poison colloid on the surface as time passed, until it finally becomes pure water with the oil+poison colloid on the surface.
-----------
The component system for this is difficult for me to figure out, but I'll think about it some more....
Apparently, there needs to be a component for poison-powder, water, soap, and oil.
A chemistry op (mixer object) is needed for soap and oil. A separation mechanism (separation object? or daemon?) is needed to handle the separation of oil and water.
The chemistry op for oil+water will start the separation mechanism.
When the "stir" action moves the powder into the water/oil emulsion, the powder needs to recombine with the oil. Presumably the oil+powder chemistry op can handle this.
When we check if any given liquid instance is poisoned, we look for any component for which poison is true, and check its poison level, and its volume or amount. Some general handler will be in charge of this computation, perhaps Liquid or perhaps some mixture manager. (Note that whenever a new property is introduced by the user, he will need to modify Liquid or the manager so that the proper handling of the property can be carried out for all possible types of mixtures.