Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5 ... 9

Author Topic: Easy and intuitive SAND physics suggestions  (Read 36168 times)

Ultimuh

  • Bay Watcher
  • BOOM! Avatar gone! (for now)
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #30 on: June 01, 2010, 08:10:13 am »

I think we are all missing the important question.


Should sand crush or suffocate?

Both?

Cruffocate?
« Last Edit: June 01, 2010, 08:11:46 am by Ultimuh »
Logged

Beeskee

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #31 on: June 01, 2010, 10:48:41 am »

I think this idea rocks. The animations in the first post really show it well. :)


And 7/7 water + 7/7 sand in the same tile could be quicksand! Think of the FUN that will bring! :D
Logged
When a wizard is tired of looking for broken glass in his dinner, he is tired of life.

G-Flex

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #32 on: June 01, 2010, 01:07:39 pm »

Quicksand is more than just sand mixed with water, or else the concept of "going to the beach" would be slightly more dangerous than it is today.
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) ==

Draco18s

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #33 on: June 01, 2010, 01:26:45 pm »

Suggestion:
Love it, very well thought out.
Magma should just melt sand, like it does other items right now.  Avoids having the "fluid mixing problem" at least partially.
Water and sand is a bit trickier as if sand doesn't displace water, it means one of them has no volume compared to the other.  But if water and sand mutually exclusive each other you can't have water percolate through the sand.

Eg:


Quicksand is more than just sand mixed with water, or else the concept of "going to the beach" would be slightly more dangerous than it is today.

This is why I love Bay12. <3
Logged

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #34 on: June 01, 2010, 01:49:52 pm »

<3's so much for this thread!!!!!!!!  <3 <3 and <3

Anyway, Draco18 brings up an excellent point... and the way this is handled could maybe one day set a framework for how irrigation could work.  :X  Oops.  I shouldn't say that.  I don't wanna derail the thread.
Logged

ShinWalks

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #35 on: June 01, 2010, 01:54:16 pm »

I like this suggestion very much! The computational burden shouldn't be too heavy, no more than when you're channeling an area and the game has to track which ramps to collapse.

Thoughts: perhaps the depth logic could go something like this: since water at depths 1-3 is walkable, so is sand, no problem, same as if it weren't there at all. Sand at depths 4-6 would be treated by the logic as a ramp (and if the slip-face grade were 3/7-per-horizontal-tile, then this makes sense), and 7/7 of course is treated as an (impassable) wall.

Issues: the question in the OP is the biggest one: where does the sand go when you try to dig through it? We could just have the miners be atom-smashing their way through, but really we should have to remove the sand. Here's my thought for how this could work: instead of getting sand into bags using a specific work order in a specific workshop, sand and bags could be treated the same way that water and buckets currently work (maybe even recycling some of the same code? can't speak to that side of it). A sort of "create sand pile" zone ala "pit/pond" would create orders for dwarves to bag (or bucket?) sand up and transport it to a dumping site. Perhaps one bag/bucket could hold 1/7 tile of sand, which would also put a mild and rather reasonable limit on how much glass you could churn out of one map's sand supply. Perhaps we could keep the "collect sand" order to make bagged sand for a glassmaker, since I don't think there's any way the existing pond code can produce a bucket full of water that isn't in a dwarf's hands...

Other issues: It would really be much simpler to simulate sand with depths ranging from zero to *three* rather than seven. It would make it very clear what each depth means (zero is no sand, one is walkable, two is a ramp, three is a wall), it would make the slip face rate much more simple (it would be one depth per horizontal tile, meaning three steps from a solid wall to an empty floor), and it would require even less computation because there would be less movement. I don't know, however, how deep in the engine the fluid-in-sevenths measure is written; for all I know it might be either very easy or nearly impossible to make a new fluid be measured in depths out of three (although, the way we're talking about it, it isn't clear that sand would be tracked using much of a fluid model at all; it more nearly resembles the way ramps are tracked).

I think I will check to see if this is an eternal suggestion voting item, and if it isn't I'm going to make one (can I do that?). EDIT: done! Give it some votes!
« Last Edit: June 01, 2010, 02:05:27 pm by ShinWalks »
Logged

DarthCloakedDwarf

  • Bay Watcher
  • Urist McCloaked
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #36 on: June 01, 2010, 02:04:48 pm »

I wholeheartedly approve of this idea and give it epic thumps up.

Incidentally, magma+sand should = molten glass.

I also support the idea of making adobe out of sand and water so you can still have your dwarves live in a giant sand castle if you want.
« Last Edit: June 01, 2010, 02:07:13 pm by DarthCloakedDwarf »
Logged
Yes. Clearly a bug that ought to be fixed in the future, but exploit it in the meantime.

