Bay 12 Games Forum

Dwarf Fortress => DF Suggestions => Topic started by: NW_Kohaku on July 11, 2010, 10:37:52 am

Title: Volume and Mass
Post by: NW_Kohaku on July 11, 2010, 10:37:52 am
On Eternal Suggestion Voting (http://www.bay12forums.com/smf/eternal_voting.php#vote260).

This is one of those ideas that I recognize is a very big change that could break a few systems, and probably saves.  Nevertheless, I think that, in a game that wants to tout its realism, this would be a very good way of making a major leap towards that goal.

People frequently make fun of how we currently deal with items in small integer units - one malachite smelts to one copper crafts into one earring or a pair of low boots or other metal object. One wood makes one bed or barrel or bracelet.  One stone can make a door or a table or an entire workshop or a couple stone mugs.

There have been several suggestions that are intermediate solutions, but I think that what we really need is to simply go the whole distance, and make the realistic answer - a real system of volume and mass.  (Also, by extension, density.  In fact, I would expect density to be the prime number recorded for each material, and have individual materials requirements call for either volume or mass - so that wooden furniture calls for a certain volume of wood, regardless of the density of the wood, while others, like charcoal, may call for a certain mass of wood.)

This means that we do not deal with whole units of wood, but rather with X number of kilograms of wood.  It takes 10 kgs of wood to make 4 kgs of charcoal.  It takes one cubic meter of wood to make a desk (still abstracted to just volume alone.) This would mean that a copper earring, at only .1 kg of mass, would only use up .1 kg of copper (possibly more, if you want to include waste and a sort of entropic decay of matter), while a 6 kg helmet takes up 6 kg of copper.

This also has some major stacking ramifications - you can make it so that when you dump 12 kg of iron onto a pile of 38 kg of iron, it creates a single 50 kg iron pile. 

Even better, you can start making items from more than one material - a pick or a spear, for example, is currently entirely made of metal.  Now, you could make picks with a wooden handle (that only takes a small fraction of the wood you get from chopping down a tree), and make only the pick itself from metal.

Now, when we are talking about volumes, however, we can finally start addressing the volume of a single cubic tile.  I would estimate that a single cubic tile is 10' tall, since that is the distance between floors of a standard building for us humans.  Dwarves may make them shorter theoretically, but when we are dealing with stone caves, a little extra ceiling room for buttressing may be a good idea.  Since everything in the game seems to presume we are dealing with cubes, that would make it a 10' x 10' x 10' cube, for 1000 cubic feet.  If, however, we are going with metric, that is fairly close to 3m x 3m x 3m for 27 cubic meters of volume to fill.

This can also have other ramifications - currently, mining has recieved complaints because you essentially just hit a wall with a pick to vaporize a wall, possibly leaving behind a single stone.  Now, however, we could simply use that to fracture a wall, and leave behind 27 cubic meters of mullock/rubble material that needs to be hauled off, or, if the mining check was successful, would leave behind X amount of usable stone, and some leftover cubic meters of rubble/mullock.

This would also mean that once any tile hits 27 cubic meters of material, it would become impassible.  (Something like 20 cubic meters of material might also just become a ramp.)  For the purposes of pathing, it might be OK to let creatures push aside loose material that blocks their path, but basically, there has to be enough empty volume in a tile for a creature to move through it.

This could also mean that, instead of leaving exactly one random item in a stockpile, you could actually start stacking those items, like in a warehouse, potentially to the point where you might create "walls" of material, and have stairs climbing up on top of the stored materials in your warehouse.

This could potentially be combined with other suggestions, like the sand suggestion (http://www.bay12forums.com/smf/index.php?topic=58397.0), and even the fluid models - rather than a 0-7 level of fluid, we would have 0-27 cubic meters (1 cubic meter = 1,000 liters, by the way) of fluid.  This fluid, rather than flowing in random directions, could simply divide its flow out evenly across all adjacent tiles with a lower total fluid level than itself.  Solid objects, of course, would be capable of displacing fluids (provided it was not melting into magma, in which case, it should probably increase the total volume of magma when it melts, as well), so a 5 cubic meter stone would mean there were 5 less cubic meters of space for a fluid to occupy.

Finally, as if there wasn't enough to tie all this into, this could finally be used to create that realistic cave-in system that the game has been lacking, making it the butt of several jokes, such as the "support an entire fortress on a single pillar made of soap" joke.  Although it would take much more work than simply implimenting the overall mass and volume suggestion, one can create a system where every non-wall tile that has a floor or wall above it must have a ceiling above it to bear the weight of the tiles above (presumably, this may include some smaller supports, if need be), with the mass of the areas above requiring enough supporting material below to avoid a sort of warning "sagging" or an outright cave-in.  When a floor is supported off of a wall, that wall must be able to bear the mass of the floors, plus all the walls (and the mass it supports above it), or will start to fail.  Walls should theoretically be able to pass their burden diagonally downward, so as to mean that simply building thicker walls eventually solves the problem.

This will probably require some form of interface change to be able to enable such a system.  A seperate look-menu option on walls or the like could give tile-specific information, but it would probably be best to have a special view mode where the colors were changed so that you could see the amount of stress each part of the overall structure was bearing.  (So that walls and floors would turn colors from dark blue to bright red to show the amount of stress they are bearing.)

To combat this, we could start getting into serious engineering solutions to the problems of cave-ins, from simply digging narrow tunnels that do not stack multiple floors overtop one another, to the classical masonry solutions of simply making thicker walls near the base of structures, growing narrower at the top (possibly using flying buttresses or the like, if it were a free-standing stone structure), to using more presumably modern (but still theoretically technologically available for creatures of that scientific era) concrete with steel rebar supports to buttress very large structures.  This would require a reworking of the way that dwarves are able to address constructions or the like, as they would need a way to create "supports" that are not actually built structures that take up a tile, but simply slapped on as an addition to a wall.

Again, I recognize these suggestions, especially some of the last parts, are fairly massive, but I think that for the long-term life of DF, a full volume and mass system would help to solve quite a few of the niggling inaccuracies of the game.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 11, 2010, 12:29:23 pm
Something to add on:

A link back to an older thread relevant to the subject at hand (http://www.bay12forums.com/smf/index.php?topic=6323.msg77802#msg77802).

That thread details ways in which trees could grow beyond their current mere sapling level.  In conjunction with mass and volume, we could have a much more serious set of trees, and eventually the ability to make the kind of trees that would be required for an elven tree city.

Basically, trees would grow out to certain ratios that are raw-defined for them. "Trees" like saguaro should probably have a finite growth limit, but generally, rain-forest trees should be able to grow very, very tall, if not terribly wide.

When we are dealing with 3m x 3m x 3m cubes, it should be a rare and giant tree that actually has a greater than 3m diameter, but trees that are taller than a single story should be extremely common.

Trees should be able to grow a certain amount every year or at the changing of seasons, based upon a recorded amount of rainfall during the previous year, and possibly soil conditions adding a contributing factor.  (Elves, for example, might be able to encourage tree growth.)  And this would make trees gradually increase in volume as it grows, eventually (based upon the ratio of height to width that it grows at, defined in each tree's raw entry) making it migrate upwards into higher cubes, and possibly also developing larger root systems.

When larger trees are chopped down, rather than providing a single unit of wood, they would provide an amount of wood based upon their actual size - a certain amount of wood is lost as simply being turned into a stump in the ground, but the rest would be a percentage-based amount of reclaimable wood from a felling.  This could depend upon the skill of the woodcutter, so that it could be something between 60% and 80% of the tree's volume and mass would be actual wood, the rest becoming rottable biological waste.

Since larger trees would be felled to produce more wood than would likely fit into a single tile, they would also probably be felled like real trees - falling over into nearby tiles, and potentially injuring careless nearby dwarves.  Theoretically, this should not be as dangerous as a cave-in, where it involves death, but hey, it could be more Fun, and more reason for doctors.
Title: Re: Volume and Mass
Post by: thijser on July 11, 2010, 02:28:25 pm
I do agree that this is a good idea however there are 3 issues:
1 we will probably end up with large amout of clutter from fractions of materials.  This can however be overcome.
2 fps: the new cavein system would case a lot of trouble for the calculations and having detailt amouts of every matrial would add a lot of thing to keep track of, megaprojects already have trouble with the 100 000's of stone laying around.
3 toady time, it's a limitit supply
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 11, 2010, 02:45:55 pm
I do agree that this is a good idea however there are 3 issues:
1 we will probably end up with large amout of clutter from fractions of materials.  This can however be overcome.
2 fps: the new cavein system would case a lot of trouble for the calculations and having detailt amouts of every matrial would add a lot of thing to keep track of, megaprojects already have trouble with the 100 000's of stone laying around.
3 toady time, it's a limitit supply

1. There is already a system for placing items with like items in stockpiles, with dwarves willing to go 20 spaces by default (init editable) further to place those items.  By making stacks of the same type of fungible materials simply merge stacks, up to the volume limit of a material in a space, it would reduce this problem for the most part, excepting perhaps some scraps of very rare materials.

2. The cavein system would, indeed, introduce new checks at regular intervals.  I would say, however, that unlike the current fluid system, or something like pathfinding, where those checks have to occur whenever they are called upon, a weight distribution system does not need to be quite so frequently called, unless we are dealing with something specific, like removing a supporting wall to cause a cave-in.  We could run the check every X number frames, and even then, allow certain parts of the system to be temporarily overburdened, only actually collapsing if the weight stays beyond the maximum capacity two or more checks in a row (which would also let you have a chance to get warning messages of sagging floors.)

If the system of using fluids in the method of having a specific volume that flows outward were to also be abstracted, it could potentially also save FPS, as the current fluid modeling system is a fairly significant weight on the engine, as well.  To do this, however, we would probably also need an "air bubble" modelling system, however.  I guess I'll just rez that other thread for that.

3.  Well, yes, everything takes up time, and this would certainly take up quite a large share of it.  Still, this one would probably be worth it in the long-term, as Toady seems to want a better cave-in system eventually, and this would potentially solve the problems of the entirely low-integer heavy economy we have right now.
Title: Re: Volume and Mass
Post by: Jiri Petru on July 11, 2010, 05:11:21 pm
I strongly disagree!

This would basically make a game that already has almost unbearable level of micromanagement into a game that is a micromanagement hell. Me no like.

Dwarf Fortress (fortress mode) might be a simulation, but it's also a game and a game needs some simplification. Having everything counted in nondescript units where each job consumes a single unit is a good thing! Easy to handle, easy to remember. A few exceptions (chain mail, breastplate) are still acceptable. But once every job requires a different amount of "units", then in all becomes too confusing.

The stocks screen would become next to useless. Now when I have 30 units of cloth, I know I can produce 30 socks or 30 caps or 30 tunics or whatever. If I had 30 metres of cloth, what would that mean? Could I produce 67 socks or 43 caps or 12 tunics or what? I really wouldn't like that! That's making things more complicated... a lot more complicated... for no gain. What of it?  If you really dislike how certain items consume too much material, just let 1 unit of cloth produce 3 socks at the same time, but not the other way around (1 sock consuming 0.33 cloth)!!! Each job consuming 1 unit of material is a rare occasion where DF is streamlined and unified, and I'd love to keep that.

These were just my loud two pences, because I felt you need someone sceptical here  :P But please continue, I won't interrupt no more.

Title: Re: Volume and Mass
Post by: NW_Kohaku on July 11, 2010, 05:19:34 pm
I strongly disagree!

This would basically make a game that already has almost unbearable level of micromanagement into a game that is a micromanagement hell. Me no like.

Dwarf Fortress (fortress mode) might be a simulation, but it's also a game and a game needs some simplification. Having everything counted in nondescript units where each job consumes a single unit is a good thing! Easy to handle, easy to remember. A few exceptions (chain mail, breastplate) are still acceptable. But once every job requires a different amount of "units", then in all becomes too confusing.

The stocks screen would become next to useless. Now when I have 30 units of cloth, I know I can produce 30 socks or 30 caps or 30 tunics or whatever. If I had 30 metres of cloth, what would that mean? Could I produce 67 socks or 43 caps or 12 tunics or what? I really wouldn't like that! That's making things more complicated... a lot more complicated... for no gain. What of it?  If you really dislike how certain items consume too much material, just let 1 unit of cloth produce 3 socks at the same time, but not the other way around (1 sock consuming 0.33 cloth)!!! Each job consuming 1 unit of material is a rare occasion where DF is streamlined and unified, and I'd love to keep that.

These were just my loud two pences, because I felt you need someone sceptical here  :P But please continue, I won't interrupt no more.

Umm... what?

How would this alter micromanagement in particular? 

I don't know about you, but I tend to view my wood stockpiles in the following fashion: "Is it empty?" (set more people to chop wood) and/or "Is it completely full?" (make sure wood-using jobs are still queued), that's all.

Also, in case you didn't notice, the game already measures thread in the scale of thousands for what it takes to make a single cloth item.  It doesn't particularly mean anything other than that you need several thousand thread to make a single cloth item.
Title: Re: Volume and Mass
Post by: Tehran on July 11, 2010, 11:02:17 pm
Ah hah! You're wrong on one count. We're not dealing with perfect cubes in Dwarf Fortress - the tiles must be slightly taller - and if you look closely at some of the 3D visualizers, that is how it's done. The dwarves need a floor to walk on from level to level, after all.
So I'd say that we're dealing with 1 or 2 feet of floor, which would make each tile something like 10x10x12 feet.

As for your actual suggestion --- I dunno. If we really had a system like that, it would be amazing. But I fear that too much of the game has been programmed already to backtrack and make these changes.

Also, have you ever noticed that the framerate slows as you mine out more and more rocks? I don't understand that at all, (Do you know why that is?) but I'm worried that the same FPS-killing thing would happen if every single item has its own unique variables of mass, volume, and density.

I think that some of your ideas can be used in the game, though. And some of them already have, sort of.
I haven't played the 2010 version, but aren't cloth and bars now broken up into much smaller numbers? (500 bars in .31 = 1 bar in 40d, right?)

If this same thing - smaller units - could be used for things like wood, trees, stone, jems, etc... I think that would be great... A compromise of sorts between the current system, and the one you propose with fully-fledged volume, mass, and density.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 12, 2010, 08:52:05 am
Ah hah! You're wrong on one count. We're not dealing with perfect cubes in Dwarf Fortress - the tiles must be slightly taller - and if you look closely at some of the 3D visualizers, that is how it's done. The dwarves need a floor to walk on from level to level, after all.
So I'd say that we're dealing with 1 or 2 feet of floor, which would make each tile something like 10x10x12 feet.

Actually, it's 10 feet with the floor, 8 feet without the floor.

Of course, current DF has floors that are 2-dimensional, as the same amount of water can be held in a floorless cube as a cube with a floor (or whether there is a ceiling above or not).

edit: Specifically, in real-life buildings the standard is to have an 8' ceiling, with 2' of space between floors as insulation, support, etc.  Like I said earlier, dwarves are shorter, but would likely need more ceiling support since they live in caves, so it would probably be 3' of space.  As an added bonus, 10' cubes (or 3 meter cubes) are just plain nice to have as round numbers, and go much better with the nature of how DF calculates distance, where any pathing seems to take exactly the same amount of distance, regardless of direction travelled (horizontal or vertical), which heavily implies both that dwarves have very powerful legs that allow them to traverse up steep slopes or stairwells as if they were flat ground, and that vertical tile distances are equal to horizontal tile distances.

As for your actual suggestion --- I dunno. If we really had a system like that, it would be amazing. But I fear that too much of the game has been programmed already to backtrack and make these changes.

It would be a major change, but not so major as to be impossible.  All materials already have density, and all objects already have a pre-set volume, so that the mass of every object can be displayed.  The change to having the game track objects in terms of mass or volume instead of arbitrary units would not be the terribly huge overhaul you might think it would be.  The big change would be the actually defining tiles to hold a certain volume.

Also, have you ever noticed that the framerate slows as you mine out more and more rocks? I don't understand that at all, (Do you know why that is?) but I'm worried that the same FPS-killing thing would happen if every single item has its own unique variables of mass, volume, and density.

The thing is, stacks of items do not actually alter framerate the way that individual items do:  25 individual crossbow bolts lying on the ground are 25 seperate objects.  A stack of 25 crossbow bolts is 1 item which has a tag that says "there are 25 of this object here".

I think that some of your ideas can be used in the game, though. And some of them already have, sort of.
I haven't played the 2010 version, but aren't cloth and bars now broken up into much smaller numbers? (500 bars in .31 = 1 bar in 40d, right?)

If this same thing - smaller units - could be used for things like wood, trees, stone, jems, etc... I think that would be great... A compromise of sorts between the current system, and the one you propose with fully-fledged volume, mass, and density.

Thing is, I see the compromises as just little nudges in the direction that this suggestion is, which shows that at some level, Toady does want this sort of thing, but where tiny nudges are simply a longer, more painful process of changing one minor thing at a time rather than just gritting your teeth and ripping off the band-aid.



EDIT: Oh, and specifically, the 0.31.x version has had all units of mass be reworked into kilograms.  That is why I am focusing on the metric system - kilograms are already a visible unit of measure in the game, we already have density as an intrinsic part of materials, and we have arbitrarily defined, hardcoded volume for objects, although it is not directly displayed. 

Like I said, the most basic step of this process has already been undertaken.  It is simply a matter of pushing it to its logical conclusion - defining the volume of a tile, as we have already defined the mass, density, and volume of most objects in the game.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 12, 2010, 11:41:13 am
Hmm... as an aside, I'm playing around with calculations... humans are supposed to have an average density of about the same as water, which is basically set so that 1kg of water takes up 1 liter of space.  1,000 liters is 1 cubic meter.  Hence, an "average" human of 70 kilos takes up .07 cubic meters of volume.  (Maybe we should be using liters instead of cubic meters, cubic meters are, it turns out, fairly large units.) 

Now, keeping in mind that we have 27 cubic meters of volume in a tile, I wanted to see how large a dragon was...  The average human is rated at having a size of 70,000 units in this game.  Since I was figuring that humans would be about 70 liters, apparently, the apparently unitless measure of size in the raws apparently matches up quite well with milliliters.  Who'da thunk?  Toady must be more into this than I thought.  Now, a dragon, meanwhile, has a size of 25,000,000, which simply reduces to 25 cubic meters.  That's just 2 cubic meters less than the maximum volume of a cubic tile, as I am figuring it, meaning that hypothetically, a dragon can occupy the space of a single tile... provided it scrapes the ceiling, and smashes through any furniture or stockpiles in its way... which granted, does sound like the sort of thing rampaging dragons really SHOULD do.



Edit: MORE playing around with numbers:

OK, for the purposes of making these nice, easy to round numbers, I've basically been going off the assumption of either 10' or 3 meters interchangably.  The actual conversion comes out to 10' = 3.048 m exactly, but for the purposes of making it a nice round number, I'm just saying 3 m.  (There would be no loss of precision if everything in DF were started calculating from metric to begin with, anyway, it's just for the purposes of comparison.)

Now, I've been going over home sizes.  Remember, the basis of my calculation is that this is a cube, and that the size of a side is equal to the average story/floor hight.  Therefore, every 100 square feet of floorspace in a building is the same 1000 cubic feet (not counting ceiling space) we would be talking about as a single cube (although walls would likely not be 10' thick...)

Apparenty, the average US home size has gone from roughly 1500 in the 1970s to about 2000 today.  That means that average modern American homes would be roughly 20 tiles of open space given the metric I am currently using.
Title: Re: Volume and Mass
Post by: marcusbjol on July 13, 2010, 12:55:16 am
This is a great idea.

Out of a cow hide, I was able to make:
Leggings,
Arms,
Gauntlets
Lameller armor
Kidney belt

It should not take me 6 cows for this. 

The problem with implementing this with the current systems is the Volume is explicitly undefined.  Dragons and Butterflys are the same size.

Yes, adding this in will create more complexity, but good UI design (something we do not have now) can mitigate this (as in when ordering up copper crossbows, the UI can tell you the max)

Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 10:30:47 am
A bit of a change of tone with the edit, hmm?  :P

Ah well, the wiki page on weight (http://df.magmawiki.com/index.php/DF2010:Weight) shows that there is at least some rudimentary attempts at de facto volume, although it is largely related to the simple thickness of a piece of armor.

Given the bug reports that page links to, these aren't particularly well ironed-out as of yet, like the material stats for various metals were largely dummied out, however.

I could probably go back into the raws, and figure exactly what volumes this implies, but I'll do that a little later.
Title: Re: Volume and Mass
Post by: marcusbjol on July 13, 2010, 11:52:14 am
Yeah.. my personal rants probably shouldnt be posted. :)

One of my biggest frustrations is that I cannot make an opening to my fort that is big enough for a dwarf, but too small for a dragon.  These volumes will need to account for things that are bigger than one space.
Title: Re: Volume and Mass
Post by: G-Flex on July 13, 2010, 11:55:39 am
Ah hah! You're wrong on one count. We're not dealing with perfect cubes in Dwarf Fortress - the tiles must be slightly taller - and if you look closely at some of the 3D visualizers, that is how it's done. The dwarves need a floor to walk on from level to level, after all.

Floors in DF are currently treated as infinitesimal. Otherwise, less water would be necessary to fill a given cube.

It's also provable that they're cubic given that distance calculations treat all dimensions equally.

So no.


[pre-emptive edit]
Well, the bit about water was already said, but distance calculations show it to be the case as well.
Title: Re: Volume and Mass
Post by: Hammurabi on July 13, 2010, 11:57:41 am
Sure it makes DF a bit more realistic.  But does it improve the game in any other way?  Does it make it more fun?

Such a change would touch just about every aspect of the game, potentially causing bugs in every aspect of the game.  It would also take up a huge portion of Toady's time, which could be spent on better things.  Maybe introduce this in v2.0 
Title: Re: Volume and Mass
Post by: Sfon on July 13, 2010, 11:59:21 am
On Eternal Suggestion Voting (http://www.bay12forums.com/smf/eternal_voting.php#vote248).
Dwarves may make them shorter theoretically, but when we are dealing with stone caves, a little extra ceiling room for buttressing may be a good idea.
Dwarves are not the only ones who matter, anyway. Gotta account for human and other structures.

That's just 2 cubic meters less than the maximum volume of a cubic tile, as I am figuring it, meaning that hypothetically, a dragon can occupy the space of a single tile... provided it scrapes the ceiling
Or it could duck its head down a bit. Anyway, sounds perfect.

Of course tile size won't jive with walking time in fortress mode, but I don't think there is a solution for this. Fortress mode relies on a somewhat disassociated time-distance relationship. Just stating this before someone comes in stating how your system doesn't work because of this. No system can work taking time-distance into account without massive changes to how time flows in fortress mode, it is impossible so no point sweating over it.
Title: Re: Volume and Mass
Post by: G-Flex on July 13, 2010, 12:00:59 pm
Sure it makes DF a bit more realistic.  But does it improve the game in any other way?  Does it make it more fun?

Such a change would touch just about every aspect of the game, potentially causing bugs in every aspect of the game.  It would also take up a huge portion of Toady's time, which could be spent on better things.  Maybe introduce this in v2.0

Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 12:12:37 pm
It could certainly improve many aspects of the game. It would finally be possible to have, say, workshop operations that are precise at all. Right now that's all kind of screwy and very very low-precision.

To give a better example of this (other than the "it takes a whole cow to make one set of leather gloves" thing), consider that I want to make a pottery mod.  If I want to make ceramic jars in this game, it would run into a problem: people would wonder why they should use ceramics instead of wooden barrels.  A wooden barrel takes one wood.  Meanwhile, a piece of charcoal to fire the ceramics kiln takes one wood.  Then I'd have to get that ceramic glazed, which is actually a process something like glass, which means I'd have to use an entire unit of sand, equivalent to the making of a glass item.

Likewise, a copper earring takes the same amount of material as a pair of copper boots.  A stone earring takes the same amount of material as a stone door and a floor and the entire wall.  In fact, as came up in the thread about building walls over floors, the floor takes up as much stone as building the floor and the wall that stands on top of it, meaning building a wall over a floor would be taking two stone, while just building the wall would take one stone.
Title: Re: Volume and Mass
Post by: G-Flex on July 13, 2010, 12:29:37 pm
Currently, it would also be impossible to have furnaces require less than one wall unit of coal per production task, unless you have the coal->coke reaction produce more than one bar of coke... in other words, more than one wall's worth.
Title: Re: Volume and Mass
Post by: Hammurabi on July 13, 2010, 12:30:18 pm
  • I don't think you understand the complexity of the game as stated to be necessary for the game to reach 1.0 status.
  • It could certainly improve many aspects of the game. It would finally be possible to have, say, workshop operations that are precise at all. Right now that's all kind of screwy and very very low-precision.

A.  I fully understand the amount if work needed to get to v1.0.  It's probably somewhere around 20 man-years left.

B.  As soon as workshops are fully in the raws, there are better solutions.  Make a cow produce 20 units of leather, a pig 8 units of leather.  A leather glove might take one unit of leather, while a leather chest armor takes six.  For items that need less than "one unit", make multiples like mugs already do.  One block of stone gets crafted into 12 stone earrings, etc.

Currently, it would also be impossible to have furnaces require less than one wall unit of coal per production task, unless you have the coal->coke reaction produce more than one bar of coke... in other words, more than one wall's worth.

Make a new task in a workshop that turns "one coal" into "20 coal bricks".  Then each forge task can use some number of coal bricks.

Title: Re: Volume and Mass
Post by: G-Flex on July 13, 2010, 12:33:14 pm
That doesn't solve the other issues mentioned.


Also, I wasn't talking about the amount of work. I was talking about the complexity of the game.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 12:38:33 pm
When looking over this idea, though, it starts to really dawn on me just how friggin' huge a 3m cube really is.

Consider a dwarven bedroom.  Again, a 3m cube is roughly 100 sq. feet of floorspace.  100 square feet is enough space for a pretty decent bedroom.  Not luxurious, but enough for a bed, a chest, and a cabinet, at least.  A 5' by 5' area is just barely enough for a full-sized bed.  It occupies just a quarter of the tile, but would preclude the placement of anything else in a tile, while the piece of furniture that contains the dwarf's clothing would likewise probably be closer to occupying about 10 square feet than 100, although it would occupy a full tile, as well.  The modest, 3 tile bedrooms (not even counting the 100 sq ft for the door) would be 300 square foot rooms, which should be quite luxurious.  That's not even touching how palacial a noble's room would become.

Hallways are 10 feet wide, as well.  Dwarves still have to stop, and try to path around anyone who gets in their way, though.  In order to accomodate traffic, you have to make those halls at least 20 feet wide... and 30 feet wide for a wagon.

All walls are 10 feet thick.

All doors occupy 100 square feet of swinging space.

Unfortunately, there is really only one way to counter such a problem, and that is to make the cubes smaller.  It could theoretically be that we simply make cubes 1/8th the size I originally suggested (5' cubes, similar to D&D, or 1.5 meter cubes, for a total of 3.375 cubic meters space), and simply make all floors occupy two z-levels (or make it three times, so that each tile is 3' or 1 meter cube).  Alternately, we could make tiles rectangular prisms, and make them twice (or three times) as tall as they are wide or long.  This could be solved by making z-level pathfinding more expensive than horizontal pathfinding.

Or, you know, we could just not care that fortresses are wildly disproportionate.
Title: Re: Volume and Mass
Post by: Silverionmox on July 13, 2010, 12:51:34 pm
I think it could be entertaining to define one square as the cube circumscribed around a dwarf. Humans and elves would then require two squares of open space to be able to walk upright, and that would assure that tall and short humanoids feel very different. Not to mention the military implications.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 12:56:02 pm
Oh, and about density and mass and volume already in the game... I got un-lazified, and did a little research.

Iron is listed in the game raws as having a "SOLID_DENSITY" of 7850.  Wikipedia says (http://en.wikipedia.org/wiki/Iron) pure iron has room temperature density of 7.874 g / cm^3.  My calculator says that's 7874 kg / m^3.  I'll just assume Toady was rounding or assuming some less dense impurities in the iron or something, and that this is the set of units Toady is using for his metals, since gold's SOLID_DENSITY is 19320, while wikipedia says 19.30 g/cm^3, and silver is SOLID_DENSITY 10490 versus wikipedia density of 10.49 g/cm^3.

OK, so we already have the game material density listed in the exact units I wanted to use, anyway, so we can find object volume fairly easily, right?

Since I didn't get THAT un-lazy, I'm just using the wiki page (http://df.magmawiki.com/index.php/DF2010:Weight) so that I don't have to go cataloguing all sorts of material densities on my own.

Apparently, you find the weight (mass and weight are the same for now, as gravity is always a constant, regardless of world) of a weapon by taking its material density, multiplying by the size of the weapon, and then dividing by 1,000,000.  Since we are dividing that cubic meter we are using as a base unit by a million, and there are a thousand liters in a cubic meter, we can find that the unit for size is still a milliliter, the same as with creature sizes, which I said in a previous post.

Gloves and shields are only the density divided by 100,000, and so take up 10 milliliters of volume... which seems quite tiny to me...  (And in the wiki page, it even links to bug reports listing this as a probable reason why shields are so light and weak.)

Shoes take up 1/6th of a liter times their "layer size", which is essentially their thickness value.

etc. etc.

When we are able to calculate these things, we are able to actually see what volume such objects are actually supposed to occupy (and, incidentally, argue that those volumes are probably wrong.)


Edit: I should also note that the fact that "size" is an integer value that seems to line up perfectly to milliliters, and is consistant across creatures and objects, density lines up as basically kg/m^3, and mass is measured in kg seems to heavily imply that Toady went out of his way to actually accomidate being able to measure objects in DF in exact units, rather than abstract unitless lumps the way that "stones" and "logs" exist now and in earlier versions.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 01:37:46 pm
Sure it makes DF a bit more realistic.  But does it improve the game in any other way?  Does it make it more fun?

Yes and yes.  I've been trying to explain this with the list of things that such a change makes possible, but I'll explain again in the bit a little down the way.

Such a change would touch just about every aspect of the game, potentially causing bugs in every aspect of the game.  It would also take up a huge portion of Toady's time, which could be spent on better things.  Maybe introduce this in v2.0

First, there is no v2.0.  There probably will not even be a v1.0, as it will just stretch on to infinity with versions 0.282.3582.14e as Toady keeps finding more things to cram into the game. But that's beside the point.

This argument means about the same thing to this particular suggestion as it means to every suggestion.  Any suggestion takes up Toady's time if he impliments it, and any change can cause bugs. 

This is made even more silly by the fact that, as you say, this will impact quite a bit, meaning that the more things that he changes before making this switch, the MORE work it will be to make sure everything is properly aligned.  It is, in fact, the sooner the better, as it took a total reworking of the entire material system (meaning every single type of material and object had to be reworked) just to get eveyrthing on this metric system equivalency I've been talking about.

This change, meanwhile enables quite a bit more to be done by players and modders and by regular players alike, making this obviously "worth it".

On Eternal Suggestion Voting (http://www.bay12forums.com/smf/eternal_voting.php#vote248).
Dwarves may make them shorter theoretically, but when we are dealing with stone caves, a little extra ceiling room for buttressing may be a good idea.
Dwarves are not the only ones who matter, anyway. Gotta account for human and other structures.

Well, this is based upon human building standards, not dwarves, anyway...  It's just being made a 10' cube since round numbers are easiest to work with.

...

B.  As soon as workshops are fully in the raws, there are better solutions.  Make a cow produce 20 units of leather, a pig 8 units of leather.  A leather glove might take one unit of leather, while a leather chest armor takes six.  For items that need less than "one unit", make multiples like mugs already do.  One block of stone gets crafted into 12 stone earrings, etc.

...

Make a new task in a workshop that turns "one coal" into "20 coal bricks".  Then each forge task can use some number of coal bricks.

OK, so then, if we want to make items out of units less than one log, we then have to make an entirely seperate kind of wood material, so that when a dwarf chops down a tree, it makes one log, but we can then split it into the 20 different wood items we need to have a little bit more leeway in how much material is used in a single given reaction, like making a barrel or other furniture, wheras I'd need some entirely seperate system for reducing wood to coal based on mass instead of volume, since woods have different densities.  That's not even counting stone, where it probably won't be raw-moddable how uncut stone will be used in constructions, anyway.

Again, the game is already made out to be able to measure objects in the units I am describing.  It just has to switch the way it presents the game to allow you to use items by the pound, as it were, and to be able to stack objects properly, which is something Toady has listed as something he will work on, anyway.

This doesn't even go into the potential applications of this change, which I tried to describe earlier.  Take, for example, the matter of tree sizes.  The trees that only take up one tile (not counting a psuedo-root structure in the tile below) have been a known problem in this game for a while.  It's quite hard for Toady's elven tree cities to take place when your city would be built upon trees the size of shrubs, after all.  This gives the chance to have a real mechanic whereby you can measure tree mass and size as it grows per annum, AND have it matter if/when your dwarves chop them down - especially useful when we are talking about dwarven tree farming when THAT gets up and running.

It gives us a chance to deal in more precise ways with metal wastage, or even how much ore can be extracted from a vein - currently, you either generate an ore stone, or vaporize a rock.  Now, you can have percentile success rates, generating varying degrees of smeltable ore or waste.  Likewise, the lumber cutting process can make higher-skilled woodcutters preserve more of the wood from the tree they have felled, making higher skill rankings in such skills actually matter.  Likewise, the mullock can be semi-faithfully tracked instead of simply vaporizing all cleared stone that isn't made into a "stone" object.

It gives us a chance to deal more realistically with food consumption rates (http://www.bay12forums.com/smf/index.php?topic=60681.msg1391910#msg1391910) based on creature size.

It lets us be able to user-define the actual size of most of our new products.

It can let us rework the fluid system to be both more accurate and take up less of our precious FPS.

Most importantly, it helps remedy a major hole in a game that otherwise respects notions of verisimilitude without really upsetting anything major.  I don't see how you can see only negatives in this, as I see only positives in exchange for something that Toady is probably going to have to give up and do eventually, so he might as well start thinking about doing it now.  After all, if he waits until "v2.0", there are more interlocking pieces that can break.  It's better to do it now, when so many things have yet to be implimented, and when those things, thanks to an internally consistant means of measurement, can probably be implimented with more ease than they otherwise would be.
Title: Re: Volume and Mass
Post by: G-Flex on July 13, 2010, 02:12:31 pm
First, there is no v2.0.  There probably will not even be a v1.0, as it will just stretch on to infinity with versions 0.282.3582.14e as Toady keeps finding more things to cram into the game. But that's beside the point.

As an aside, I'm not sure if you know this, but Toady doesn't consider "1.0" to be when the game is complete. Magic in general is even post-1.0 material. Of course, this is going by the old dev pages, so I'm not sure how true this still is.


I agree with what you say and don't have much to say (for once). There's just not much downside to this at all if things are presented reasonably to the user.
Title: Re: Volume and Mass
Post by: Hammurabi on July 13, 2010, 02:39:34 pm

I don't see how you can see only negatives in this, as I see only positives in exchange for something that Toady is probably going to have to give up and do eventually, so he might as well start thinking about doing it now.

FWIW, I agree with many of the positives that you mentioned.  For example, I think it is ridiculous that a square can only hold one gemstone (or only 10 gemstones in a bin).  I like your idea.  I just think there are many more important things for Today to work on that have a bigger effect on gameplay. 
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 03:14:35 pm
Something in the farming thread got me thinking, though, when it comes to liquids.

Correct.  I don't know how DF tracks the map data, I just know that it's pretty crammed; every bit assigned to something.  And water is actually 4 bits:

abcd

a = water/magma

bcd = 0-7 level.

If we are reworking how fluids would be tracked by making fluids be tracked in terms of volume, then we will break how fluids are currently tracked.  This may not necessarily be a bad thing (http://www.bay12forums.com/smf/index.php?topic=59945) as current fluid mechanics are not terribly efficient, and can only handle the fluids of water and magma currently.

In thinking about it, the best way to handle such a thing is with tracking fluids as, essentially, an object like a stone or a barrel (although I am not particularly sure how those are handled exactly, I would assume that, rather than as a set of bits in every single tile, would instead be a set of references), but with a special location, so that it could be checked without being terribly difficult to search for it amidst the giant list of objects in the game. 

A set of flag bits could be set up, essentially "HERE_THERE_BE_MAGMA" as one bit to let pathfinding and game mechanics know that magma-related fun is occuring in that tile, and another for "DANGEROUS_WATER_LEVELS", which would be based on having enough water to block pathing for non-amphibious creatures.

It would actually be somewhat more ideal if fluid was tracked as a large, multi-tile entity than as a property of every individual tile, as that would allow the fluid mechanics to operate on a large, continuous body of fluid, rather than upon potentially thousands of individually randomly moving clumps of fluid, which consumes CPU power voraciously.  Fluid could then theoretically just be tracked in a single large chunk of memory, with references to the tiles it occupies.  (Of course, this is speaking from a position of being blind as to the full way in which this is being implimented, which is a major handicap, as I have to talk in far more abstract terms than I really wish.) 

If we are making entire bodies of fluid (and their surrounding containers) into large entities, then for the calculations, we would be able to do a little calculus-style calculation of fluid flow, which would be more complex, but, considering the fact that it would save on potentially hundreds or thousands of smaller calls to the rand() function and checks against what is sitting in the tiles next door, it should have a significant net savings.

(Oh, and if anyone has links to more concrete examples of how fluid mechanics actually works, especially if it refers to how it is checked, please post it. I'd like to have both eyes open when I'm trying to figure these things out.)
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 13, 2010, 09:38:59 pm
Actually, while trying to find out what the volume of a crossbow bolt should be, I was reminded of another reason to include more easily divisible units of materials: why are crossbow bolts with metal tips made entirely of metal?  Should it not be possible to make wood bolts with metal tips?  Similarly, metal picks should probably not have metal handles, when wooden ones are likely as good.
Title: Re: Volume and Mass
Post by: CapnMikey on July 14, 2010, 12:11:38 am
Hey NW_Kohaku, I like your suggestions (this thread and others).  I think you and I have similar ideas of fun. 

I have thought about this before, and my biggest sticking point was that realistic distance makes the unrealistic time much more apparent.  We could actually say, okay, a dwarf walks 200m in one season - what?  I would lean towards revamping time, so it passes at a realistic speed, but that leads to a whole host of other problems, as I'm sure you can imagine.  Do you think it would be okay to have realistic mass/volume/distance, but highly gamey time?

Also, how much of the change is just semantics?  I became happier when I started thinking of "1 granite earring" as "1 (freaking huge pile of) granite earring(s)", and "1 seed" as "1 (big ole sack of) seeds".  Like, if a block made 100 earrings, their value would have to scaled down, or else they become a super-tradegood.  Scaled down by, say 100 - then what exactly does the change achieve?

I like your ideas for more realistic engineering/collapse.  I think a good way to alert the player would be a combination of flavour messages, and visual feedback.  Say you're building a bridge of unsupported floors, you might get a message "The floor creaks ominously", and the floor tiles where the bridge would snap off might start flashing.  If you built some support pillars, the flashing would stop.

I would also like to see tall structures topple sideways, rather than collapsing straight down like a perfectly controlled demolition.  Since you can't really have pillars or whatever leaning in gridworld, it's probably only doable if the structure breaks up into smaller pieces, depending on impact speed, but they could rotate.  So if your tower had its left supports taken out, it would fall to the left.  The rooms near the bottom would be intact (but sideways!), with breaks where the terrain contours required, but everything near the top would be smashed into individual stones.
Title: Re: Volume and Mass
Post by: G-Flex on July 14, 2010, 12:18:52 am
Also, how much of the change is just semantics?  I became happier when I started thinking of "1 granite earring" as "1 (freaking huge pile of) granite earring(s)", and "1 seed" as "1 (big ole sack of) seeds".  Like, if a block made 100 earrings, their value would have to scaled down, or else they become a super-tradegood.  Scaled down by, say 100 - then what exactly does the change achieve?

The problem is that sometimes you want to keep track of multiple objects. For instance, you can't really interpret an "earring" as a "pile of earrings" when only one dwarf can wear it on only one ear, and this will become more and more true as unique identities for items become more important (ownership, unique properties of items, magical items, people becoming attached to and recognizing them, etc.). For something like seeds, it can matter a bit less, but still might matter (what if you want to leave a trail of seeds behind you in the wilderness to mark your path?).
Title: Re: Volume and Mass
Post by: CapnMikey on July 14, 2010, 12:43:53 am
The problem is that sometimes you want to keep track of multiple objects. For instance, you can't really interpret an "earring" as a "pile of earrings" when only one dwarf can wear it on only one ear, and this will become more and more true as unique identities for items become more important (ownership, unique properties of items, magical items, people becoming attached to and recognizing them, etc.). For something like seeds, it can matter a bit less, but still might matter (what if you want to leave a trail of seeds behind you in the wilderness to mark your path?).

Ah, you are right, I was thinking of earrings as trade goods only!  Let me reread this thread more closely I think my brain went on a tangent and missed the point XD
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 14, 2010, 12:47:55 am
Hey NW_Kohaku, I like your suggestions (this thread and others).  I think you and I have similar ideas of fun. 

I have thought about this before, and my biggest sticking point was that realistic distance makes the unrealistic time much more apparent.  We could actually say, okay, a dwarf walks 200m in one season - what?  I would lean towards revamping time, so it passes at a realistic speed, but that leads to a whole host of other problems, as I'm sure you can imagine.  Do you think it would be okay to have realistic mass/volume/distance, but highly gamey time?

Time will be strange no matter what we do.  There's no way that this game could be modeled in anything approaching real-time without making the average game not last past the first Summer before most people got bored.  Besides that, there's the difference in time scale between Adventurer and Fortress mode. 

Space can be modeled with consistancy, Time cannot.  That's all there is to it.

Even without space being consistantly modeled, time is abstracted... dwarves eat only 8 times a year, for example.  Toady has stated he has no interest in making that more frequent.

Also, how much of the change is just semantics?  I became happier when I started thinking of "1 granite earring" as "1 (freaking huge pile of) granite earring(s)", and "1 seed" as "1 (big ole sack of) seeds".  Like, if a block made 100 earrings, their value would have to scaled down, or else they become a super-tradegood.  Scaled down by, say 100 - then what exactly does the change achieve?

Also, how much of the change is just semantics?  I became happier when I started thinking of "1 granite earring" as "1 (freaking huge pile of) granite earring(s)", and "1 seed" as "1 (big ole sack of) seeds".  Like, if a block made 100 earrings, their value would have to scaled down, or else they become a super-tradegood.  Scaled down by, say 100 - then what exactly does the change achieve?

The problem is that sometimes you want to keep track of multiple objects. For instance, you can't really interpret an "earring" as a "pile of earrings" when only one dwarf can wear it on only one ear, and this will become more and more true as unique identities for items become more important (ownership, unique properties of items, magical items, people becoming attached to and recognizing them, etc.). For something like seeds, it can matter a bit less, but still might matter (what if you want to leave a trail of seeds behind you in the wilderness to mark your path?).

Actually, I see the problem he's trying to get at, and it's something different.  Making 100 granite earrings from a single large block of granite isn't much of a problem, as granite is so common as to be virtually worthless, and the value of a granite earring is almost entirely based on the simple amount of labor put on the craft.  The problem is when that material is not granite, but something much more rare and valuable, like platinum.  If I can make many more base value 10 jewelry out of a single piece of platinum ore than I could make base value 10 furniture or other, larger objects.  If earrings sell for the same price per unit as instruments or tables, but I can make 10 times as many earrings as instruments or 100 times as many earrings as tables from a single piece of platinum, then small, lightweight jewelry would be the most efficient trade good for rarer raw materials, the way that mugs are now often good trade goods because they come in threes.

The thing is, however, when you really consider it, making jewelry out of rare metals be more valuable overall than making tables out of the material might just make a little bit of sense. 

Also, the material that a product is made of does not affect its overall volume, only the object in question does, which means that more massive objects, if they should be on par with other trade goods, should simply have their base values altered to reflect the difference in material that are in them.  (So scepters might have a higher base value than earrings.)
Title: Re: Volume and Mass
Post by: CapnMikey on July 14, 2010, 01:19:48 am
Ah, I think I'm getting it.  It was a bit tough, as a lot of the minutiae in this thread made my eyes glaze over (don't get me wrong, I love that stuff, but it's a different headspace than gameplay!)  This paragraph aided me greatly in summing the idea up:

OK, so then, if we want to make items out of units less than one log, we then have to make an entirely seperate kind of wood material, so that when a dwarf chops down a tree, it makes one log, but we can then split it into the 20 different wood items we need to have a little bit more leeway in how much material is used in a single given reaction, like making a barrel or other furniture, wheras I'd need some entirely seperate system for reducing wood to coal based on mass instead of volume, since woods have different densities.  That's not even counting stone, where it probably won't be raw-moddable how uncut stone will be used in constructions, anyway.

So then, instead of taking a platinum bar to the workshop, assigning one task, and BANG ending up with 100 earrings in the time it takes to make a sword, you would make one (or a few) earrings, and have 98% (or whatever) of a platinum block left, yes?

I also like the idea that some tasks are volume-based, while others are mass-based - now I understand why you're talking about density!  That would be interesting.  I can see myself moving the densest wood to my wood furnace, since it gives me the most bang for my buck.

Relatively Minor Gripes!

1.  Fractional remainders was brought up, and your solution would work if there was just "stone", but how would it work with the buttload of varieties?  Supposing you had 90kg remainders of 30 different types of stone (so they couldn't stack), and needed 100kg for an item?  I realize this isn't terribly likely, since you generally have a large supply of a few varieties.

2.  ARGH SO CLOSE.  Like you have 196kg of gold, but need 200kg to make that statue.  This is more about player expectations, because currently you can have 2 bars instead of the 3 you need, it just seems more frustrating being out 2% than 1/3.  I'd be thinking, "Just make it a LITTLE shorter!"  That's a relatively minor gripe.

Overall I think this is a cool idea!  I am curious what you think about those gripes, though.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 14, 2010, 01:32:24 am
Relatively Minor Gripes!

1.  Fractional remainders was brought up, and your solution would work if there was just "stone", but how would it work with the buttload of varieties?  Supposing you had 90kg remainders of 30 different types of stone (so they couldn't stack), and needed 100kg for an item?  I realize this isn't terribly likely, since you generally have a large supply of a few varieties.

2.  ARGH SO CLOSE.  Like you have 196kg of gold, but need 200kg to make that statue.  This is more about player expectations, because currently you can have 2 bars instead of the 3 you need, it just seems more frustrating being out 2% than 1/3.  I'd be thinking, "Just make it a LITTLE shorter!"  That's a relatively minor gripe.

Overall I think this is a cool idea!  I am curious what you think about those gripes, though.

Overall, these sound like the exact same thing.  If you need 100 kgs of stone for something, but only have 90 kgs of any one given type (and you cannot meld unlike stones together), then you're just going to have to quarry more stone.  The same goes for the gold statue.  If it takes 200 kgs to make a statue, you need 200 kgs to make that statue, unless it actually bothered you so much you would want to make a raw edit to make a "small statue" that occupies less space, and takes less materials (which may cause more problems than it solves).

... Of course, this makes me think of objects like Planepacked, and I wonder if decorations should start requiring a certain extra amount of volume before inscribing...
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 17, 2010, 10:48:34 pm
Oh, hey, I just found a new fun-fun conundrum:

I have a small oddity. Started viewing stuff for haul-to-depot.
A named goblin's bone (stack of five), weighing 78 units. Really heavy. Basic value 0 as of all bones.
Also have 2h-camel bone, stack of 17, weighing 68 units.
Also have 2h-camel bone, stack of 17, weighing 84 units.
I don't think bones should weigh the same as twice a unit of wood logs.

Hah! That sounds like a problem of volume and mass.  (I made a thread on that, you know...)

I'm guessing the thing is, you get the same number of bones no matter how big the camel is, but bigger camels have bigger bones.  The bones have the same density, but larger volume, and correspondingly, more mass.

Bone should probably be slightly denser than water (1000 kg/m^3, and Toady appears to adhere to kg/m^3 for his density scale), which is slightly denser than wood, but I don't see an easy number in the raws. 

Regardless, the real problem is that wooden logs are about half the size of the bones of humanoid-sized or camel-sized creatures. 

Goblins have an average "size" of 60,000 in the raws.  Size appears consistant through the raws, and appears to correlate to 1 ml per unit, and density of creatures overall should be roughly similar to water, so goblins should weigh 60 kg on average.  Camels, on the other hand, have a size of 500,000 in the raws, and by the same logic should mass 500 kg. 

The fact that those two creatures are giving very similar masses for what should be radically different bone volumes and similar densities (unless this game actually has bone density mechanics that can result in bones roughly 9 times denser than other creatures, I don't know...) are very strange.
Title: your idea rocks
Post by: antymattar on July 18, 2010, 10:59:50 am
I am so for this thing!!!
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 18, 2010, 01:56:01 pm
I just did some play with bones.

Remember, I don't know the exact density of bones right now...

Specifically, I embarked with elephants as common_domestic and pet_value 1 along with similarly low-value cats.

Cats provide 4 bones that weigh less than a kg total.

Elephants provide differing amounts of bones (lol, 2/3s a skeleton?) such as 53 and 67 bones, but more tellingly, the 67 bone pile weighed in at just over 901 kgs, which blows cat bones out of the water in terms of volume.

This means that any individual elephant bone weighs on average 13.45 kg.  The cat bones must weigh less than a quarter of a kg, each. 

Now then, in spite of this massive difference in the mass of a bone (which, presuming there is an even remotely comparable density, means the volume is different, presumably with the elephant bones being around 80 times the volume of a cat bone), each elephant bone only made 5 bone bolts, the same as a cat bone.

For reference, the raws say that (now that Toady apparently upped their volume to make them more deadly) crossbow bolts are 150 size (which is .15 liters of material), which means they combine to make .75 liters of material.  Bone, again, should be denser than water, but it's not surprising that even the 5 elephant bone bolts were still less than a kg in mass, meaning a density of less than 1333 kg/m^3, so again ,we cannot say extraordinary density.

This means we have a bone that masses in at 13.45 kg being reduced down to less than a kg in bone crossbow bolts, with all the rest of the bone wasted.  In fact, the tiny cat bones produced essentially the same material for what essentially amounts to 1/80th of the material.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 23, 2010, 11:12:03 pm
More fun with numbers:

Every bar appears to be 2 liters.
Logs are 50 liters.
Most layer stones have some form of default density, but they all have 186 kg mass.
Judging by minerals, which I presume produce the same volume of ore as a non-economic stone does, all stones have 70 liters of volume. 

(Note that you reduce an ore from 70 liters down to 2 liters, which may explain why it takes three metal units to make one furniture unit... although, of course, that's nowhere near enough.)

Bins are 15 liters.
Barrels appear to be about 20 liters.
Chairs are 30 liters.
Tables are 30 liters.

etc.
Title: Re: Volume and Mass
Post by: Zalminen on July 23, 2010, 11:50:57 pm
Hmm...

Making cubes fixed (dwarf)size would mean that there are now much more multi-tile creatures, which means pathfinding would need to be redone.

Of course this would have to be done sooner or later in any case...
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 24, 2010, 08:22:48 am
Hmm...

Making cubes fixed (dwarf)size would mean that there are now much more multi-tile creatures, which means pathfinding would need to be redone.

Of course this would have to be done sooner or later in any case...

Not as many as you'd think.

Like I'd said earlier, dragons can fit, so long as there isn't a low ceiling.  The problems would mostly be in creatures like Whales, or anything else with a size of over 25,000,000.
Title: Re: Volume and Mass
Post by: Zalminen on July 24, 2010, 12:15:40 pm
Well, I mostly meant that the wagon pathfinding may just be special cased in the code and there may not currently be true support for multi-tile creature pathing.

But that's something only Toady knows so it's not very important here. Just something that popped into my mind.
 
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 24, 2010, 12:29:07 pm
OK, I mistakenly closed the browser to clean up memory leaks in Opera, forgetting that I had a post that was half-written in here, which was covering how fluid dynamics could start to take place.

Also note, I am mostly talking about water when I am talking about fluids, here.  In fact, I have to constantly correct myself from saying "water" when I mean "fluid".  I will make another post later that will incorporate special quirks of magma, like pressure that builds up in magma chambers to cause eruptions.

So to try to make a quicky version of the previous deleted post (spoiling this into sections to keep length managable:


First, bodies of water must be composed of objects that are handled in their own special case of dynamic memory, rather than as properties of every tile.  For the purposes of pathfinding, there will probably need to be flags for "dangerous amounts of water, non-aquatics cannot path here" or "MAGMA! HOT!" that can be put in individual tile mapdata memory, but otherwise, like contaminants or furniture, fluid bodies can potentially be seperate chunks of memory, with a seperate "fluid mechanics" phase of every frame.

After that, we need fluid body to recognize when they are in a state of rest - that they are filling the container that the fluid body is in as efficiently as possible, and that no further motion is necessary, unless it is somehow disturbed.  This means that fluid, which would probably now be measured in liter form or the like, would try to level off, and then form a "placid lake" when not disturbed, with the top levels of a fluid body evenly distributed, with a remainder of water bodies, for example, probably gravitating to the edges in a little mockup of surface tension just to make things as even as possible.  Once it hits this state, fluid mechanics only checks for disturbance of the water, even if there is non-filling of the tiles.

Density can then become a matter of bouyancy.  Water has a density of 1000 in the game's choice of units, but this has problems since creatures are mainly made of 500 density organs, bones, and the like, which would make most creatures bouyant, and we need to have creatures capable of sinking to be capable of drowning.  Most woods, then, would also be bouyant, which may make for some fun mechanics, like floating logs down rivers to get to the sawmill.  (Of course, I do consider bouyancy something of a low priority if you do not wish to do all this in one go.) 

With that, however, we can also start modeling Displacement.  Dumping a 70-liter stone into the water will displace 70 liters of water when it sinks.  This causes a 70-liter rise in one tile of the fluid body (as the fluid mechanics would have to recognize how much space is available in every tile), and this would then have to start getting distributed. 

This brings up distribution rates, which is where we typically have to start breaking open the calculus.  Distributing the fluids, when we no longer have simple tile-to-tile transfers and delays between checks being the means of altering flow rates, depends on a great many factors, although fortunately, constant gravity, incompressible fluids and several other quirks of DF mechanics allow us to reduce several difficult variables to constants.  This means that we really only need a few variables: viscosity of each fluid (which will need to be a constant variable associated with every type of fluid), density (again, already a constant variable associated with every type of fluid), and fluid pressure (which is a simple, direct function of fluid depth, unless we start getting vulcanism involved with magma, where we might get some fun-fun with magma getting pressure that builds up from below).


Spoiler: diagram (click to show/hide)


Viscosity can simply be a constant of 1 or 1000 or some such for water, and be a different variable for other fluids to reflect their resistance to flow. (This is assuming simple newtonian fluids.)  You can simply divide the flow rate by the viscosity of the fluid to produce the "fluid friction" specific to that fluid because of viscosity.  This can, in fact, be kludged by simply setting a different effective "SPEED" rate for every type of fluid's checks - if magma is arbitrarily set to be 10 times more viscous than water, you could simply run magma flow checks 1/10th as frequently as the water flow is checked.  (Which may be what is already happening.)

Density is the opposite - the denser the material, the more force gravity can apply to a material, and for the purposes of purely gravity-driven fluid flows, doubling the density will double the rate of flow.  (So flow rate is multiplied by density when calculating purely gravity-driven flows.)

This is just a basic, 2-d version of fluid flow, however, I'll update on how "puddle mechanics" should work, since this whole thing is getting pretty long already.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 24, 2010, 12:53:59 pm
Ah, and by the way, I am currently talking mostly about hydrostatic pressure as the force that provides the impulse upon water: http://en.wikipedia.org/wiki/Hydrostatic_pressure#Hydrostatic_pressure

This is the integral of depth, fluid density, and the force of gravity.  Since gravity is a constant, and density is a constant to a particular liquid, it is therefore only depth that is a variable, and all you need is to plug in that constant.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 25, 2010, 03:31:11 pm
Forgive me if this gets a little rambling, but this is, in part, a matter of my reasoning through the problem (and also my showing my work), so it will be long and discursive.  I will try to make an "executive summary" post at the end of all this to make a more concise case for a fluid system.

Allright, for my next trick, I have to reconcile the fact that we are dealing not with a single cross-sectional view of how much force will be pushing water across a plane, but to deal with the fact that water in this game is actually going to have to look much more like this:

http://en.wikipedia.org/wiki/Shallow-water_equations

That is, if you are piping water off a cliff into a large pit at a constant rate of flow, then as water is added at the point where the water lands, then the sudden "pile" of water that is generated in one tile has to then be distributed outward into all the surrounding tiles.

One way of handling this is to simply divide the pressure into 8 seperate horizontal flows, but this starts to reveal one of the problems with doing this this way - we would then start to be dealing with fluids in the same interative, per-tile manner that I am trying to avoid making us use all over again.

Instead, I want to go back a step, and talk about how fluid actually MOVES once we have calculated the force behind it.


Spoiler: images (click to show/hide)


Now then, I can go back to where I started this post, and start talking about how this model needs expansion based upon two major problems - one is that bodies of water can have multiple "outflows" from it at once, like a single "swell" of water that must be divided in multiple directions, but the other is that I am talking about a velocity of water (and technically an acceleration of water) based upon pressure.  If we had a situation somewhat like having a large water tower with a hole punched in the side of the tower near the bottom, the water would not simply drop, it would be projected into a stream of water.  This latter problem is the problem that I want to tackle next - bodies that have a flow/velocity.

Therefore, bodies of water have to be divided into two types - lakes and rivers (or pipes), or bodies that either have no flow or do have a flow.

Lakes are those standing bodies of water that have no motion other than sloshing around the water in response to more water being added, or perhaps water being drained.  When water is drained off of a lake, thanks to opening a floodgate, or maybe a dwarf digging a channel, water then starts flowing out of the lake at a given velocity.  If the tile that is being flowed into is just a dead end, it simply becomes part of the lake whose water it took, expanding the body of water.  If, however, once water flows into an empty space, and the computer checks, and finds more space for that newly flowing water to flow into (like a long channel), then a new body of water is created, a river, and the river has a flow.  Even though it is contguous to the body of water that is a lake that created it, the river now has a special flow and velocity mechanic associated with the body of water, with the interface between the two bodies of water being the opened floodgate.  The flow of water into the new river translates into its velocity travelling onward through the channel.  As water is pushed into a river, it tries to push the water it is recieving forward at a similar rate, or picking up the pace if it happens to go down a drop.

Spoiler: river channel flow (click to show/hide)

This might seem semantic at first, but it is important in the building of rivers and brooks and dwarven perpetual motion devices that the notion that water has a velocity, and is maintaining its momentum until it has a reason to stop. 

Consider again the water tower with a hole in the side - if that water starts spouting out from the hole under pressure, it will have forward momentum.  Falling water itself would actually need special rules for applying gravity to the momentum (downward) so that it accellerates to a terminal velocity before it finally can come to rest wherever it lands.  In this case, the "river" would be a continuous flow from the hole down to wherever it lands, although perhaps this might be translated as individual globs of water with individual trajectories being pathed individually, depending on how much "spray" we want to have.  (In this case, it might be necessary to create a third type of body, a "spill" body, whose purpose is just to handle projectiles where there is no inflow or outflow of water, simply a traveling body of water that is trying to path to the lowest point it can find to be at rest, at which point it can turn into a "lake" body, unless it joins another body.)

In a brook or even a rapids, we can consider the "river" type body of water to simply be having an inflow and and outflow, which we can easily measure, and as long as the two are equal, we can save on processor power by just assuming the river continues flowing without changing in its shape in any fundementally important way.  The same can be said of "Dwarven Perpetual Motion Devices" - when pumps remove water from a current (and place it back into the same current), we can just balance the inflow and outflow to find a stable state where a constant rate of flow occurs, without having to waste CPU cycles finding the exact same answer over and over. 

In the case that the inflow and outflow are not equal, such as that diagram I made above, where water is inflowing, then the water has to expand outwards to find a place to store the extra water that is entering this body.  If, again, this turns into a dead-end channel, then the whole body of the "river" will eventually turn into a "lake" as it fills its container, and the two contiguous "lake" bodies can be joined (until the floodgate is once again closed).

The important part is that the expanding water has a starting velocity.  Real rivers will then have dips and rapids and narrows that can alter velocity accordingly (the narrower the river, the faster it will run, proportional to its starting point).  This means that we cannot track a river as having a velocity, but rather that different slices of rivers will have different velocities.  (This may actually be better handled by simply making seperate river bodies to track, however.)  This would get especially important when dealing with pipes, or aquaducts or other ceilinged water flows, as dropping water down in elevation before forcing it to come back up a bend will actually dramatically increase the water pressure and potentially its velocity as it drops.


This means we can handle the problem I was talking about in the start of this post in a different manner - when water is added into a pool from above, this creates a "swell", a raised portion of water in a lake, which then has to be distributed.  How this ultimately gets distributed in a lake is obvious: it should be perfectly level, with all tiles at the highest z-level having the same water depth.  The problem is finding the right rate to balance this swell out against the nearby tiles (which is a matter of that constant, above), and having a final smoothing function that simply makes a lake that has sloshing finally just die down instead of having "ripples" that slosh water around at the top of a lake.  More important, however, is that this allows us to still treat this as a single body with a single set of calculations, rather than as a bunch of individual tiles.  This means, rather than having one tile with more water in it than others, we are tracking a "lake" which happens to have a swell centered in one tile, whose water can be tracked as partially distributed. (Inversely, there should be a "depression" function for water draining out of a lake at a certain point, so that water outflowing a body creates a small whirlpool as water is removed first from the tiles near the outflow, with water flowing towards the depression to even out the lake again.)

I've been keeping this up on my screen for a couple days, and I don't want to lose it again, so I'm going to post this here.
Title: Re: Volume and Mass
Post by: cameron on July 25, 2010, 11:23:31 pm
If the system of volume and mass were to be fixed as is your proposal along with a much improved "cave in" mechanic i would be interested to see liquid as simply a material with a shear stress value of zero, this could mean that liquids would barely need a special case at all. the main special case being buoyancy but this could be handled on a single tile basis by simple checks for density (displacement would also have to be a special case i think), at least on a single tile basis but as near as i can tell multitile boat things would need special cases in any approach.

the main issue of course with this approach is performance as unless there were some flag to ignore checks on fluids(or all materials to really if fluids are using the same system) after it hadn't moved in a while(or some other condition) it could end up much slower then currently depending on how cave ins and such were handled.

about the proposed fluid system most of it seems rather sensible. Though about the rivers one thing to think about is how would one know if there was any change to the river shape,  would the tiles be flagged as river touching so that if there was any change to them the river would be reevaluated or would they (the river adjacent tiles) simply be checked every tick or whatever.

about the dimensions in the square I think i might be an idea for squares to actually contain say 9 different place for a dwarf to stand in this would only be for creatures and certain furniture and these positions could be further split or combined depending on creature size so that longer weapons could make a more of a difference and would also allow for more sensible arrangements of both the number of people which fit in a tile(laying down or not) and not having your cabinet take up 27m3
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 27, 2010, 11:48:56 pm
Well, I'm trying to work on it, and make the fluid system as efficient as possible by removing the need for iterative per-tile calculations...

Thing is, I think that if I use bodies of fluids, inflows and outflows, as well as swells and depressions, I can make static and flowing bodies generally work fairly efficiently.

The problem is, the way I'm coming up with how to model a swell is basically to have what the water level would be without the swell, and then create a height, and then something that looks like a normal curve that has an ever-larger standard deviation to map out how the fluid is flowing to make a level plane again... which is probably not the easiest way to handle things, but I am having trouble finding much better ways to handle fluid distribution models that do not rely upon iterative per-tile methods of calculation...


As for rivers, the key piece of information is the rate of flow of water.  If a river will have the same amount of water flowing through it at any given point, then the breadth of the area that it travels through determines how quickly the water travels - so a three tile wide, two tile deep river that suddenly gets funneled into a one tile wide, one tile deep channel/pipe (without ability to overflow) will have to run six times as fast to keep the water flowing.  In that sense, the calculation for making rivers run fast is fairly easy.

The only major difficulty is in programming a way for the computer to recognize the direction the river is flowing, and the general amount of area it has to flow through, and recognize changes in the area that the water can flow through.  Still, if you have an ability to track the direction that the water is flowing, you simply have to trace out both other directional axis to see how large the area a river has to flow through... with the real problem is in non-cardinal direction flows, like the way that brooks in the game already have somewhat winding paths.
Title: Re: Volume and Mass
Post by: Andeerz on July 29, 2010, 05:39:23 am
<3's for this thread.  I am in full support of this suggestion, NW_Kohaku!  If it was in eternal suggestions, I'd vote for it.
Title: Re: Volume and Mass
Post by: NW_Kohaku on July 29, 2010, 10:42:03 am
It is on Eternal Suggestion Voting.  The link seemed to have been broken, though, as they changed the number in the link after I posted it.  (It apparently used to link to #vote248 in the OP)

http://www.bay12forums.com/smf/eternal_voting.php#vote258
Title: Re: Volume and Mass
Post by: NRN_R_Sumo1 on July 29, 2010, 02:53:13 pm
I do fully support it, and if there was a way to disable default workshops from being made in DF, as well as default reactions, I'd probably be trying to make this entire system just from modding.. although it wouldnt be near as classy as having it be the default DF.

Elephants really should be used to make several dozen capes.
Title: Re: Volume and Mass
Post by: tfaal on July 29, 2010, 09:57:21 pm
If you want to get rid of the current workshops, you can just remove their kebindings. I think that a full conversion mod of that sort would run into other problems, though.
Title: Re: Volume and Mass
Post by: keda on August 02, 2010, 07:53:40 pm
I really like this idea, but I have a vague feeling that it would have to involve iterative per tile computations, at least for each tile that is in a state of pressure imbalance. I'm also thinking about the behaviour of fluid in a realistic cave-in. Solids rock does not have viscosity but could nonetheless experience friction. When moving rock comes into contact with fluids, it should exert pressure that equals the force required to decelerate the rock, which, if the rock has a very large mass or high velocity would be a lot. The result would be a big splash of fluid flying out in all directions, even up Z level just to move the fluid under such high pressure. The rock itself would experience massive internal stress and perhaps decompose into rubble. Regarding pressure, I think the location of each tile or perhaps rather each border between tiles, that by some event has triggered it to become into a state of pressure imbalance could be put into a priority queue, associated with the direction and magnitude of the pressure, as well as the velocity of the flow, which is to be accelerated by the pressure (and decelerated by the viscosity) The higher the velocity, the more often the fluid has to be moved across the border, and so a smaller time interval is to be added onto the current tick count pushing the element back into the queue, until pressure balance is achieved again, which the viscosity will achieve, as well as the even spreading as a side effect.
Title: Re: Volume and Mass
Post by: keda on August 02, 2010, 07:59:48 pm
Btw, I'm thinking that a large parts of a constantly flowing river (the parts that are not in bends or bottlenecks) would actually be in a state of balance, i.e. that influx would equal outflux which means no acceleration, yet water flows through the tile. I'm not sure if this should be represented somehow, like it is now, as water flows very unevenly now. Slow moving water might not have to but fast moving water would experience turbulence.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 02, 2010, 08:10:13 pm
Btw, I'm thinking that a large parts of a constantly flowing river (the parts that are not in bends or bottlenecks) would actually be in a state of balance, i.e. that influx would equal outflux which means no acceleration, yet water flows through the tile. I'm not sure if this should be represented somehow, like it is now, as water flows very unevenly now. Slow moving water might not have to but fast moving water would experience turbulence.

Yes, actually, this is how I plan to make most water calculations become based upon bodies, and not iterative per-tile calculations.

Most water in a "stable state" of either sitting in a lake or flowing in a continuous loop, or at least flowing in a stream with a steady rate of flow should be computable as a single body.

I am also sure I can come up with some way to fudge pressure differences in a single body of water into something simpler, which is why I was talking about "swells" and "depressions", which would basically make differences in water pressures into a few addendum tags on a body of water that create temporary (or, if it were a waterfall pouring water down into a lake from above on one end, and a sink draining water on the other end of the lake, it could be a permanent stable-state swell and depression pair) flux in the water levels without having to guage the water on an individual level.

The problem is not in the "lakes" or the "rivers", but in the "spills", the times when water is spreading outward over formerly dry land, and looking for the lowest point.  This is the part that I was really trying to minimize the calculations on, but may have to just give up and eventually make it essentially iterative, but with an overall body push towards a certain direction.

Unfortunately, I have a few projects I'm juggling in this suggestion forum right now, though, and I'm a little preoccupied with the Improved Farming (and Class Warfare, and DFize and Procedural Forts), so I have put this problem off for a bit...
Title: Re: Volume and Mass
Post by: Soralin on August 03, 2010, 12:20:05 am
Yeah, and things like pools of water merging, like channeling into the bottom of a couple of lakes, and have them flow into some central chamber, or even just a small line of contact together.  Or if you dug a channel between a river and a lake.

Or a body of water splitting apart, like if you have a lake with a ridge down the middle just below the water surface, and put a drain on the bottom of one side of the lake, eventually the water level will go down to the point where you now have two separate lakes rather than one.

Or if you have some chamber of water, with a door in the side of a cliff, and open and close it quickly, leading to a quantity of water which is falling in mid-air without any connection to any other source of water.

You'd still have to keep track of each tile too where the water was, since you'd need to know it's borders, and everything else that it acts on, or that acts on it, is on the scale of tiles.

It looks like it could work well for steady-state things, but I don't know how well you could get it to handle changing situations.  I mean, for example, a good worst case scenario:  How well would this system handle digging a multiple tile wide channel into the side of a stream that is at a high elevation, wider than the flow of the stream can fill completely, and having the water flow down the nearby bumpy chaotic cliffside, falling in paths that would cause it to split, and re-merge, and overflow(leading to more splitting and merging), etc. as it goes down? :)
Title: Re: Volume and Mass
Post by: keda on August 03, 2010, 05:16:52 am
The way I see it, most spills will happen slowly, and the only fps threats would be when massive objects, rocks of fluid are dropped into one causing tsunamies. An even spread over a large area will however experience little pressure and thus even if a large number of these are on the priority queue the time interval at which they are pushed back into it is going to be very large for almost all of them. In addition, all flow is directed, so no more bubbles going back and forth pathing for holes to drop into which I think most of the current cpu issue is. In essence it isn't exactly an iterating through each tile solution, it is only going to check on a tile when it is actually going to accelerate/decelerate water.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 03, 2010, 07:58:49 am
It's actually less of a problem than you might think if a few special cases are resource-hogs.  After all, right now, ALL water motion is fairly resource-dependent, even the relatively stable-state stuff like a brook or the contents of murky pools that have slightly evaporated so that they aren't all a bunch of 7/7s.

Replacing this with something that makes most stable states resource-efficient with having a few rare events like having a rockslide into a lake still take up plenty of resources would mean that 98% of the time, you're seeing an FPS improvement.
Title: Re: Volume and Mass
Post by: VoidPointer on August 06, 2010, 10:52:26 am
Don't have time to read the entire thread right now (just read most of it), but a quick note on cave-ins: If we assume that non-structural objects (e.g. platinum bars) don't count, we don't have to continually recheck structural integrity. Only necessary when the map changes (e.g. mining, construction). This reduces the FPS hit.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 06, 2010, 12:44:43 pm
Well, I was thinking that something like, say, a 15 ton adult cave dragon or a few 5 ton adult elephants could put quite a strain on the floorboards.

Actually, I've been thinking about the way that stockpiles currently work, with bins and barrels largely being the only way to put more than one object in the same tile, even though most items, even large pieces of furniture, only take up 30 or so liters of volume.

We could, instead, have shelving.  Shelving could hold more furniture and even multiple bins in the same tile, but restrict movement.  Theoretically, if it goes by the same way containers currently work, you could put 10 bins with 10 items into a single tile, significantly reducing the giant layer-wide warehouse sprawls we currently get.  Even with all that you can put into a bin, such shelves would still be nowhere near filling entire tiles. 

Or we could make shelving actually capable of filling whole tiles... if the shelving itself took up a massive 1,000 liters, we could still fit 26,000 liters of materials into a single tile.  That's hundreds if not thousands of items.
Title: Re: Volume and Mass
Post by: Sunken on August 06, 2010, 01:37:29 pm
This is on the earlier topic of volume/mass of solid items, but...

Although an exact representation of volumes and masses makes the most sense and is most realistic (and probably won't be too hard to code), there's some validity to the viewpoint that all those numbers may look extremely ugly and off-putting. Make a granite ring, be left with a 149.997 kilogram rock? Sure, the weight might be hidden and only visible when explicitly examined - but in other cases, it may be desirable to determine the amount left in, say, a gold bar at a glance.

What I'm saying is we might need a cosmetic system of understandable quantities, preferably integral, even for bulk things. It is so much easier to wrap your head around things like 130 bushels of wheat, 40 carats worth of emeralds, 10 ounces of gold, than 3472.3 kg, 0.007496 kg, 0.2835 kg (or whatever). Plus it sounds more fantasy-like.

The units would be determined by the good, as well as the amount (after all, "240 kg of gold" is preferable to "8466 ounces"). The internal representation could still remain the same. The advantages to that are obvious. The disadvantage might be that if the amount is rounded up, the player might think he has enough gold for something when in fact he doesn't quite. Always rounding down is one solution, switching to a smaller unit if the number gets too small.

So, a one-tile wall might require "1 cubic meter of granite" whilst a granite earring might require "1 ounce of granite" which should satisfy those who like neat numbers.

Edit: I'm all for the SI system ordinarily, it's just that for a game I agree that integers are far more tractable and comfortable, plus the time period is one where units were very much adapted to what they measured.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 06, 2010, 02:28:17 pm
Well, SI units would at least put everything in a single format, so you could know that 500 liters of wheat was just as big as 500 liters of stone. 

Still, it wouldn't be a bad idea to have seperate units for different types of objects, provided this was still represented in terms of SI somewhere, so that you could see whether 10 bushels of wheat was larger than a barrel constructed to contain 30 liters of material.

Likewise, even if it was represented in "bushels" it would still be measuring "3427.6 kg" of material, it would just be with a different name.  Currently, the game just truncates all fractions.  So we have a 17 "Gamma" bar of copper, which is invisibly 2 liters of copper.

One of the other things about the original suggestion of making everything in these units is that it would treat stacks, differently, though.  You don't have just a single "stone" of 70 liters, you have 70 liters of stone, and if you take 5 liters off of it, and then dump it in a stockpile with another 70 liters of the same kind of stone, it becomes 135 liters of that type of stone.  (The game doesn't necessarily have to care whether it is contiguous stone or not.)

That means that either volume or mass would replace what we have for stacks currently with regards to most raw materials.  (You'd still count things like bolts, earrings, and coins as discrete objects.)  Hence, you would be able to tell at a glance how much gold you have leftover, in liter form.  (Or ounces or whatever if you throw some kind of conversion into it.)
Title: Re: Volume and Mass
Post by: G-Flex on August 06, 2010, 04:14:19 pm
That means that either volume or mass would replace what we have for stacks currently with regards to most raw materials.

The rest of your post seems reasonable, but this is seriously pretty disagreeable. Unless you're going to be melting something down, then particle size (for lack of a better term) matters. You're not going to turn gravel into a stone throne the same as you would carving it out of large rock, or make a statue out of it. Size of individual items matters for most applications.


Besides, what happens if you want to, say, pick up and throw the object in adventure mode? All you know is that there's N liters of stone on the ground. Can you just pick off arbitrarily sized chunks without having to break them apart? Can you pick up 3 liters of stone out of a 30-liter pile even if it was all one contiguous chunk before? The game needs to know which discrete objects are actually there.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 06, 2010, 04:43:10 pm
Well, there needs to be two tiers of how objects work - bolts are obviously distinct objects, but I do believe it would be better for the game in general if we had some materials that, for lack of a better description, behaved like silly putty, and could adhere and automatically stack with one another. 

A pile of grain or meat should not care about "granular size", it's just x mass of grain or meat.

While it starts to defy reality, I do believe that metal, stone, and wood should behave in a similar method - You don't need to have solid bars of steel, you just need a certain mass of steel.  Rather than consuming whole logs, or having fractions of log left over, you just have overall quantities of wood, and don't have to care about making sure you have a single chunk of wood that is large enough to make a tabletop from one whole piece.  Stone, likewise, should be meldable, if only to reduce the number of individual items being tracked by the game - hundreds of thousands of stones will kill FPS, but a few hundred stones that are measured in terms of a few thousand liters of stone will not hurt FPS in quite the same way.

Adventurer mode rocks, however, can simply be treated like bolts or earrings or whatever, there are specific numbers of individual rocks you can throw or knap into sharpened rocks. 

As for breaking off arbitrary chunks of stone, they can just use the same tools that stonemasons use when they craft stone mugs or tables or chairs - their bare hands.  :P
Title: Re: Volume and Mass
Post by: G-Flex on August 06, 2010, 05:16:22 pm
A pile of grain or meat should not care about "granular size", it's just x mass of grain or meat.

I wouldn't be so quick to say that. For one, it actually might matter for items prepared from them, and secondly, of course it matters how big the individual chunks of flesh are, otherwise how much can a character just pick up sans tools?

[/quote]While it starts to defy reality, I do believe that metal, stone, and wood should behave in a similar method - You don't need to have solid bars of steel, you just need a certain mass of steel.  Rather than consuming whole logs, or having fractions of log left over, you just have overall quantities of wood, and don't have to care about making sure you have a single chunk of wood that is large enough to make a tabletop from one whole piece.  Stone, likewise, should be meldable, if only to reduce the number of individual items being tracked by the game - hundreds of thousands of stones will kill FPS, but a few hundred stones that are measured in terms of a few thousand liters of stone will not hurt FPS in quite the same way.[/quote]

If items are stacked, there are perhaps better ways to consolidate the data.

Quote
Adventurer mode rocks, however, can simply be treated like bolts or earrings or whatever, there are specific numbers of individual rocks you can throw or knap into sharpened rocks.

Except you'd need to apply it to rocks, metal, meat, and damn near everything else you're talking about. And then you'd have the different game modes keeping track of different item types entirely. That, to me, is insane. There's not even any reasonable way to convert between the two.


I understand that there are some issues at play here, like better tracking of precise measurements (which is very possible), and issues involving things like whether or not a tiny chunk of leftover wood can go towards making a table, but I feel that your solution causes far more problems than it solves.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 06, 2010, 07:12:00 pm
I wouldn't be so quick to say that. For one, it actually might matter for items prepared from them, and secondly, of course it matters how big the individual chunks of flesh are, otherwise how much can a character just pick up sans tools?

Actually, this would be a good way to force the solution to those problems: I remember that one of the ways to make multi-million DB stacks of food was to simply abuse the almost limitless stacking ability of milk in a barrel to create stacks containing many thousands of units of food.

The limits on how much food can be in a prepared meal should be set to a finite meal size.  Basically, a prepared meal should be based not just on number of ingrediants, but also on matching a specific meal size, so all "roasts" would be, say, 500 liters of food.

If items are stacked, there are perhaps better ways to consolidate the data.

Except you'd need to apply it to rocks, metal, meat, and damn near everything else you're talking about. And then you'd have the different game modes keeping track of different item types entirely. That, to me, is insane. There's not even any reasonable way to convert between the two.

I understand that there are some issues at play here, like better tracking of precise measurements (which is very possible), and issues involving things like whether or not a tiny chunk of leftover wood can go towards making a table, but I feel that your solution causes far more problems than it solves.

What is the problem, exactly? 

I'm not saying that Adventure Mode should track metal differently than Dwarf Mode - if Adventurers pick up metal, they can carry metal of fungible granularity, as well. 

If you are confused by my talking about "rocks" as individual items and "stones" as fungible masses, keep in mind that the game treats them as two entirely different types of objects already, related only by the material that comprises them.  Rocks basically don't exist in Fortress mode, while stones basically don't exist in Adventure mode, at least until Adventurers start getting the ability to start mining.  As such, this already IS different between the two game types.
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 02:28:37 am
How about this:
There are three basic types of item - individual, stackable, and bulk.
Individual items have variable sizes and weights and don't stack.
Stackable items have a constant per-type size and weight each, and stack.
Bulk items are so small (grains of sand or flour) that they're simplified to only weight and volume.

Now, that's nothing new. But let's consider expanding the stackable category to a higher "resolution" of unit sizes. I feel this would allow us to both retain simplicity and gain realism.
For example, wood might exist in the following stackable levels:
Logs, all of the same size (a given tree might produce more than one) and the same weight (dependent on wood type; different types don't stack)
Planks, all of the same size and weight, obtained by sawing up a log
Blocks, ditto - smaller than planks
Smaller units of wood could be treated as bulk: Firewood (usable for burning or making charcoal), sawdust (I don't know if that's useful for anything - bedding?)

(This makes cutting down a tree a bigger deal. Several logs, plus probably a lot of loose firewood from branches, making for many planks or blocks. Of course, carpentry would require more than one plank or block to make something. And bigger items would require more planks than smaller ones.)

For stone:
Slabs - individual level massive stone blocks, suitable for construction or sculpture (obtained by time-consuming meticulous quarrying)
Blocks - brick-sized stone blocks, all same size, suitable for construction or road laying (obtained by somewhat faster quarrying)
Rocks - brick-sized stone chunks, of irregular shape (but treated as all the same size for stacking purposes), suitable for filling, rough walls, ballast etc.
Gravel - small stone bits of irregular shape (but treated as all the same size for stacking purposes), suitable for smelting, rough road covering, slingshot ammo etc.

Now, we could treat "Rocks" and "Gravel" as bulk, because who wants "11239 gravel" in their report - but we could just as easily present them by bulk units when it suits us and as single units when we want to. Typically when dealing with small numbers you'd present them as counts, but with large ones as bulk: "This tile contains 1.2 tons of sandstone rocks", "This tile contains 3 sandstone rocks". The underlying representation would be the same.

The upshot is, we will still have single units of most things. Recipes, reactions, and crafts can still be specified in whole numbers of raw material items, so we don't have to worry about leaving fractions behind where it doesn't make sense. We can avoid floating-point representations (not that those are strictly necessary for an all-bulk representation). We can maintain the constancy of mass (with some small losses in going from one unit to another, but that can be compensated for if we want). And we can present things to the user in a way that fits the situation.

Of course, all this presupposes better hauling. I know that. Let's assume we get it at some point.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 07, 2010, 08:03:53 am
There should only be two kinds: Individual and Bulk.

The ability to only need .5 liters of a bar of metal or only 20 liters of wood is the entire point of all this.  If you aren't allowing people to store the remaining 30 liters of wood and use it for some other building project, what was the point of doing all this in the first place?

Also, one of the beautties of this system is that it would allow us to no longer be forced into having every tree be exactly 50 liters of wood in a log.  Why should trees grow just to make a jump from 1 50 liter log to 2 50 liter logs when we are now measuring wood by the liter and not by the log?  We can have 78.42 liters of wood come from a tree now that we have exact units.

So by using the method of making there be planks and logs (which, if all logs and planks are the same size, what's the difference between the two, anyway, other than just adding a step between using logs), then we still have to use large units that take up entire logs/planks to make furniture or bracelets, regardless of actual object size (which defeats the whole purpose of the thread), and then we finally get the fungible granularity on items that you even outright say have no actual use, which, again, completely defeats the purpose.

With stone, again, the purpose is to make stone no longer a matter of "a 27,000 liter tile of solid rock magically turns into one single 70 liter "stone" object at the tap of a pick that no longer blocks a pathway, and a dwarf can carry in one hand back to the stockpile".  I would actually make the stone that is produced into varying sizes based on miner skill, and making all the rest into "mullock" that has to be carted away.

When building wooden or stone objects, to represent that not every piece will be exactly the right size, we can make dwarves take extra units of the materials they are working with that turn to sawdust and mullock and shavings of metal and scraps and raw gems can be reduced in size based upon the skill roll of the gemcutter.  This generally builds up as clutter until it gets swept away by a hauler to wherever you are dumping such things.

One of the things I'd actually look forward to is having such waste actually start being capable of producing landfills.  Enough mullock or the like can make cubes of the junk that become actual tiles of "wall" again, provided it is compressed enough.  It could make fortresses start looking like anthills, with the crap they dig out of a mountain, instead of just dissapearing, rather just being tossed outside the hole, unless they find some other way to dispose of the stuff.  ("Hello, our brother dwarves who have come to trade! Want some of our lovely mullock?") ("Where should I put all this cinnibar mullock?" "Just dump it in the stream downriver." "Isn't this stuff poisonous in water?" "Yeah, but only elves live downstream." "Oh, right.")

Yes, this is an abstraction in an otherwise fairly exact suggestion, but it is a necessary abstraction to achieve the point of the suggestion. 
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 10:25:10 am
Boo-hoo, I'd spent 15 minutes writing a reply and then I clicked "back" by mistake and lost it :(((
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 10:48:24 am
OK, short version.

There should only be two kinds: Individual and Bulk.
You're So wrong! :)

Quote
The ability to only need .5 liters of a bar of metal or only 20 liters of wood is the entire point of all this.  If you aren't allowing people to store the remaining 30 liters of wood and use it for some other building project, what was the point of doing all this in the first place?
The granularity would be chosen such that the waste wood would always be a realistic amount. Plus it would become bulk firewood, which can't be used for crafting but can still be used for fuel. This will also help make firewood less valuable than refined wood, reducing the pain players feel when giving their precious wood to the charcoal burner.

Quote
Also, one of the beautties of this system is that it would allow us to no longer be forced into having every tree be exactly 50 liters of wood in a log.  Why should trees grow just to make a jump from 1 50 liter log to 2 50 liter logs when we are now measuring wood by the liter and not by the log?  We can have 78.42 liters of wood come from a tree now that we have exact units.
What about the difference between 13 and 14 logs? Not such a big deal then? It's all a matter of how you choose your unit sizes. Plus the rounded-off liters would still be usable, as firewood (actually, there should be more waste wood than that but that can be accommodated easily enough).

Besides, you don't want individual-size logs for your palisade, wood bridge or fence.
Making logs bulk also begs the question - what does e.g. 0.5 liters of wood logs look like?

You might say "it's all just 0.5 liters of wood" and I say sure, but
1: doesn't "2 blocks / five planks / three logs" give a clearer and nicer picture? (That can be dealt with in the interface, as I suggested earlier in the thread, but it still seems odd to me to sweep up the workshop after the day's end and voilà - you have a nice plank formed from the sawdust)
2: making logs, planks and blocks actually different items, gameplay-wise, just as iron, pig iron and steel are, would be adding to the realism and gameplay of the game. More maintenance but it's hardly an unprecedented level of detail!

Quote
So by using the method of making there be planks and logs (which, if all logs and planks are the same size, what's the difference between the two, anyway, other than just adding a step between using logs),
See 2, above

Quote
then we still have to use large units that take up entire logs/planks to make furniture or bracelets, regardless of actual object size (which defeats the whole purpose of the thread), and then we finally get the fungible granularity on items that you even outright say have no actual use, which, again, completely defeats the purpose.
Again, we shouldn't pick stupid granularities.
And differentiating between craftable refined wood and bulk, uncraftable firewood does not defeat the purpose: it enriches the game by dividing wood into (at least) 2 levels - one relatively precious commodity and one much less so.

Quote
With stone, again, the purpose is to make stone no longer a matter of "a 27,000 liter tile of solid rock magically turns into one single 70 liter "stone" object at the tap of a pick that no longer blocks a pathway, and a dwarf can carry in one hand back to the stockpile".  I would actually make the stone that is produced into varying sizes based on miner skill, and making all the rest into "mullock" that has to be carted away.

Now you're speaking my language! Of course, I'd make the stone into big "individual" slabs, for statues, stone doors, altars and whatnot, where the size is dependent on skill - or equally-sized "bricks" for construction or stone crafts, where it is the ratio of brick to "mullock" that is given by the skill level.

Quote
When building wooden or stone objects, to represent that not every piece will be exactly the right size, we can make dwarves take extra units of the materials they are working with that turn to sawdust and mullock and shavings of metal and scraps and raw gems can be reduced in size based upon the skill roll of the gemcutter.  This generally builds up as clutter until it gets swept away by a hauler to wherever you are dumping such things.
You're suggesting an all-purpose waste item? Hm, but gold filings are not the same as firewood, and neither are the same as rock dust. They're still valuable in different ways. I'd keep them separate - and separate from their corresponding, refined versions.

Gems, by the way, I feel should never be stackable - any bits coming off a gem when fitting or shaping it would become other, lesser gems or gem dust (which may or may not be just "waste")

Quote
One of the things I'd actually look forward to is having such waste actually start being capable of producing landfills.  Enough mullock or the like can make cubes of the junk that become actual tiles of "wall" again, provided it is compressed enough.  It could make fortresses start looking like anthills, with the crap they dig out of a mountain, instead of just dissapearing, rather just being tossed outside the hole, unless they find some other way to dispose of the stuff.  ("Hello, our brother dwarves who have come to trade! Want some of our lovely mullock?") ("Where should I put all this cinnibar mullock?" "Just dump it in the stream downriver." "Isn't this stuff poisonous in water?" "Yeah, but only elves live downstream." "Oh, right.")

Yes, this is an abstraction in an otherwise fairly exact suggestion, but it is a necessary abstraction to achieve the point of the suggestion.
I think that both our systems are about equally easy to implement. I still think that even a non-discrete representation should present amounts in discrete units where possible. As to whether you prefer absolute control over amounts of waste material (which your system provides) or one where you can't make a whole log out of thirty end pieces (mine) is, I guess, a matter of taste.
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 10:55:58 am
About wood blocks: I only just now realized that we already have wood blocks :) And that they're pretty big!
What I meant was a smaller unit than a plank, and more suited to carving. You'd get many blocks from a log; a toy or flute might require a single block, a wooden sword perhaps two.
Still, if one block was necessary to make one earring, there'd be a lot of waste wood. One could add a smaller granularity unit still, but that's overdoing it. The best way of dealing with stuff that's too small to take up a whole unit is to make each unit produce more than one item: one block->tree crossbow bolts, four bracelets, ten earrings.
Goes the same for other stuff as well. One brick - two mugs; one elephant brain - 10 hamburgers.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 07, 2010, 11:39:34 am
So that was the short version?

Somehow, rewriting things into short versions always seems to make them longer...

You're So wrong! :)
No I'm not.

Glad we had this disucssion.  I'm sure that settled everything. :)

The granularity would be chosen such that the waste wood would always be a realistic amount. Plus it would become bulk firewood, which can't be used for crafting but can still be used for fuel. This will also help make firewood less valuable than refined wood, reducing the pain players feel when giving their precious wood to the charcoal burner.

What about the difference between 13 and 14 logs? Not such a big deal then? It's all a matter of how you choose your unit sizes. Plus the rounded-off liters would still be usable, as firewood (actually, there should be more waste wood than that but that can be accommodated easily enough).

We COULD make whatever arbitrary units we wanted to... but we already have REAL units in the game.  Why not just use them?  There's also no reason to make there be 5 different types of wood, and then make 4 of those types useless, especially when the objective was to be more precise.

Besides, you don't want individual-size logs for your palisade, wood bridge or fence.
Making logs bulk also begs the question - what does e.g. 0.5 liters of wood logs look like?

Like a small 2x2?  But more importantly:  Who cares?  See next:

You might say "it's all just 0.5 liters of wood" and I say sure, but
1: doesn't "2 blocks / five planks / three logs" give a clearer and nicer picture? (That can be dealt with in the interface, as I suggested earlier in the thread, but it still seems odd to me to sweep up the workshop after the day's end and voilà - you have a nice plank formed from the sawdust)
2: making logs, planks and blocks actually different items, gameplay-wise, just as iron, pig iron and steel are, would be adding to the realism and gameplay of the game. More maintenance but it's hardly an unprecedented level of detail!

Again, "Who Cares?"  The objective here isn't to make every single strip of wood individual and important.  That is, in fact, the exact opposite of the objective I have: Making wood a resource that you think about only in the abstract: You don't care about how many 2x4 planks of wood you have as opposed to 2x2 planks or flat surface planks of wood.  When you go to the stocks screen, all you want to hear is "We have ____ metric tons of wood, and current production will yield ____ tons per year and consume ____ tons per year."  (Of course, DF is not that detailed... yet.)

We are running this fortress at the "macro" scale, and not only do not but can not be concerned with every loose pebble in the fort. 

Breaking this down into using smaller units means that different projects will consume wood at different rates, but at the same time, allow us to consolidate wood into amorphous lumps of "usable wood" mass that we can check at a glance to see how much the workshops will be capable of producing.

You're suggesting an all-purpose waste item? Hm, but gold filings are not the same as firewood, and neither are the same as rock dust. They're still valuable in different ways. I'd keep them separate - and separate from their corresponding, refined versions.

No, although mullock, which is a term for waste generally, but also "the leftover rock once the ore has been extracted" was being used for all stone that cannot be used in general could also be used for general waste when you are compressing it all together, since 95% of the waste of most fortresses are just leftover chunks of stone from mining operations... at CURRENT levels of mining.  With even more waste being produced, as some arguments for "more realistic mining" go, almost every single tile you mine will be another full tile of material you have to consolidate into another part of the map. 

Like a real life digger, the stuff you dig away doesn't just dissapear, and you have to find a place to put it (and by compressing it into a full "wall" tile, it would hopefully be capable of not taking up any more CPU time than any natural wall would, if Toady would be as kind as to code that.)

I think that both our systems are about equally easy to implement. I still think that even a non-discrete representation should present amounts in discrete units where possible. As to whether you prefer absolute control over amounts of waste material (which your system provides) or one where you can't make a whole log out of thirty end pieces (mine) is, I guess, a matter of taste.

The purpose of what I am proposing is both to reduce the number of small loose individual items floating around in the game through proper stacking (wood just melds into other wood, making a larger "wood pile" that does not have to be tracked as individual pieces, and stones do not have to be uncontrolled rubble lining your entire fortress, they can be rolled up into stacks of usable stones, or ejected into useless mullock dumping ground.

This saves on processor power, and saves on player need to care about the specifics of the exact dimensions of one specific plank of wood not being long enough to make a table, so 3/4s of your wood pile is completely useless for table making.
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 12:17:19 pm
We COULD make whatever arbitrary units we wanted to... but we already have REAL units in the game.  Why not just use them?  There's also no reason to make there be 5 different types of wood, and then make 4 of those types useless, especially when the objective was to be more precise.
Who said anything about 4 being useless? You're making things up, stop it.
Also, being more precise is only one objective. There's also the objective of being aesthetically pleasing, realistic, and computationally feasible. Your system only helps with precision. (Briefly: Realism: putting logs together from bits. Aesthetically pleasing: the manageable integer units. Computationally feasible: Fragmentation, see below)

Quote
Again, "Who Cares?"  The objective here isn't to make every single strip of wood individual and important.  That is, in fact, the exact opposite of the objective I have: Making wood a resource that you think about only in the abstract
We'll just have to agree to disagree, then. You probably like Settlers of Catan better than Warhammer, too :) I don't want my wood abstract. I want it manageable, but not abstract. That's not the feel of Dwarf Fortress, in my opinion. I don't want to to run my fortress at a macro scale, or rather, I want to be able to look at dwarfs as individuals doing concrete tasks - if I feel like it. It's nice not to have to babysit them, of course.

Quote
Breaking this down into using smaller units means that different projects will consume wood at different rates, but at the same time, allow us to consolidate wood into amorphous lumps of "usable wood" mass that we can check at a glance to see how much the workshops will be capable of producing.
I agree. I just don't think we need to break the units down smaller than they would be in reality.

Quote
The purpose of what I am proposing is both to reduce the number of small loose individual items floating around in the game through proper stacking (wood just melds into other wood, making a larger "wood pile" that does not have to be tracked as individual pieces, and stones do not have to be uncontrolled rubble lining your entire fortress, they can be rolled up into stacks of usable stones, or ejected into useless mullock dumping ground.
Yes; how is that any different in my system?

Quote
This saves on processor power, and saves on player need to care about the specifics of the exact dimensions of one specific plank of wood not being long enough to make a table, so 3/4s of your wood pile is completely useless for table making.
You sound as though I was suggesting every item be "individual". Have you not been reading what I've written?

A stack of identical planks takes less space to store in memory than a milliliter-precise abstract wood pile.
As long as crafts require whole planks, there will never be any problem with having planks of the wrong size. In your system, however, you might find a stockpile with 98 100ths of a table's worth of wood - in effect precisely a slightly too short plank. Don't you think the player will be more irritated by that than by being a whole plank short?
Besides, there's the risk of fragmentation. You might find your wood stockpile has 0.013 liters of wood in each tile, left over from a dwarf who picked up only just as much as he needed. That's going to be a pain in several ways. There'll never be less than a whole plank in a stack, and since it's still a useful amount it will not be left alone forever.
(I'd still get fragmentation for firewood etc., of course, so we'd need something against that anyway.)

I accept that your main motivation is abstraction. I just don't feel it's a worthwhile goal, and I also think that my system is superior for realism and performance.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 07, 2010, 01:38:04 pm
You sound as though I was suggesting every item be "individual". Have you not been reading what I've written?

I am, and this is what you are talking about.

A stack of identical planks takes less space to store in memory than a milliliter-precise abstract wood pile.

Actually, no, it doesn't.  A wood pile is, as far as I would guess without actually seeing the code, just a pointer to a set of materials data combined with an integer for the purposes of counting how large the stack is.  The specific unit that is used to track this aside, the game already does keep track of this with its invisible volume multiplier, and its displaying mass as a derivation from the density value in the materials raw.  Although perhaps the size of the integer data type might be made larger or smaller (such a thing would be dangerous, because it could potentially open up overflows, so I don't know exactly how Toady will balance this), basically, if you have an Int datatype that reads "1" it takes up the exact same amount of memory as "10,000,000".


As long as crafts require whole planks, there will never be any problem with having planks of the wrong size. In your system, however, you might find a stockpile with 98 100ths of a table's worth of wood - in effect precisely a slightly too short plank. Don't you think the player will be more irritated by that than by being a whole plank short?
Besides, there's the risk of fragmentation. You might find your wood stockpile has 0.013 liters of wood in each tile, left over from a dwarf who picked up only just as much as he needed. That's going to be a pain in several ways. There'll never be less than a whole plank in a stack, and since it's still a useful amount it will not be left alone forever.

Such a problem only occurs when you literally have only 19 liters of a type of wood in your entire fort.  That wouldn't be much different than having 5 planks of wood if you arbitrarily make them take 6. 

Having only a scrap of wood leftover is the same as having only sets of 1 plank in multiple places.

Like I said before, if you're talking about making all planks the same size, then you're simply making them all the exact same set of arbitrarily defined unit sizes that just happen to be ambiguously larger than my own.  This is basically the same as what one of the other people said about just making trees give 100 wood every time, and make tables take 40 wood - you're just changing the size of the units arbitrarily... so why not just make them the SI units that the rest of the game runs on, and be done with it?

You'd still have the exact same problems of haivng random piles with just one scrap plank left over, so you'd still have to use code where, if dwarves need X amount, but can only find 1/X amount in any given spot, they'd have to collect the scraps and put them together until you managed to glob together enough to start work.

Quote
(I'd still get fragmentation for firewood etc., of course, so we'd need something against that anyway.)

I accept that your main motivation is abstraction. I just don't feel it's a worthwhile goal, and I also think that my system is superior for realism and performance.

Then you go and blow it up...  You see, now you're adding even more types of objects for the game to track, and making players care about more individual stockpile levels for no particular reason... and then claiming it is somehow more efficient or realistic when you are simply using a different sized unit than I am using!
Title: Re: Volume and Mass
Post by: Sunken on August 07, 2010, 03:54:00 pm
You sound as though I was suggesting every item be "individual". Have you not been reading what I've written?

I am, and this is what you are talking about.
I thought I was talking about the stackable types this whole time, exclusively. That's what I meant to, anyway.

Quote
A stack of identical planks takes less space to store in memory than a milliliter-precise abstract wood pile.

Actually, no, it doesn't.  [...] basically, if you have an Int datatype that reads "1" it takes up the exact same amount of memory as "10,000,000".
All right, I should have said "potentially". An integer in the range, say, 0 to 100 (a high upper limit on the number of planks that would fit in any tile) needs less space - in principle - than what would be needed in your system. But it might be more trouble programming than it's worth. It's a minor point either way.

Quote

As long as crafts require whole planks, there will never be any problem with having planks of the wrong size. In your system, however, you might find a stockpile with 98 100ths of a table's worth of wood - in effect precisely a slightly too short plank. Don't you think the player will be more irritated by that than by being a whole plank short?
Besides, there's the risk of fragmentation. You might find your wood stockpile has 0.013 liters of wood in each tile, left over from a dwarf who picked up only just as much as he needed. That's going to be a pain in several ways. There'll never be less than a whole plank in a stack, and since it's still a useful amount it will not be left alone forever.

Such a problem only occurs when you literally have only 19 liters of a type of wood in your entire fort.  That wouldn't be much different than having 5 planks of wood if you arbitrarily make them take 6. 

Having only a scrap of wood leftover is the same as having only sets of 1 plank in multiple places.
In a sense, but not in another. 1 plank piles are still an useful amount of wood. Piles of 4 grams of wood are useless for everything, on their own, and you'd get them all the time unless the amounts taken out are precisely such that it evens out.

Look, take this example. You have a stockpile with N tiles, all of which contain a sizable amount of wood. Now your craftsdwarfs start to take wood out, in varying chunks. As soon as any one pile contains less wood than is needed by any of the ongoing crafts, it's ignored, as the dwarfs grab all they want in one go from the other tiles.
In the end, you're left with N tiles with more or less tiny amounts of wood, and in the worst case a dwarf might have to go to each one of them to pick up enough wood for one final craft item. More importantly, they're still taking up memory and making it look like the stockpile's full (depending on visualization).
Now the same case with planks. In the worst case, we'd be left with 1 plank in each tile, and a dwarf will have to visit M tiles, where M is the number of planks he needs. M will be smaller than N usually, and its upper bound is given by the raws, not by the player's layout. That's a quantitative advantage of this discretization.

But in practice, with planks, we'd have to be unlucky to get something left in every stockpile tile. If we're crafting things of different sizes, and typical plank requirements are, say, 1-5 planks, then by the time we run out of full tiles, the smaller batches will have eaten up many of the piles completely (since they will be closer to the workshop). Conversely, with your system you'd have to be very lucky not to have something left in every tile - unless you tweak the amounts used just so (which will amount to discretizing them anyway, so why not do it explicitly?).

Quote
Like I said before, if you're talking about making all planks the same size, then you're simply making them all the exact same set of arbitrarily defined unit sizes that just happen to be ambiguously larger than my own.  This is basically the same as what one of the other people said about just making trees give 100 wood every time, and make tables take 40 wood - you're just changing the size of the units arbitrarily... so why not just make them the SI units that the rest of the game runs on, and be done with it?
As I said before: for the potential computational savings, for the realism (i.e. the units correspond to real-world things that can't be divided and re-assembled without doing actual work) and for the aesthetics (having numbers and units that can be easily grasped, though - again - that can be grafted onto your system, too).

Quote
You'd still have the exact same problems of haivng random piles with just one scrap plank left over, so you'd still have to use code where, if dwarves need X amount, but can only find 1/X amount in any given spot, they'd have to collect the scraps and put them together until you managed to glob together enough to start work.
Less often, less piles, less steps necessary to gather up enough material, as I tried to illustrate above. Quantitative differences, and relying on reasonably chosen unit sizes, obviously.


Quote
Quote
(I'd still get fragmentation for firewood etc., of course, so we'd need something against that anyway.)

I accept that your main motivation is abstraction. I just don't feel it's a worthwhile goal, and I also think that my system is superior for realism and performance.

Then you go and blow it up...  You see, now you're adding even more types of objects for the game to track, and making players care about more individual stockpile levels for no particular reason... and then claiming it is somehow more efficient or realistic when you are simply using a different sized unit than I am using!

Hey, you have to decide here - if you criticize me for simply using a different sized unit, then you can't also complain that I'm adding more object types!

If we did introduce a real gameplay difference between, say, logs, planks and firewood, then that's a qualitatative change that goes beyond just dealing with volumes of objects. Maybe we should discuss those things separately. Above I tried to explain why I think volume discretization should be coarser than you seem to want (though finer than it is now).

Wanting planks to actually work differently from firewood is another matter. I think it has merits, which I've mentioned earlier. You dismiss it as being introduced "for no particular reason", but you could dismiss pig iron or stone blocks on the exact same grounds. Pig iron certainly has less gameplay effect than planks would.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 08, 2010, 03:15:39 pm
Hey, you have to decide here - if you criticize me for simply using a different sized unit, then you can't also complain that I'm adding more object types!

No I don't.  Not when you are arguing for something that is functionally just a different arbitrary unit size than we have right now as if it were a game-changer and arguing for multiple types of objects that serve the same purpose, or else are generally useless. 

In fact, let's illustrate this point by going back to this little gem:
You might say "it's all just 0.5 liters of wood" and I say sure, but
1: doesn't "2 blocks / five planks / three logs" give a clearer and nicer picture?

OK, so what you are honestly attempting to convince me of is that "57 kg of Maple Wood" is more confusing than "2 blocks of Maple Wood, 5 planks of Maple Wood, 3 Logs of Maple Wood, 3 kg of Maple Sawdust, 6 kg of Maple Firewood" in a stack?  Now then, kids, get out your calculators, because blocks are worth 3.5 times as much as planks, and logs are worth 20 times planks.  Firewood is only useful for charcoal, but you have to convert it at a 10 kg to 3 plank ratio for determining how much charcoal you can make.  Plus, blocks aren't useful in making certain items, so you have to subtract that number out when you are figuring out how many tables you can make, but you DO still have to add in the logs.

Or, you know, you can say, "Hey, 57 Wood! I know how much that is, and how much I can do with it instantly just by looking at one number!"
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 08, 2010, 03:25:28 pm
In a sense, but not in another. 1 plank piles are still an useful amount of wood. Piles of 4 grams of wood are useless for everything, on their own, and you'd get them all the time unless the amounts taken out are precisely such that it evens out.

Look, take this example. You have a stockpile with N tiles, all of which contain a sizable amount of wood. Now your craftsdwarfs start to take wood out, in varying chunks. As soon as any one pile contains less wood than is needed by any of the ongoing crafts, it's ignored, as the dwarfs grab all they want in one go from the other tiles.
In the end, you're left with N tiles with more or less tiny amounts of wood, and in the worst case a dwarf might have to go to each one of them to pick up enough wood for one final craft item. More importantly, they're still taking up memory and making it look like the stockpile's full (depending on visualization).
Now the same case with planks. In the worst case, we'd be left with 1 plank in each tile, and a dwarf will have to visit M tiles, where M is the number of planks he needs. M will be smaller than N usually, and its upper bound is given by the raws, not by the player's layout. That's a quantitative advantage of this discretization.

But in practice, with planks, we'd have to be unlucky to get something left in every stockpile tile. If we're crafting things of different sizes, and typical plank requirements are, say, 1-5 planks, then by the time we run out of full tiles, the smaller batches will have eaten up many of the piles completely (since they will be closer to the workshop). Conversely, with your system you'd have to be very lucky not to have something left in every tile - unless you tweak the amounts used just so (which will amount to discretizing them anyway, so why not do it explicitly?).

You see, maybe you don't realize it, but you're arguing that "your system" is better than the current system... because its units are some arbitrary, undefined smaller unit! 

THEN, you argue "your system" is better than mine... because the units are some arbitrary, undefined LARGER unit!

The whole argument you are making is that I'm somehow asking for the game to measure down to the picometer, and then offer your idea up as a Golden Mean (http://tvtropes.org/pmwiki/pmwiki.php/Main/GoldenMeanFallacy) between these two "negative extremes". 

Now then, let's look at the way that the game actually works.  Dwarves will prefer (potentially very heavily) to stack items of the same sort if they can at all help it.  With fungible piles of wood, this means that they will continue putting every single scrap of wood they can find into one pile until the pile hits whatever it's arbitrary "full" size is, at which point, they start up the next pile, probably directly next to the first.  When some wood needs to be added to the pile, they place it in the partially-full tiles first.  When wood is taken from the pile, they go to whichever is closest first, which is probably the same tile they took from last time, which cleans up those fractions leftover if there were any rather nicely before they move on to the next pile.

There, problem solved.  All by the mechanics that are already currently in the game.
Title: Re: Volume and Mass
Post by: cameron on August 08, 2010, 03:56:04 pm
what could work is that everything is stored as a unit of the material as per suggestion but every action has a say 1 in 10 chance of producing a certain amount of scrap material. metal scrap could just be melted down again but rock and wood would be suitable for very little perhaps only paving and burning respectively. The chance could be raised with larger constructions. Ideally this would give similar results as tracking logs/large rocks and calling them scrap when they reach a certain size.

to be clear though this would not mean your dwarves would fail to make something just that they would waste additional materials. perhaps the chance could correlate with quality and skill.
Title: Re: Volume and Mass
Post by: Sunken on August 08, 2010, 04:37:23 pm
Hey, you have to decide here - if you criticize me for simply using a different sized unit, then you can't also complain that I'm adding more object types!

No I don't.  Not when you are arguing for something that is functionally just a different arbitrary unit size than we have right now as if it were a game-changer and arguing for multiple types of objects that serve the same purpose, or else are generally useless. 
I have been arguing two parallel suggestions from the start. One is just using larger minimal size increments, one proposes functional differences. It's the latter that's a game-changer. The former just improves on the current system. Yours does too, we just don't agree which does the most.

Quote
In fact, let's illustrate this point by going back to this little gem:
You might say "it's all just 0.5 liters of wood" and I say sure, but
1: doesn't "2 blocks / five planks / three logs" give a clearer and nicer picture?

OK, so what you are honestly attempting to convince me of is that "57 kg of Maple Wood" is more confusing than "2 blocks of Maple Wood, 5 planks of Maple Wood, 3 Logs of Maple Wood, 3 kg of Maple Sawdust, 6 kg of Maple Firewood" in a stack?  Now then, kids, get out your calculators, because blocks are worth 3.5 times as much as planks, and logs are worth 20 times planks.  Firewood is only useful for charcoal, but you have to convert it at a 10 kg to 3 plank ratio for determining how much charcoal you can make.  Plus, blocks aren't useful in making certain items, so you have to subtract that number out when you are figuring out how many tables you can make, but you DO still have to add in the logs.

You misunderstand me. I didn't mean all those three at the same time. Any stack only presents one unit - either because it's your system underneath, and just rounded off for presentation purposes, or because it is actually represented as a stack of planks, nothing else. Your blocks and planks would end up on different piles. When you're making furniture, you're only interested in planks so you want them separate, and so on. Sorry if I was unclear.
Title: Re: Volume and Mass
Post by: Sunken on August 08, 2010, 05:10:04 pm
You see, maybe you don't realize it, but you're arguing that "your system" is better than the current system... because its units are some arbitrary, undefined smaller unit! 

THEN, you argue "your system" is better than mine... because the units are some arbitrary, undefined LARGER unit!

The whole argument you are making is that I'm somehow asking for the game to measure down to the picometer, and then offer your idea up as a Golden Mean (http://tvtropes.org/pmwiki/pmwiki.php/Main/GoldenMeanFallacy) between these two "negative extremes". 

OK, so I'm officially confused. Aren't you proposing representing everything by the smallest possible unit of volume? If you're not, then what do you propose? If you've written it already I must have missed it, in that case we've been wasting a lot of time here...

I am indeed proposing something smaller than the current units (which are quite arbitrary - a log is "the amount you get from 'a' tree", a stone is... well, just arbitrary).
The units I'm proposing are arbitrary only in the sense that they could be picked within a range - a "plank" could be anything from a big fat near-beam to a relatively short and thin piece of wood - but it couldn't be any size. Toady would pick some average size that corresponds well with most people's idea of a "plank", and also allows all furniture/construction to be done reasonably with whole numbers of them. And so on for other types.
A prototypical plank, in other words. Doesn't exist in reality, but approximates well what does exists in reality - better than the current wood logs do, certainly - and provides sufficient detail for that which they're used for.

Quote
Now then, let's look at the way that the game actually works.  Dwarves will prefer (potentially very heavily) to stack items of the same sort if they can at all help it.  With fungible piles of wood, this means that they will continue putting every single scrap of wood they can find into one pile until the pile hits whatever it's arbitrary "full" size is, at which point, they start up the next pile, probably directly next to the first.  When some wood needs to be added to the pile, they place it in the partially-full tiles first.  When wood is taken from the pile, they go to whichever is closest first, which is probably the same tile they took from last time, which cleans up those fractions leftover if there were any rather nicely before they move on to the next pile.

In the above I was assuming that a dwarf will prefer to grab everything he needs in one pick, over starting with the nearest pile if that's insufficient. How does it work now? Is there any facility for "grabbing enough" material for, say, melting metal - or is it just "get 1 metal thing, bring it back, see if it's sufficient, get 1 more metal thing..."? I confess I don't know. Both our systems needs to deal with this in a proper way, at least.

Anyway, if the stockpile is constantly being replenished as you postulate, the problem would indeed be mitigated. On the whole, the performance argument is not my main reason for preferring units of some tangible finite size rather than (as I've understood you) the smallest available unit. It's most of all about aesthetics. And there, I doubt either of us will be able to win the other over. It's not up to us to decide, anyway :)
Title: Re: Volume and Mass
Post by: Sunken on August 08, 2010, 05:13:17 pm
what could work is that everything is stored as a unit of the material as per suggestion but every action has a say 1 in 10 chance of producing a certain amount of scrap material. metal scrap could just be melted down again but rock and wood would be suitable for very little perhaps only paving and burning respectively. The chance could be raised with larger constructions. Ideally this would give similar results as tracking logs/large rocks and calling them scrap when they reach a certain size.

to be clear though this would not mean your dwarves would fail to make something just that they would waste additional materials. perhaps the chance could correlate with quality and skill.
This was proposed in another thread on crafting efficiency some time ago. Arguments got pretty heated back then. I think many (myself included) are averse to letting randomness decide whether waste is produced or not. It seems a little untidy. Both Kohaku's and my takes would probably work by producing a little waste every time instead - though the amount of waste sould be influenced by skill, and could vary with randomness too I suppose.

Edit: I'll grant that this would be vastly easier to implement than what we've been discussing though.
Title: Re: Volume and Mass
Post by: cameron on August 08, 2010, 06:31:38 pm
the idea was more that it would be easier to have it be a 1/10 chance then to have a countdown so when ever it reaches 0 from 10, waste is made but either would fit with what i was thinking of
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 08, 2010, 07:17:43 pm
Quote
In fact, let's illustrate this point by going back to this little gem:
You might say "it's all just 0.5 liters of wood" and I say sure, but
1: doesn't "2 blocks / five planks / three logs" give a clearer and nicer picture?

OK, so what you are honestly attempting to convince me of is that "57 kg of Maple Wood" is more confusing than "2 blocks of Maple Wood, 5 planks of Maple Wood, 3 Logs of Maple Wood, 3 kg of Maple Sawdust, 6 kg of Maple Firewood" in a stack?  Now then, kids, get out your calculators, because blocks are worth 3.5 times as much as planks, and logs are worth 20 times planks.  Firewood is only useful for charcoal, but you have to convert it at a 10 kg to 3 plank ratio for determining how much charcoal you can make.  Plus, blocks aren't useful in making certain items, so you have to subtract that number out when you are figuring out how many tables you can make, but you DO still have to add in the logs.

You misunderstand me. I didn't mean all those three at the same time. Any stack only presents one unit - either because it's your system underneath, and just rounded off for presentation purposes, or because it is actually represented as a stack of planks, nothing else. Your blocks and planks would end up on different piles. When you're making furniture, you're only interested in planks so you want them separate, and so on. Sorry if I was unclear.

Wait, wait, you're now saying that you want to make all units the same, and using blocks and planks as some kind of decimal point, the way that coppers and silvers and gold coins are used? 

Doesn't that mean, then, that ten planks (or whatever subdivision system you use) would meld into a block or a log?

Isn't this EXACTLY what I've been proposing, but with a slightly different "face" on it?

Hey, you have to decide here - if you criticize me for simply using a different sized unit, then you can't also complain that I'm adding more object types!

No I don't.  Not when you are arguing for something that is functionally just a different arbitrary unit size than we have right now as if it were a game-changer and arguing for multiple types of objects that serve the same purpose, or else are generally useless. 
I have been arguing two parallel suggestions from the start. One is just using larger minimal size increments, one proposes functional differences. It's the latter that's a game-changer. The former just improves on the current system. Yours does too, we just don't agree which does the most.

OK, this is getting pretty silly.

So... when you have two seperate arguments, and I make two seperate counter-arguments, your counter-counter argument is that I made two seperate counter-arguments.  In my counter-counter-counter argument, I point this out, and you essentially wind up agreeing with me, both that arbitrary changes to "granular size" in the abstract are fucntionally identical until you can set something down with hard data and compare actual results, but also in your making it necessary for me to make two seperate responses.

So, in other words, your argument is that you're agreeing with me.

WHEEEEEEEEEEEEEEEEEEEE!
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 08, 2010, 07:39:41 pm
the idea was more that it would be easier to have it be a 1/10 chance then to have a countdown so when ever it reaches 0 from 10, waste is made but either would fit with what i was thinking of

Kind of, that's the way that the reaction system works, as opposed to the way that melting objects (which is the same workshop) works.

Law of averages would state that, provided it was calibrated the same way, it really doesn't matter either way.  This is a game with an unusual focus on the small scale, but it is still a game where you have to think in macro terms, and operations like "build wooden barrel" are performed thousands of times.  The difference is only really important when each and every unit really does matter... and with waste, that's certainly not the case.

However, the thing about having a random chance to produce a "waste unit" is fit more for the small integer style of game design than the higher precision style I've been talking about here.  As such, I'd say I would be against it largely just because it goes against the general theme of what I am proposing.


Keep in mind, however, that producing waste means that someone will have to clean that waste up.  Producing waste is a deliberate programming choice to slow down production, and force a new task to clean that waste up.

I talked about producing waste with mining, because I do think that mining needs to be slowed down, but that doesn't necessarily mean that you want to add in cleaning up waste to every single task in the game.

Honestly, with something like a carpentry workshop, it would be fine if the waste (as in, the excess chunks of wood that aren't actually used in the process, not a randomly generated-from-thin-air additional waste product) just dissapeared, although it could go the other way, as well.
Title: I like this abstraction
Post by: Len B on August 09, 2010, 03:22:29 am
I think this is a great idea.  Unifiy the underlying mechanics with the raws and slap a nice happy unit-discreet interface to assuage players who want planks, logs, chunks, blocks, bits, dust, slabs, hunks, spools, rods, plates, foils, whathaveyou - all selectable in the init.  Set up probability curves for raw material sizes.  A table has a (material amount)/(probability) stat and is checked when drawing against the stockpile for the job.  Once it's above unity, you can always draw a "table sized" chunk of wood.

I suppose real discrete unit purists would insist that one could add less wood than a "table sized" amount and then voila, draw a plank from the pile.  I'd never notice that level of detail or even care that much, although some might.

*shrug* whatever is better for FPS, in my book...
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 09, 2010, 09:39:17 am
Well, I should also say that I was playing with modded dwarves of vastly larger size recently.  In it, I discovered some of the fun properties of how items scale.  Aside from the bizzare quirk that it doesn't matter how large or strong you are, the same amount of mass applies the same SPEED penalty if you are a termite or a titan.

More importantly, though, "Breastplates" take the same number of metal bars to make a piece of armor no matter what civilization uses that kind of armor.  A 60 liter dwarf will require the same number of metal bars to build armor for his race's size as a 60,000 liter dwarf will, even though the resulting armor is 1,000 times more voluminous and massive.
Title: Re: Volume and Mass
Post by: Sunken on August 09, 2010, 12:16:07 pm
Wait, wait, you're now saying that you want to make all units the same, and using blocks and planks as some kind of decimal point, the way that coppers and silvers and gold coins are used? 

Doesn't that mean, then, that ten planks (or whatever subdivision system you use) would meld into a block or a log?

Isn't this EXACTLY what I've been proposing, but with a slightly different "face" on it?

Pretty similar, but you seemed to be insisting that the minimum unit should be as small as possible, whereas I was insisting it should be of a size adapted to the amounts used by crafts/construction etc.
In my version, I wouldn't have blocks turn into planks when stacked though - because it seemed unrealistic. So I'd have to store them as different types, at least, even if one didn't wish to differentiate their actual function. They'd be just like bank notes and coins, in a way, except you weren't allowed to change a smaller denomination to a larger one. And all prices would be in whole dollars or cents (or whatever's the applicable currency...).

The functionally-differentiated version is more radical: it's more like taking your 20-dollar bill (tree) and buying one of several types of tokens, of different sizes. The tokens can be used in different machines, which accept integral numbers of tokens for different wares, but you can't use the small tokens for the big machines or vice versa.
(In some cases, you'd get some tokens back from the machines - tiny tokens, all the same, that can only be used in the low-end run-down machine in the corner. Those tokens are your firewood, mullock or what have you.)

The difference between your system and the first of the above (let's call it A, and the one with the tokens B) is even smaller for, say, stone. If the only stackable size is "brick", then there's only one "coin denomination", just as in your case, except the denomination is larger (again, tailored to fit the requirements for construction/crafting). And then there's the mullock, which would work the same in your system and mine AFAICS.

My, but the Internet is a huge impediment to understanding sometimes. I tried to separate my advocation of A and B a few posts ago, but it seems I didn't do such a good job of it. Anyway, hope it's clearer what I mean with the above. You didn't say whether I'd misunderstood your position regarding the minimum unit size in your system, though.
Title: Re: Volume and Mass
Post by: Sunken on August 09, 2010, 12:31:53 pm
However, the thing about having a random chance to produce a "waste unit" is fit more for the small integer style of game design than the higher precision style I've been talking about here.  As such, I'd say I would be against it largely just because it goes against the general theme of what I am proposing.
I just want to be pedantic and point out here (lest there be any misunderstanding! perish the thought!) that even with either my A or B system, waste doesn't have to be dealt with by randomness either. The resolution of the wastefulness is less, though. A bungling carpenter may use 5 planks to make a chair of a certain size, where a master gets by with 3, the additional material ending up as firewood fit only for the charcoal pile. You can't waste less than 1 plank with this system, though, obviously.

Quote
Keep in mind, however, that producing waste means that someone will have to clean that waste up.  Producing waste is a deliberate programming choice to slow down production, and force a new task to clean that waste up.

I talked about producing waste with mining, because I do think that mining needs to be slowed down, but that doesn't necessarily mean that you want to add in cleaning up waste to every single task in the game.

Honestly, with something like a carpentry workshop, it would be fine if the waste (as in, the excess chunks of wood that aren't actually used in the process, not a randomly generated-from-thin-air additional waste product) just dissapeared, although it could go the other way, as well.
As I've said, I think that waste that retains some secondary usefulness (like firewood, gravel, etc.) may enrich gameplay. We already have useful waste products in the form of bones and shells; if you had to choose whether to use a turtle for food or for the shell, we'd have fewer shell items and the game would be (very slightly) poorer for it. Currently we have to make that choice with our wood - burn it or build with it? If we couldn't help but get some waste wood that could only be used for burning, maybe magma wouldn't be quite the sine qua non that it is now (though, I doubt it).
Title: Re: Volume and Mass
Post by: Daetrin on August 09, 2010, 02:16:55 pm
Not to intrude on the running argument :p but I really like this idea. Specifically, what appeals to me is to represent the use of precious metals vs. functional metals. Mining ten tiles of gold vein wouldn't (necessarily) give the same   amount of material, but you no longer use the same amount of material to make as you do to decorate.

Insofar as the abstraction vs granularity argument goes, I'm in favor of abstraction. I don't want to feel the "need" to make 100 wood crafts to clean up the scraps from bedmaking.
Title: Re: Volume and Mass
Post by: Soralin on August 09, 2010, 04:42:16 pm
Yeah, this would definitely be useful for that, especially if rarity and value gets worked out with it too.  I mean, compare a solid gold ring to a solid gold table.  The table should be worth a large amount, much more than the ring, but it's also using what should be an absurd amount of gold in the process.  Right now, precious metals aren't really that much more valuable than normal ones, and you can mine them out by the ton without any trouble (Although I suppose those two facts combined make sense).  But it would be nice for certain materials to be much rarer, and actually have the quantities that things are made out of make sense, so that there's a reason why you usually have golden rings, and that golden tables are a bit more uncommon, simply because of the amounts required.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 09, 2010, 07:36:08 pm
Yeah, this would definitely be useful for that, especially if rarity and value gets worked out with it too.  I mean, compare a solid gold ring to a solid gold table.  The table should be worth a large amount, much more than the ring, but it's also using what should be an absurd amount of gold in the process.  Right now, precious metals aren't really that much more valuable than normal ones, and you can mine them out by the ton without any trouble (Although I suppose those two facts combined make sense).  But it would be nice for certain materials to be much rarer, and actually have the quantities that things are made out of make sense, so that there's a reason why you usually have golden rings, and that golden tables are a bit more uncommon, simply because of the amounts required.

This is actually something I've discovered a little bit about through modding, though...

Apparently, the value of a weapon is based upon the size of the weapon.  A giant axe 100 times larger than normal axes are worth rediculous amounts of money.  (This is probably why serrated discs are such hot commodtities now - they're very large weapons.)  The number of metal bars it takes to produce these weapons, however, is completely unrelated to the size of the product, and is determined arbitrarily in the raws.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 18, 2010, 03:26:54 pm
From a different thread, talking about this one:

Don't think that's what he's suggesting.


I like this idea, but how would the game display the parts of the boulder/bar/log that aren't used up? The cloth rework handled this by permanently locking the cloth in a hospital chest. Perhaps one could give workshops the same sort of storage.

As I said to Sunken's similar concerns, this can be solved by using the mechanics the game already uses regarding bins (and, presumably, the mechanics for wheelbarrows and stacking when they become implimented) - If dwarves prefer to place all items in stockpiles with like items that have yet to fully occupy their maximum stack size, then "leftover fractions" of materials simply get clumped together. 

The excess .5 liters of steel from one reaction gets lumped into the next two 2 liter bars of steel that get sent to the same stockpile tile, making 4.5 liters of steel, which then has 2.7 liters removed for the making of a helmet, and you have 1.8 liters of steel in the tile when another 2 liter bar gets smelted, and added into the pile, giving you 3.8 liters of steel.
Title: Re: Volume and Mass
Post by: Shurhaian on August 18, 2010, 06:52:21 pm
Having skimmed through this thread, I must say that you have some very excellent ideas.

Volume of rubble could be suitably combined with the sand/semifluid flow mechanics and machinery to produce, say, a water-wheel-driven (or capstan-driven - a use for livestock! But I digress) conveyor belt system. Mining dwarves dump the detritus onto this belt, and it is carted away, eventually dumped over an ever-growing pile of pebbles. The lowest end of the conveyor belt becomes a dump zone for rock debris; within that mine shaft, anyone set to clear away the debris will take it to that conveyor belt, and can load so much onto it depending on how fast the conveyor is turning(and maybe how well it's made). They basically become a temporary semifluid source.

Speaking of fluid, though, your notion of a "dangerous fluid level" flag caught my attention as being difficult to work with. How do you define a "dangerous" level? Do you go by what would be an impediment to a human? A dwarf? A dwarven child, a baby, a cat, a roach? Although I would love to see fluids implemented as you're saying, I don't think the pathfinding angle could possibly be settled so easily. It makes little sense for a full-grown dwarf to be stymied by water that comes up to his knees - but it makes little sense for a cat to traverse that same level of water without needing to swim.

That said, it might become moot if the notion of fluid level gets interpreted more intelligently. At its most abstract, you could say that any water up to a quarter of someone's height is OK; between a quarter and 1/2, they are wading and will be impeded somewhat; between 1/2 and full height they can wade or swim; anything over full height and they must swim. Some creatures will be significantly faster swimming than wading, and some might even be faster at swimming than walking(while still able to walk perfectly well - contrast fish), but wading will generally be the slowest mode of progress for any such creature. Yes, strictly speaking you have to swim when the water is up to your mouth, but as it stands the raws don't have enough detail to say exactly where your breathing-point is, and I'm not sure it would be necessary. You could set the trigger to 9/10 of the creature's height, I suppose, or do a bit more fiddling there. Maximum/"normal" stance height, and the proportion of that which is the minimum, become important to know. Maybe different modes of motion could have different values, and be independently definable. Below your normal stance height, you will need to stoop. Get pushed down further, and you will need to crawl on your hands and knees. Further still, you will need to crawl flat - and if you can't do that, the tile is impassible. Four-footed creatures wouldn't have as many modes, though, because they don't walk around on their hind legs(not as a means of travelling any significant distance). They can walk, or they can hunker down somewhat, or they can flatten out and crawl, but they don't have the intermediate crawling stage that bipeds do, because that's their natural stance already.

Creatures who are less dense than normal would start swimming at lower thresholds, and with reduced consequences for swimming failure. A water bird is not likely to have a problem staying afloat even while young and clumsy - they just float too well to be imperilled unless they do something really bad(hit their heads and pass out, say, or get tangled on something and dragged under). Reduce the thresholds according to their relative density to water. A typical mammal is very near a density of 1.00 - slightly under it, but left to physics, very little of them will be above the surface. Increased thresholds won't affect the point at which creatures start wading, but will change when they can start swimming. A warrior in full plate is not going to be able to swim at all, which means that if in water over his head, no amount of swimming skill will save him - he might be able to jump around a little to stave off the inevitable(assuming he's not in much deeper than that), but if he doesn't get out of deep water, he will drown.

Currents and especially undertows would complicate matters, of course.
Title: Re: Volume and Mass
Post by: NW_Kohaku on August 18, 2010, 07:26:42 pm
Speaking of fluid, though, your notion of a "dangerous fluid level" flag caught my attention as being difficult to work with. How do you define a "dangerous" level? Do you go by what would be an impediment to a human? A dwarf? A dwarven child, a baby, a cat, a roach? Although I would love to see fluids implemented as you're saying, I don't think the pathfinding angle could possibly be settled so easily. It makes little sense for a full-grown dwarf to be stymied by water that comes up to his knees - but it makes little sense for a cat to traverse that same level of water without needing to swim.

I must say I didn't think about this.  I simply went with the assumption that it would be like the current system - 3/7 is safe, and 4/7 is dangerous, so the cutoff would basically be "the tile is half-full" (or half-empty, you dour person, you). 

I have to worry about making it more complex than that, however.  We need the A* algorithm to be able to work quickly, and it may break the entire connectivity map if all of a sudden, the "dangerous tiles" start getting counted differently for every creature.

That said, it might become moot if the notion of fluid level gets interpreted more intelligently. At its most abstract, you could say that any water up to a quarter of someone's height is OK; between a quarter and 1/2, they are wading and will be impeded somewhat; between 1/2 and full height they can wade or swim; anything over full height and they must swim.

I think some of the code revolving around tall grass slowing down dwarves may come into play in this (and possibly in some of the "slightly cluttered" tiles like stockpiles).  (The same goes for "stooping".)

Creatures who are less dense than normal would start swimming at lower thresholds, and with reduced consequences for swimming failure. A water bird is not likely to have a problem staying afloat even while young and clumsy - they just float too well to be imperilled unless they do something really bad(hit their heads and pass out, say, or get tangled on something and dragged under). Reduce the thresholds according to their relative density to water. A typical mammal is very near a density of 1.00 - slightly under it, but left to physics, very little of them will be above the surface. Increased thresholds won't affect the point at which creatures start wading, but will change when they can start swimming. A warrior in full plate is not going to be able to swim at all, which means that if in water over his head, no amount of swimming skill will save him - he might be able to jump around a little to stave off the inevitable(assuming he's not in much deeper than that), but if he doesn't get out of deep water, he will drown.

Currents and especially undertows would complicate matters, of course.

Reminds me of the WW2 Nazi plan to storm England with Amphibious Tanks that could crawl along the bottom of the English Channel, and surprise attack with tanks coming out of the sea... It didn't work so well.  The tanks, which were water-tight, and filled with air for their crews, were too bouyant to crawl along the silt on the sea floor, and got stuck.  The Allies actually succeeded with the opposite plan - basically building a water-proof "tent" around their tanks that would let their tanks displace enough water to actually sail like boats.

Sorry, that's getting too distracted...

Anyway, if a dwarf really does have no air pockets to buoy him, enough dense armor may make him capable of just walking along the floor at a greatly reduced rate of speed, while his equipment doesn't make him that dense, it may simply slow down his swimming speed significantly.
Title: Re: Volume and Mass
Post by: Shurhaian on August 18, 2010, 07:47:47 pm
I have to worry about making it more complex than that, however.  We need the A* algorithm to be able to work quickly, and it may break the entire connectivity map if all of a sudden, the "dangerous tiles" start getting counted differently for every creature.
This is true... and keeping separate maps of the region for even a few different categories gets to be excessive. I guess this will have to be one of those acceptable reductions in detail.
Quote
Anyway, if a dwarf really does have no air pockets to buoy him, enough dense armor may make him capable of just walking along the floor at a greatly reduced rate of speed, while his equipment doesn't make him that dense, it may simply slow down his swimming speed significantly.

The main issue there is that anyone who is stuck "wading" with his head below water has no air to breathe. Dwarven armour may trap air under it here and there, but it isn't SCUBA. Sure, they can make progress... but they better not have too far to go. Any dwarf in that situation would trigger the "Drowning" alert - the better a swimmer he is, the longer he can hold his breath, but only to a point, since he has to move not only himself but the weight of his gear through the resistance of water. (Even without that, there would be limits, they'd just be longer.)
Title: Re: Volume and Mass
Post by: TolyK on November 06, 2010, 02:56:05 pm
+100 the whole thread

oh and we should have the ability to actually build x-level-tall walls to stop certain creatures from moving through the tile... but only with legendary masons or something.

also I think that for the sake of simplicity (even though I'm for the most realism) there need to be fractions of stuff instead of "logs" and "dust"

edit: damn, wrong thread. anyways I think this is still kind-of relevant
Title: Re: Volume and Mass
Post by: sockless on January 29, 2011, 10:58:09 pm
I think that the system should be entirely volume based, with mass as just a variable calculated on time by multiplying the volume with the materials density.
I also think that square tiles aren't really correct, and that it should be more like a 1x1x2.5/3 meter space, but that would complicate ramps, as they would have to be multiple tiles long, but I guess this is more realistic than the current system. You could even implement a system where you walk faster on a shallower slope.
Title: Re: Volume and Mass
Post by: NW_Kohaku on January 29, 2011, 11:15:39 pm
Oh? Someone went and ressurected this on their own.  I was planning on getting back around to it eventually, when I had time to really working on it more, but it's nice to see an interest arise on its own.

Having density as the only "hard" aspect of a material recorded in the raws, with volume being a variable, and mass a derived stat was what I was suggesting.

Cubic tiles are implied by the way that the game works, however, as horizontal and vertical distances are treated as equal in every way the game measures distances.

Making climbing up a slope (or down one, even if it's "easier", you have to spend energy and care making sure you don't slip going downhill) take longer is perfectly reasonable, and could be modeled as part of the whole "underbrush" thing, I suppose, as well.
Title: Re: Volume and Mass
Post by: sockless on January 30, 2011, 10:39:37 pm
I think that the system assumes that a block is 7'x7'x7'. I figured this as water levels are a number from 0-7. The only logical explanation of this is that it's the number of feet.

Volumes of things stacked together don't necessarily need to merge together, they could stay separate, which would make things like statues harder to build, as you'd need a single lump of rock size x or larger.

This could be implemented by just getting the rock you want to put on a stockpile, then looking at a sorted list of all the squares in the pile, then looking at the largest, checking if it fits in it, then going down in size until there's a square that it will fit into. It's not perfect, as you won't have the most efficient storage solution, but it ends up being far faster than finding the optimal solution, which would be painfully slow on so many elements.
Title: Re: Volume and Mass
Post by: G-Flex on January 30, 2011, 10:56:08 pm
I think that the system assumes that a block is 7'x7'x7'. I figured this as water levels are a number from 0-7. The only logical explanation of this is that it's the number of feet.

I don't know. There are 8 levels, and 8's a power of two, and I'm used to seeing those in software. I doubt there's anything significant about it. Granted, it doesn't really matter a whole lot, and 7x7x7 feet isn't that unreasonable regardless.
Title: Re: Volume and Mass
Post by: NW_Kohaku on January 30, 2011, 11:25:23 pm
The units of measure except for temperature are in metric, though, so it's really 3m cube, 10' is just the customary translation of it.

The range of water depths from 0/7 to 7/7 is based on the fact that Toady uses only 3 bits for tracking the depth of water, along with 1 bit for whether it is water or magma and a few other flags.  It doesn't designate any depth in particular.

I said 2.5 or 3 meters, preferably 3 meters, because it is a round number.  3 meters cubed is 27 cubic meters.  2.5 meters cubed is 15.625 cubic meters, which is much harder to work with.

7 feet is 2.1336 meters, 9.7217 cubic meters when cubed.

The problem with 2 meters (about 6 1/2 feet) in the cube is that you have to include space for the roof above, which will cram the size of the ceiling down to roughly 4 1/2 feet in customary, which is cramped, even for a dwarf, and z-levels are a unit of measure that even humans use in their cities.
Title: Re: Volume and Mass
Post by: sockless on January 31, 2011, 03:12:24 am
Not everything should be measured in volume however, as things like cloth are generally measured in square meters, not cubic meters or Kg. I still think that the blocks should be non square, as 3m squares are rather large, like my bedroom is only like 3x3m. This would mean that I'd be giving all my dwarves at least a 3x12 room, which is rather large. 1 meter is a fairly standard measurement for the horizontal. If you really wanted to, you could have 1m3 squares, like Minecraft has, but that wouldn't be that great.
Title: Re: Volume and Mass
Post by: NW_Kohaku on January 31, 2011, 11:08:09 am
Yes, 3m3 is large, but it also happens to ensure that almost everything in the game can fit in a single tile.  If you have a 1 meter cube, even dwarves would be more than one z-level tall.  That would become fairly problematic as almost all creatures would start being multi-tile creatures that you could only see part of on the screen at once.  A bed, for example, is also typically about 2 meters long.  If the size of a tile is less than at least 2 meters, then beds need to start taking up multiple tiles, as well.

As for cloth, we can still work with volume - square meters is easy to derive if we just have a known, uniform thickness.  And there's no reason not to have uniform thickness, as there is no reason to be so granular as to have varying cloth thicknesses in this game.
Title: Re: Volume and Mass
Post by: sockless on January 31, 2011, 06:33:20 pm
I guess you are right about the multi tile creatures, as deer are most definitely more than 1m long. But 3m seems a bit large for me still, you could potentially just make deer multi tile though, but (ironically for a game with no graphics), it wouldn't look very nice, multi tile beds would be fine though. And also if they are 3x3m, then why do Dwarves have to lie down to pass each other in a 1 tile wide corridor? I wasn't really suggesting that we make 1m3 squares, it would work fine if we had graphics (like minecraft), but it would be a right pain otherwise.
Title: Re: Volume and Mass
Post by: NW_Kohaku on January 31, 2011, 07:14:41 pm
Well, that's pretty much the problem: Minecraft has floating point positions, and a unit can occupy multiple tiles, or slide between tiles fairly efficiently.

As for the laying down, they shouldn't necessarily need to in the end.  Right now, it doesn't matter if dragons pass each other or kittens pass each other, they need to lie down.  It's a "one unit must be the primary occupant of this tile" rule more than anything. I guess you can say it creates the appearance that two dwarves trying to move past each other in a narrow space cause a bit of a traffic jam as they shuffle past one another, but it's kind of silly that they have to all lie down to do it, especially when parties involve most people just lying around in a pile.  (Well, lying around in a pile when the party STARTS, not when it's already over.)
Title: Re: Volume and Mass
Post by: Tanelorn on February 01, 2011, 05:13:20 am
Currently, it would also be impossible to have furnaces require less than one wall unit of coal per production task, unless you have the coal->coke reaction produce more than one bar of coke... in other words, more than one wall's worth.

That is correct, however, there is nothing preventing a single task to generate several objects. Think of the reaction that makes 3 mugs out of 1 stone.
Similarly, in the Civilization forge, there is a new steel making raction that makes 6 steel in one task, but takes less than 6 units of wood.

Come to think of it, that would be a simple way of implementing "units" of material: reactions could easily do this:
1 stone => 1 table
1 stone => 50 rings

For leather, the amount of leather per animal may need to be changed to reflect the animal. Which anyway, would be a good thing, because currectly 1 cow hide makes as much as 1 kitten hide. So:
1 cow => stack of 20 cow leather
1 kitten => 1 kitten leather
2 leather => 1 glove
10 leather => 1 armor

Would this be viable? Hard to implement?
Title: Re: Volume and Mass
Post by: NW_Kohaku on February 01, 2011, 12:07:00 pm
That would be viable, however you have to keep in mind that what we really need fixed is the dwarves' inability to pick up more than one object at a time.

If your craftsman can pick up a single stone block, and then create 50 objects, all of which must be hauled out, one by one, then you start to have a bit of a problem, especially since the craftsman is going to be picking up another stone bock, making another 50 earings in the same time.  Stacking just has to be a priority for this...

Anyway, the thing is, like it was discussed earlier in the thread, units are pretty much arbitrary.  So long as they scale properly, they are used consistantly, and they are of a proper granularity for the task at hand, then we could use whatever arbitrary units we wanted. 

Metric units, however, give us a frame of reference we can understand and work with.  5 stone equals 250 earrings is something you can remember, but it's not very intuitive.  5 metric tons of stone turn into 3500 kg of earrings and 1500 kg of detritus to be swept up is something that you can intuitively understand.

You can instantly compare two objects (like logs and stones and iron bars) when they are all presented in terms of the volume they take up (especially since metal bars are much smaller than logs or stones), and on top of that, you can imagine how much material it is you are really working with at a given point in time (2 liters is the size of your standard cola bottle at the grocery store - just imagine a cola bottle sized lump of steel, and you know how much steel you are dealing with).

It also gives us better ability to really perform dwarven SCIENCE! if we have a standard unit of measurement.  We could later have things like pressure plates that are based solely upon the amount of mass resting upon them.  We could have fun with the physics engine by creating see-saws where moving fortress parts dump heavy objects onto one end of the see-saw, and fling another object (or elf) of lesser mass around, and build some kooky Rube Goldberg devices.

So basically, yes, the "use larger integers" method will work, but if we are asking for a suggestion, why not go for something that is ideal?
Title: Re: Volume and Mass
Post by: TolyK on February 01, 2011, 12:21:38 pm
so basically you're saying, move to metric units.
I agree.
Title: Re: Volume and Mass
Post by: Leonard DeVir on February 03, 2011, 08:14:33 pm
I really like the ideas. It would be so much more realistic. If Im getting this right, you propose that (example!):

1) one tile can hold x amounts of material m in SI unit, and not just "one item of material x"
2) If one tile is filled up with material m, the next tile of the stockpile will be filled up
3) if you need to craft something, the dwarf will use y amounts of material m, reducung the stock to x-y=z
4) if you add material m to the stockpile, it would add up to z first before filling another tile
5) and so on

If its that way, I see the problem of visualization, tough. Will it benefit the average Urist McPlayer? You obviously have a great skill with imaginating and juggling numbers, but quite a few people cannot grasp that very well (especially volume and liters; otherwise we all would be phisicists). Especially with very odd numbers (no, not that odd numbers :P ) like a toy car weighing 0,213kg in stone but just 0,111kg in wood, I think there would be many ?? of the exact meaning of this in regards to size.
 
How to deal with graphic tiles (and tilesets)? Now, it is that 1 sprite = one unit of x (for the most of the time). How do you represent one big 3x3x3m^2 block of stone in many smaller units? Now, its easy to grasp: 1 sprite gives me 1 item of whatever. If you represent 100kg of wood by one tile (example), how do you know its not 100kg but just 78 without going mad by pressing 'k' all the time? Now, I take a glance at my wood stockpile, I see its roughly 10 units of wood and I craft 10 beds. With your system a bed would take like 40kg of wood - now, is this pile 20kg or 80?

I know, things like that wont matter a lot and can be circumvised otherwise, but I think there should be some UI simplifications beforehand, otherwise there may be confusions without "multi tile" objects or weird, hard to imagine values for this otherwise great and well tought of system ("What? Why did the Titan fit...'k'...oh, hes just 2,9m tall, the other one was 3,3m.").
In a nutshell: if this would be implemented, there should be adjustments for visualization.
Hope you het what I mean, english not being my mothertounge and all. :)
Title: Re: Volume and Mass
Post by: NW_Kohaku on February 03, 2011, 09:58:38 pm
I really like the ideas. It would be so much more realistic. If Im getting this right, you propose that (example!):

1) one tile can hold x amounts of material m in SI unit, and not just "one item of material x"
2) If one tile is filled up with material m, the next tile of the stockpile will be filled up
3) if you need to craft something, the dwarf will use y amounts of material m, reducung the stock to x-y=z
4) if you add material m to the stockpile, it would add up to z first before filling another tile
5) and so on

Yes, pretty much.

Quote
If its that way, I see the problem of visualization, tough. Will it benefit the average Urist McPlayer? You obviously have a great skill with imaginating and juggling numbers, but quite a few people cannot grasp that very well (especially volume and liters; otherwise we all would be phisicists). Especially with very odd numbers (no, not that odd numbers :P ) like a toy car weighing 0,213kg in stone but just 0,111kg in wood, I think there would be many ?? of the exact meaning of this in regards to size.

I'm not sure if you mean in the stockpile or when something is just lying around.

If it's in a stockpile, I would think that, given the way that dwarves typically use resources in a constant cycle once the fort gets going, then just eyeballing the stockpile would be enough.

I can tell right now how much food I have pretty easily just by hitting the button to rezoom the screen to my food and booze stockpiles, and looking at how many barrels are sitting there.  It's not a perfectly accurate representation, but all I need to know is "my stockpile looks pretty full, no problems, here".  If I DO want detailed information, that's what the stocks screen is for, and I do spend some time looking at the stocks screen, especially for things like steel or pig iron or iron or coal or coke (because that tends to get plenty of supply hiccups), which tends to get left in bins, and some of those stockpiles are just long rows of bins, where the stocks screen is the only way to get any useful information.

Quote
 
How to deal with graphic tiles (and tilesets)? Now, it is that 1 sprite = one unit of x (for the most of the time). How do you represent one big 3x3x3m^2 block of stone in many smaller units? Now, its easy to grasp: 1 sprite gives me 1 item of whatever. If you represent 100kg of wood by one tile (example), how do you know its not 100kg but just 78 without going mad by pressing 'k' all the time? Now, I take a glance at my wood stockpile, I see its roughly 10 units of wood and I craft 10 beds. With your system a bed would take like 40kg of wood - now, is this pile 20kg or 80?

Well, I'll talk about representation in a little bit, but I think I first have to address the philosophy of scale we are talking about in DF.  DF is not a game about individual trees.  DF is a game about clear-cutting a forest to build barrels, beds, and bins on repeat until the end of time.  DF is not a game where you track every individual stone in your stone stockpile.  DF is a game where you quantum stockpile 1,000 stones in one pit.  That one blob represents 1,000 stones now, already.  DF is a game where microcline mugs and lutes and pig tail shirts sit in wooden bins right next to visually identical wooden bins holding coke and steel and iron and serrated steel discs. 

Consider how you play the game, (granted, it may be different than the way I do,) and I think that odds are, you don't have just one stockpile that you can look over and see all the logs available to you graphically on the map.  Most of the time, you have numerous stockpiles spread across the fortress dealing in specialized tasks, and logs come and go in bulk at high speed.  The only time this is not true is during the very first Spring and maybe Summer, and even then, I find that if I want to look for how many logs I have in "stock", then I have to look out in the fields, because nobody's doing any hauling (since the starting seven's skills are so precious that I can't leave just one doing nothing), logs just sit in the field where the tree was chopped down.  Even then, I tend to not care so long as I don't get job cancellation spam because of actually being out of a material, really. 

The only rare items are gems and rare metals, and those all get swallowed up in the rows and rows of bins.  You can't even tell if one bin is a weapons bin or a clothing bin or a fabric bin or a metal bar bin until you actually bring up the look cursor over it, and if you do that, you can see all the data on the individual units you want.

Now then, back to the actual question: As I'm sure you're aware, there are only 256 characters in the current tileset.  There are just not enough characters to represent every nuance of how many items are in the pile.  As long as we cling on to the vestiges of ASCII artwork, (and there are those who will never let go of that, and I think Toady is one of them,) then the standard tileset will just not represent granularity of the pile size. 

If we were to have a totally unbound sprite-based graphics system (and snowballs survive in the HFS), then we could have some sort of method of representing larger and larger piles of logs to represent whether we had 20kg or 50 kg or 200 kg of wood in one tile.  (Just imagine a sprite with one log, two logs, three logs to represent thirds of the tile dominated.)

Still, I think "my stockpile's tiles are 2/3s full" is a pretty good indication of how much wood you have.  Stockpiles are multi-tile affairs, anyway.

Quote
("What? Why did the Titan fit...'k'...oh, hes just 2,9m tall, the other one was 3,3m.").
 
I would think we wouldn't need to get that anal about it.  An 11-foot-tall creature can generally just stoop a little to get into a 10-foot-tall space.  We could just make all creatures of one species have a tile-occupancy based upon their average volume.  One of the advantages of the somewhat large 3m3 tile size is that almost every creature in the game fits into 27,000 liters of volume.  Even dragons are "only" 25,000 liters.  You'd only really have to be worried about declaring creatures excessively tall, like with a tree or the Bronze Colossus.  I'd imagine even it could crawl, but that might be a little much strain on poor Toady, who has been having trouble getting these things to work properly.
Title: Re: Volume and Mass
Post by: noppa354 on February 06, 2011, 09:32:06 pm
if i can get toady's permission to noodle around with the code i may be able to make one part of this, multi-z-level trees and falling trees, if so, i'll make options "fell west" "fell north" etc.

Noppa354 the awesome is OUT!
Title: Re: Volume and Mass
Post by: NW_Kohaku on February 06, 2011, 10:28:56 pm
I wasn't aware that Toady was really farming out pieces of code.  I was under the impression that Baughn was a rare exception.
Title: Re: Volume and Mass
Post by: JanusTwoface on February 06, 2011, 10:47:14 pm
He isn't... And IIRC Baughn doesn't even have access to anything beyond the rendering code. Toady is the only one that has access to the core game.

So... not likely to happen.
Title: Re: Volume and Mass
Post by: greenskye on May 07, 2012, 04:13:16 pm
I've started a thread discussing a simpler solution to having units of material.

I specifically do NOT want to steal any discussion of a true volume and mass system in DF and will be directing people back here to discuss that if they desire. I merely wish to present an alternate solution for Toady's consideration.

An Alternative to Volume and Mass (Simple Units) (http://www.bay12forums.com/smf/index.php?topic=109023.0)

I wanted to let you know so that you were aware I was posting this.
Title: Re: Volume and Mass
Post by: greenskye on May 07, 2012, 05:54:47 pm
So in my brief attempt at another thread (swiftly picked apart by Kohaku) I tried to come up with a simpler method. I've changed my mind a bit about this. So I'd like to contribute to this thread on designing a way to present volume and mass to the player in a non-confusing method.


Quote of Kohaku's rebuttal:
Spoiler (click to show/hide)

In this system, how does the player actually act? Does the game actually say that 1 chair requires 5.2 kilograms of wood? Does a hauler go find 5.2 kg of wood and haul it to the workshop?

For the player, what is the functional units? Do we try to be realistic and say that 1 arrow requires .2 kg of wood, 1 earring .02 kg of gold?

I would argue that that would be very confusing to keep track of, even with a good in-game interface for it. I think a nice, easy integer solution would be more accessible to more players, even if we sacrifice some realism.
Title: Re: Volume and Mass
Post by: NW_Kohaku on May 07, 2012, 06:11:55 pm
I would think it not be terribly confusing for the player to keep track of, provided it be kept to some general guidelines...

Stockpiles, for example, would have a defined limit to what will be in a tile - say, 3000 liters per tile, and a player could eyeball their wood stockpiles to get a decent sense of how much wood they have left over by counting how many tiles have wood in them (provided there are not so many different types of wood that occupy only part of a tile). 

Dwarves would take whatever arbitrary units of wood they take (like 50 liters of wood for a chair, for example) from the stockpile, and if they dump things off, they are merged with other wood into a stack, so that there are no "giant planks" or "small leftover bits".  Just wood (from specific trees).

Players probably won't care about the actual volumes of individual pieces.  They will be able to look at an item and see its absolute and comparative size, but right now, we already have defined volumes for every chair, table, earring, and other object in the game (except the tiles themselves).  You can derive them yourself from the material densities and the stated kilogram mass of each item.  Because of that, I derived the volumes of individual items in the game, like how metal bars are 2 liters, and boulders are (if memory serves) 50 liters. 

Players will, again, probably just care about the size of the stockpile, or what the stocks screen says about their remaining quantities of materials.

That said, it will have a more clear impact when we are talking about what players use in their crafts - when a gold earring takes up a completely negligible quantity of gold compared to a golden throne or golden statue, players are more likely to give metalsmiths plenty of practice on earrings.