Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 5 6 [7] 8

Author Topic: Volume and Mass  (Read 36760 times)

Shurhaian

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #90 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.
Logged
Working on: drakes - making the skies(mostly) a bit more varied

My guards need something better to do than make my nobles happy with hugs and justice.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #91 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.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Shurhaian

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #92 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.)
Logged
Working on: drakes - making the skies(mostly) a bit more varied

My guards need something better to do than make my nobles happy with hugs and justice.

TolyK

  • Bay Watcher
  • Nowan Ilfideme
    • View Profile
Re: Volume and Mass
« Reply #93 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
Logged
My Mafia Stats
just do whatevery tolyK and blame it as a bastard mod
Shakerag: Who are you personally suspicious of?
At this point?  TolyK.

sockless

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #94 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.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #95 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.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

sockless

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #96 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.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

G-Flex

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #97 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.
Logged
There are 2 types of people in the world: Those who understand hexadecimal, and those who don't.
Visit the #Bay12Games IRC channel on NewNet
== Human Renovation: My Deus Ex mod/fan patch (v1.30, updated 5/31/2012) ==

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #98 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.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

sockless

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #99 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.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #100 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.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

sockless

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #101 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.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #102 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.)
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Tanelorn

  • Bay Watcher
    • View Profile
Re: Volume and Mass
« Reply #103 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?
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Volume and Mass
« Reply #104 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?
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare
Pages: 1 ... 5 6 [7] 8