Aescula: *snerk*  Just thought of a picture I saw a long tome ago...
Darth Guy: A long, long tome ago, in a library far, far away?

Tehran

  • Bay Watcher
    • View Profile
    • Dwarf Fortress Stories
Re: Easy and intuitive SAND physics suggestions
« Reply #37 on: June 01, 2010, 02:16:25 pm »

Water and sand is a bit trickier as if sand doesn't displace water, it means one of them has no volume compared to the other.  But if water and sand mutually exclusive each other you can't have water percolate through the sand.
BRB, want to play Falling Sand...

Ah, it's just like I thought. Sand displaces water completely. And sand doesn't even have a slip face in that game, it behaves like water, trying to flatten out. Oh well, still a fun little game.

If wet sand is possible, you've got a lot more thinking to do. what happens when a 1/7 sand and 1/7 water meet? It becomes a 1/7 wet sand? Because if that's the case, it would mean that 7/7 water and 7/7 sand can exist on the same tile... which doesn't make sense because water is already filling up that tile completely - there's no room for anything else. (Actually, there is - you can still have a fish in 7/7 water, or a table, or pretty much anything...)

So it would be more like.. a 7/7 sand could hold, say, 3/7ths water - except, how much water should a 6/7 sand be able to hold? Or 5/7? We definitely don't want to put decimals in there.

So, either sand and water should completely displace each other, or sand and water should mix in equal parts.
One of the problems with wet sand is that desert oases would be slurped up immediately... And beach sand would suck up ocean water until it's completely saturated.
It would also lead to things like a sand tile being 6/7ths sand and 1/7th wet sand. But that's not so terrible.

Well, my vote goes to complete displacement. :)
Logged
Visit http://dfstories.com for stories!
And here's my solution for sand modeling: http://www.bay12forums.com/smf/index.php?topic=58397.0

Draco18s

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #38 on: June 01, 2010, 02:39:08 pm »

Water and sand is a bit trickier as if sand doesn't displace water, it means one of them has no volume compared to the other.  But if water and sand mutually exclusive each other you can't have water percolate through the sand.
BRB, want to play Falling Sand...

Ah, it's just like I thought. Sand displaces water completely. And sand doesn't even have a slip face in that game, it behaves like water, trying to flatten out. Oh well, still a fun little game.

Falling Sand (or any derivatives) are all the same mechanic, really.  Either it burns, or it doesn't, has positive gravity or negative...The only mildly unique ones are the virus and the ant.  And the ants don't live nearly long enough.

And there are way cooler things to do with Langton's Ant.
Logged

Tehran

  • Bay Watcher
    • View Profile
    • Dwarf Fortress Stories
Re: Easy and intuitive SAND physics suggestions
« Reply #39 on: June 01, 2010, 02:47:19 pm »

Other issues: It would really be much simpler to simulate sand with depths ranging from zero to *three* rather than seven. It would make it very clear what each depth means (zero is no sand, one is walkable, two is a ramp, three is a wall)
I like that, it's far simpler. But it has a crippling impossibility, which is that sand and water are bound to meet up sometime, and 1/3 and 1/7 are completely incompatible. Allow me to demonstrate...


Quote
I think I will check to see if this is an eternal suggestion voting item, and if it isn't I'm going to make one (can I do that?). EDIT: done! Give it some votes!
I voted. : D

Something else to add:
Water should probably be able to push sand around, especially fast-moving water. It might be a headache to code that, though.

Also, a slip face difference of 3/7 would be a bit steeper and more realistic than 2/7, as is shown in my animation.
Logged
Visit http://dfstories.com for stories!
And here's my solution for sand modeling: http://www.bay12forums.com/smf/index.php?topic=58397.0

ShinWalks

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #40 on: June 01, 2010, 03:39:13 pm »

But it has a crippling impossibility, which is that sand and water are bound to meet up sometime, and 1/3 and 1/7 are completely incompatible.

The current system by which water (and magma?) flows interact with map geometry allows no fluid to flow through a wall tile but the full amount (up to 7/7) to flow through upward ramps/stairs. Why mess with what already works? Say that up to 7/7 water can coexist with 0/3, 1/3, or 2/3 of sand, but no water can coexist with 3/3 of sand. If a sand shift opened up a new tile that water could then access, it would flow in automatically (the water is already checking constatly to see where it can flow to); if a sand shift rendered a previously fluid-passable tile fluid-impassable (filling a water/sand tile up to 3/3 sand), the water could be displaced horizontally or, if that weren't possible, vertically.

