P.S. I'd like to know what I've done wrong in my simplified structural strain idea about three comments above. PM or post if you fancy telling me.
Gladly! :3
Well... everything is supported by one other thing, right? A wall on a floor tile on another wall tile is still all supported by the bottom-most wall. So everything on a boat must be supported by the bottom-most ship tiles, or, more generally the tiles in contact with the water. Problem solved for weight distribution. It'll take the computer a fraction of a second to work out how much weight is on the water-touching tiles, since it doesn't need to know where exactly the weight is. It just takes the density of everything on board and divides it by the number of water-touching tiles. If it's denser than the water by an arbitrary figure, the ship sinks one z-level and the game recalculates. Ships would only rise in the water if the combined density is less than that of the water by that same arbitrary figure. I add the figure bit on because otherwise ships would be constantly bobbing up and down, causing the computer to recalculate often and increasing the chance of your boat getting flooded.
It's so obvious and easy that I know i've fucked up somewhere.
What I think you missed in your suggestion is how the computer will know exactly what is "everything on board".
I don't think the game has a way of doing this, but I think I have an idea of how it could, which would make what you said work!
I will preface my explanation on how to address this with an acknowledgement that because I have never seen the code of DF, I could very well be wrong with my following speculations. But, it seems to me that the way the game works right now, each tile at some point (when the map is initialized?) makes a simple check to see if its current state satisfies the following condition:
The tile has at least one facet connected to another solid tile that is defined as stationary.
If this condition is satisfied, the tile that made the check then becomes defined as stationary.
It makes this check again if an adjacent tile somehow changes its stationary state (like if the adjacent tile gets mined out or is touching a tile that has a change in its stationary state or something). If the condition is not satisfied after this check, its status is no longer defined as stationary and it starts to collapse, which then starts a chain reaction to all adjacent tiles.
Just sort of imagine an invisible "access to trade depot" overlay thing, but instead of indicating accessibility, it's indicating stationary-ness. A change in the accessibility of a single tile at a bottleneck makes all the tiles beyond it turn into non-accessible. This would be the same way I think this game determines how things collapse. Which makes me think... if this is the way the game does it, then, holy crap! I can totally see how your suggestion would work Rowanas!!!
!!!!
The game could make an additional check in the instance the above situation isn't satisfied after the check. When the tile becomes no-longer-stationary instead of simply collapsing, it gets flagged as "movable object x", where "x" is any positive integer that hasn't been used before in this map for any other "movable object" flag. Any tile touching this tile then gets the same flag, which causes them to make the same additional check. After this happens, and there are no more tiles in this instance that can get this flag, no other tile can ever get this flag of this integer if it contacts a tile of this flag.
This creates a way for the game to define a multi-tiled, multi-z-level, not-previously defined object in real-time and recognize it. After this, the game can treat it in any way it is programmed to. This would make it possible for the game to make buoyancy calculations since it would then be able to recognize that all the tiles that make up the object are part of that object! Of course, this is all ignoring any possible cost on CPU, but I think this is how it could work with what Rowanas said! It basically amounts to a system for on-the-fly designation by the game! And it doesn't require a reworking of the current way structures are handled other than introducing this new check!
I wonder if anyone else has suggested a similar idea... probably...
EDIT: Wait... this is pretty much what lampyridae said sorta.