Bay 12 Games Forum

Please login or register.

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

Author Topic: Buoyance  (Read 6396 times)

LoneJedi7

  • Bay Watcher
  • The CaKE is A LIE
    • View Profile
Buoyance
« on: February 25, 2010, 11:45:48 pm »

In one word, Buoyance. i dont know how hard or time consuming it would be to add this to dwarf fortress, but it would be awesome to be able to make a huge boat and watch it sail away off map with all of your nobles supplies.

(yes, i know you can turn off cave-ins to make stuff float, but it would be cool to be able to build a ship that "sails away" instead of just float in place)

[sidenote: also, liquid fire would be nice if it had some applications other than tradegood, im sure this has come up before]
« Last Edit: February 26, 2010, 12:10:58 am by LoneJedi7 »
Logged
ℍ!Ξ[/[Θ]![ℍ∑▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀)

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Buoyance
« Reply #1 on: February 25, 2010, 11:53:35 pm »

Logged

LoneJedi7

  • Bay Watcher
  • The CaKE is A LIE
    • View Profile
Re: Buoyance
« Reply #2 on: February 26, 2010, 12:01:52 am »

whoops, i guess i mistyped my search when i typed the word buoyance (water has too many search results). when i searched for it, nothing showed up.
 my apologies to Labs (and everyone else who already made this suggestion), but hopefully this will at least remind people of the idea and this thread wont be a total waste.
« Last Edit: February 26, 2010, 12:10:27 am by LoneJedi7 »
Logged
ℍ!Ξ[/[Θ]![ℍ∑▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀)

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Buoyance
« Reply #3 on: February 26, 2010, 12:06:44 am »

Yeah, search is tricky when the word can take multiple forms (buoyant, buoyancy, buoyance).  Search doesn't require you to type in full words, though, so I used "buoyan" to get those results.
Logged

lampyridae

  • Escaped Lunatic
    • View Profile
Re: Buoyance
« Reply #4 on: October 22, 2010, 03:30:23 pm »

Buoyancy would open up so many possibilities! The obvious one is of course floating vessels, but more generally, coupling it with water pressure would give players the first way to move smoothly constructions up and down z-levels, paving the way for dwarven elevators and more importantly mind-boggling "dynamic" megaproject fortresses.

Because DF is already a very process intensive game, it would probably need to be a simple model of buoyancy. I'll attempt an example of such a model:

The construction which may float must be considered without support (subject to caving in) and be in contact with water. Each tile in horizontal contact with water will help buoyancy and wall tiles ("opaque tiles") will hinder it. Internal floors as well as creatures and items on board could be ignored, for questions of performance (my poor laptop!) and predictability for the player. Mathematically, it would be something like:

Code: [Select]
buyoancy = horizontal contact surface - full walls * some constant
...if buyoancy is more than 0 it floats, else it sinks. For more Fun, the constant could be influenced by the wall's material.

This way, a tower-like construction would sink but not a flat one and a bowl-like structure would sink partially.

Then of course there's the question of something falling from a great height into water... At this point I have no clue left, so I'll leave like that.
Logged

Funk

  • Bay Watcher
    • View Profile
Re: Buoyance
« Reply #5 on: October 22, 2010, 03:50:26 pm »

guy why not just use density?
every thing has one as it is.
If the items density is less than water (1.0 g per mL) it will float in water and if it is more than water's it will sink in water.
Logged
Agree, plus that's about the LAST thing *I* want to see from this kind of game - author spending valuable development time on useless graphics.

Unofficial slogan of Bay 12 Games.  

Death to the false emperor a warhammer40k SG

Kurouma

  • Bay Watcher
    • View Profile
Re: Buoyance
« Reply #6 on: October 22, 2010, 04:10:26 pm »

Add up the total number of tiles it takes up including walls, use this and the mass of the everything it's made of to get the average density of the construction. For boats the mass would even give you how much water to displace to remain buoyant; fully laden trade vessels would be low in the water, empty ones would float high. Fill your boat up with too many lead barrels in Adv mode and watch it travel to the bottom, maybe taking you along with it!
How to make the game recognize boats though? Designate them somehow? But then you have trouble with multi-z things.
Logged

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Buoyance
« Reply #7 on: October 22, 2010, 04:17:55 pm »

guy why not just use density?
every thing has one as it is.
If the items density is less than water (1.0 g per mL) it will float in water and if it is more than water's it will sink in water.

That is the key and that would be all that is needed for simple single tiled objects.  But for objects like boats that are made of materials more dense than water and that in DF would presumably be multi-tile constructions, the game needs to be able to recognize if the object is watertight, the shape of the object, and how it displaces water.

I don't think that it would be that complicated to implement at all.  The equations aren't all that complicated and I think taking buoyancy into account wouldn't have to be CPU intensive at all, since I imagine it could be made so that the game only has to calculate the buoyancy once for a designated object and not have to make checks all the time to see if it's still buoyant unless the object changes somehow (takes on a load, gets a hole in it) or suddenly floats into a liquid of different density which wouldn't be a common occurrence...  Basically, in terms of CPU load all it would add would be a handful of calculations made at a single instance or very infrequent instances.

EDIT: Kurouma beat me to it!
Logged

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Buoyance
« Reply #8 on: October 22, 2010, 04:26:39 pm »

How to make the game recognize boats though? Designate them somehow? But then you have trouble with multi-z things.

Yeah... that's the tricky part.  The multi-z things I could see as being readily tackled, but how would the game handle the designation stuff?  Would it have to be a player-designated thing? 

This has likely been discussed before, but I could see it being done this way:

There could be a menu the player could open up; basically a "blueprints" menu perhaps.  There the player could design a multi-tile vehicle or building.  The calculations of buoyancy and stuff could be calculated there perhaps.  Then the player could designate where to build it.  Then dwarfs could construct it, much like other constructions.  I dunno.  I think it could work.  This might be more appropriate for one of those many threads dealing with player-defined constructs and blueprints and stuff.

Logged

Auto Slaughter

  • Bay Watcher
    • View Profile
Re: Buoyance
« Reply #9 on: October 22, 2010, 04:36:12 pm »

How about setting sail on the magma sea in a ship of basalt?  I say "setting sail" but you would probably power it with screw pump  propellers, of course.
Logged
Legendary Idler
“There's nothing better than a party that turns into a death trap.”

               — Russell T Davies, Doctor Who writer, speaking of some of his more popular plot lines

Shade-o

  • Bay Watcher
  • It's my greatest creation yet!
    • View Profile
Re: Buoyance
« Reply #10 on: October 22, 2010, 11:26:53 pm »

This would require a somewhat accurate portrayal of weight distribution in terrain, which would also mean the end of a whole mountain being supported by a wooden log.
Logged
Apparently having a redundant creature entry causes the game to say, "Oh, look, it's crazy world now. Nothing makes sense! Alligators live in houses!"

Rowanas

  • Bay Watcher
  • I must be going senile.
    • View Profile
Re: Buoyance
« Reply #11 on: October 23, 2010, 07:11:05 am »

I've wrestled with the concept of variable size constructions before, in some of the siege engine threads. I think specifying ships as separate entities is a bad idea. Instead, when something comes into contct with water, use the densities in the raws, as others here have said.

If you want a gigantic boat, build something boat shaped that water couldn't normally pass through using the existing rules of water flow and pressure.

All we need is some way to designate something huge to be moved, which could very well be handled by exactly the same siege engine mechanics I've thought of before, namely, that you can build a "cart" which is merely a floor with wheels (something else we'll have to include) and build the ship (or siege engine) on top of it.
You could then q-m (look at building, move) and designate the centre spot where you want the cart to end up. Dwarves with the appropriate hauling labour enabled then rush to push the cart and whatever you've built on top of it, perhaps with options in the cart building menu to specify how many dwarves the cart should have pushing it under ideal circumstances. With boats, you would specify a submerge centre spot and your dwarves would haul it there.

If all goes well, the cart sinks, the boat floats and you're off on an exciting adventure.

Bigger ships will, of course, require bigger carts to build them on, but with this method of construction, you can build anything you like, of any size and set sail. Hell, if this got implemented I would spend my first fortress dedicated to making a gigantic colony ship, with farms, trees, and everything else on board, which could put extra boats out every now and then using the ever-replenishing mini-forests below decks. Maybe even have a retractable sealed staircase with pumpstacks, which could be dropped to the bottom every now and then to retrieve precious minerals from the ocean depths.

P.S. Remember to put dwarves and anything else you need on the boat before you move it.
Logged
I agree with Urist. Steampunk is like Darth Vader winning Holland's Next Top Model. It would be awesome but not something I'd like in this game.
Unfortunately dying involves the amputation of the entire body from the dwarf.

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Buoyance
« Reply #12 on: October 23, 2010, 08:06:48 pm »

I like the idea that a boat should just be a boat-shaped construction and by virtue of its shape, material properties, and whatever else is part of the construction and the location of said parts (basically not some arbitrary "this is a boat" designation), it should behave as a boat. 

I like the cart idea, too.  Another similar idea is simply building a construct on removable supports in a dry-dock instead of on a cart, fill the dry-dock with water when the construct is done, and then remove the supports.  If the object is built right, it will float!  :D 

However, ideally, to work in this way without the construct simply being submerged, this would not only require using existing rules of water flow and pressure and a novel feature of material density.  There would have to be a feature that allows the game to recognize the object as a whole, single entity, and/or take into account somehow how tiles are linked together (including how much weight a tile is bearing).  The game right now is not equipped to handle well the shifting of vertical position of a multi-z-level structure (think about cave-ins... they are really clunky).  I think the elements for it are already there in spirit (how else would the game be able to tell when a tile is free-floating or linked to a ceiling or the ground or an adjacent structure?), but the game doesn't really treat free-floating, multi-tiled things as coherent, linked-together objects as soon as they become free-floating (at least I think).  I hope I'm making sense.   

This relates to Shade-o's concern.

I believe this can be tackled and made in such a way that structural-stuff-related information is conveyed easily to the player.  I need to think about it more, though.


« Last Edit: October 23, 2010, 08:14:35 pm by Andeerz »
Logged

aepurniet

  • Bay Watcher
    • View Profile
Re: Buoyance
« Reply #13 on: October 23, 2010, 09:02:51 pm »

This would require a somewhat accurate portrayal of weight distribution in terrain, which would also mean the end of a whole mountain being supported by a wooden log.

thats not necessarily true. you can ignore weight distribution all together.  if something is collapsible (has no supports) you can simply move the entire construction down one tile at a time, until the amount of water it displaces is equal to the weight of the construction. (or something like that).  the construction not being water tight would not be a problem either. after sinking a couple levels or so water would flow into the construction and add to the weight of the construction. this way things could even sink slowly. (think caissons).  if a mountain is supported by a wooden support this logic wouldnt even kick in.  its clearly a hack (quick simulation), but so is water flow and pressure already.

using boat designations is a huge hack, i think it should be somehow simulated.

collapsible constructions (something with no supports) could also use this logic to float back up a zlevel. (underwater ballons? submarines? fortresses floating within magma?)
Logged

Andeerz

  • Bay Watcher
  • ...likes cows for their haunting moos.
    • View Profile
Re: Buoyance
« Reply #14 on: October 24, 2010, 02:22:08 pm »

using boat designations is a huge hack, i think it should be somehow simulated.

Agreed wholeheartedly...

thats not necessarily true. you can ignore weight distribution all together.  if something is collapsible (has no supports) you can simply move the entire construction down one tile at a time, until the amount of water it displaces is equal to the weight of the construction. (or something like that).  the construction not being water tight would not be a problem either. after sinking a couple levels or so water would flow into the construction and add to the weight of the construction. this way things could even sink slowly. (think caissons).  if a mountain is supported by a wooden support this logic wouldnt even kick in.  its clearly a hack (quick simulation), but so is water flow and pressure already.

There are problems with this, though.  If there is not a weight-distribution/structural load stuff mechanic, how will the game recognize the weight of the construction as a whole without the construction being explicitly designated?
« Last Edit: October 24, 2010, 02:25:27 pm by Andeerz »
Logged
Pages: [1] 2 3 4