Or, that water could just get atom-smashed, which is probably what would happen in the case of a cave-in with a natural wall currently(?). I don't feel like it would be a huge problem, except for someone wanting to pressurize an underground lake by dumping sand into it, as described earlier in the thread... I guess it would sort of simulate the water being "soaked up" by the sand, as was mentioned above.

I guess what I'm saying is, all of the thirds-of-a-tile-of-sand logic would be totally obfuscated, both from the user *and* from the fluid logic driving the water. As far as the user loo(k)ing at the tile would see and as far as the water flow would care, it would only be a "sand floor", a "pile of sand", a "sand upwards ramp", or a "sand wall" (rather than 0/3, 1/3, 2/3, and 3/3 sand, respectively), and the water would interact with those tiles in precisely the way that it already does.

So, the "sand shift" check would take place separate from the fluid flows, it would only need to be called when one of a (short) list of events that affect sand level (mining, collecting bags of sand, cave-ins) occurs, and then it would propagate outward, causing the next frame to call that check for the eight adjacent tiles, and any tiles in which a shift occurred would call a check for their eight neighbors in the next frame, and so forth until no more shifts occurred... *Vertical* sand shifts would take a little more doing, though, since a wall directly above a ramp would have to shift to form a ramp directly above a wall, so the cave-in code would have to change for sand walls... Point is, it wouldn't make that much computational work unless you caused a shift at the very bottom of a deep sand pile, and that is, I guess, reasonable enough? It almost can't be even as much work for the processor as punching a hole in the bottom of a lake is now, and that's something that people still do often enough.

EDIT: oh, and if sand were tracked by thirds, it might make sense to make "collect sand" reduce the level by one and produce a bag with, say, five or ten units of sand in it? It seems like a cubic tile full of sand would suffice to make fifteen or thirty glass crafts...
« Last Edit: June 01, 2010, 03:48:55 pm by ShinWalks »
Logged

Igfig

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #41 on: June 01, 2010, 11:10:40 pm »

With three levels, why would you track it by numbers at all?  One level of sand would make a floor; two levels would be a ramp; three levels would be a solid block.

I still prefer the seven-level approach, though, because of the interactions with other flows.

Doodle

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #42 on: June 02, 2010, 12:22:18 am »

Sometimes you have to embark on deserts. However, think of the Fallout mod. If lets say, it was made to work for a version of this. All ground is almost all desert and rock. I have sand inconveniently everywhere, so yeah, the physics would screw me over with 4 perfect spots in 4 worlds.

Comparatively, deserts rarely have the flowing-dune-aspect going on.
Overall deserts are mostly just very dry areas, with the biggest difference between them and grassland or forests tending to be the type of plants (or the lack thereof), low levels of precipitation aside. There's almost undoubtedly going to be sand in a desert, but for the most part, dunes are fairly unique terrain features rather than being a representative of an entire biome. The reason you see more sand in a drier area has more to do with the lack of plants to keep the ground covered in roots, leaves, and other decomposing plant matter that makes up most soils, and really, sand can be found in almost any biome quite plentifully if you look hard enough.

Either way, I don't think the processing issue would be much different from embarking on an ocean, if I've gotten the gist of the way flows work in the game properly.

In the vein of thought I was on previously, though, I believe soil types with the "sandy" adjective should become more dominant, having patches of pure sand dispersed throughout, with areas like beaches or dune seas being the places where sand is really going to be piled in these huge, flowing masses.
It would also be interesting to see sand becoming integrated with soil types after a player could potentially unleash entire dune flows onto the countryside after pouring enough sand into a reservoir, but, really, I wouldn't have any problems if the sand first introduced simply had a flow that might potentially interact with other flows.
Baby steps and all that.

Oh, and even though having a bunch of smaller lumps and sheets of sand all over the place does sound straightforward enough, I think that terrain types like sandy loam, sandy clay, etc. should function like sand terrain types do in the current version as far as sand collection occurs. I could see players running out of the "pure, flowing" sand pretty quickly unless they embarked on an erg.
Logged

RobotDog

  • Escaped Lunatic
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #43 on: June 02, 2010, 09:32:37 am »

Solid and functional, I voted for it.
Logged

ShinWalks

  • Bay Watcher
    • View Profile
Re: Easy and intuitive SAND physics suggestions
« Reply #44 on: June 02, 2010, 09:43:02 am »

With three levels, why would you track it by numbers at all? One level . . . two levels . . . three levels . . .

You used numbers in your example of how it could be tracked without using numbers... Something has to be being counted somewhere so that the game engine can keep track of how much total sand is present. Other than that, you seem to be repeating exactly what I said, so I agree with you completely!
Logged
Pages: 1 2 [3] 4 5 ... 9