Special Aircraft Service

Please login or register.

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

Author Topic: Is it possible to have ships partially sink in shallow water?  (Read 1521 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Is it possible to have ships partially sink in shallow water?
« on: August 15, 2024, 05:28:48 PM »

In even very shoal water near a beach a destroyed ship will submerge completely. It would be neat if the map_c.tga RGB value at the ship's location could be used as a measure of depth, to have a sinking ship cease sinking once the lowest part of its hull mesh reaches said depth.

Might this be feasible? Worth the effort?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

genXgamer

  • member
  • Offline Offline
  • Posts: 1358
Re: Is it possible to have ships partially sink in shallow water?
« Reply #1 on: August 15, 2024, 07:32:17 PM »

Certainly worth the effort if it could be done, I'll be watching this closely.

I raised something similar regarding landing craft.
Japanese landing craft lined up along the shore would completely disappear when destroyed, hence I told players to adjust the amount of hits one could take.
I then attached fire and smoke triggers to show them being destroyed.
Perhaps for my situation I could make up static landing craft with a damage model, of course the player doesn't get credit for destroying a ship but I'm more concerned what happens during a mission than what's shown in the debriefing screen.
Logged
Go in quickly - Punch hard - Get out!

Cycle

  • Modder
  • member
  • Offline Offline
  • Posts: 685
Re: Is it possible to have ships partially sink in shallow water?
« Reply #2 on: August 17, 2024, 03:10:20 PM »

I would like to have something like this! For example, in the 40s, Manila Harbor had a very shallow draft with a tidal range of only half a meter difference.
Logged
"Lenin sagte einmal, der ungebildete Mensch stehe außerhalb der Politik. Heute aber haben wir ein gebildetes Volk. Wie wir in den letzten Jahren handelten, bedeutete, es aus der Politik herauszuhalten. Das ist eine Mißachtung des Volkes. Das ist eine Art Elitedenken." Michail Gorbatschow

Dimlee

  • member
  • Offline Offline
  • Posts: 1254
Re: Is it possible to have ships partially sink in shallow water?
« Reply #3 on: August 18, 2024, 01:39:53 PM »

It would be great to have such an effect.
For example, Pearl Harbor missions will look very different and more realistic.
Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Is it possible to have ships partially sink in shallow water?
« Reply #4 on: August 23, 2024, 03:25:13 PM »

Looking at BigshipGeneric.class I see this method:
Code: [Select]
private float computeSeaDepth(Point3d point3d)
{
for(float f = 5F; f <= 355F; f += 10F)
{
for(float f1 = 0.0F; f1 < 360F; f1 += 30F)
{
float f2 = f * Geom.cosDeg(f1);
float f3 = f * Geom.sinDeg(f1);
f2 += (float)point3d.x;
f3 += (float)point3d.y;
if(!World.land().isWater(f2, f3))
return 150F * (f / 355F);
}
}
return 1000F;

It performs a check as follows. Centered on the map X/Y position of the ship, a series of circular sweeps with radii of 5m, 15m, 25m, 35m..... 355m are performed at every 30 degree interval in azimuth. For the first map point reached in the search, the depth of the water at the ship is calculated based in the radial distance, that being the distance of the ship from shore. If no land is encountered, the depth is set to 1,000m.

This is a selected table of the results, in meters, where the first number is the distance of the sweep from the ship and the second number is the water depth.

5  2.1
45  19.0
85  35.9
125  52.8
165  69.7
205  86.6
245  103.5
285  120.4
325  137.3

It's readily apparent that a pretty steep fall-off is created. A distance from shore of 325m and a depth there of 137m is a slope of 22.9 degrees!

I haven't yet looked for any code which takes this into account. As an experiment, I'm going to fiddle with the algorithm so as to make a VERY shallow fall-off in depth and see what happens when I destroy stuff near shore. If there remains the complete sinking even quite close to shore, we can safely conclude that sinking depth is not altered by water depth. Should report results soon...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Is it possible to have ships partially sink in shallow water?
« Reply #5 on: August 23, 2024, 04:13:57 PM »

I adjusted the algorithm so as to set only a 20m depth at 355m distance from shore, making for a far more gentle slope.

Interestingly, ShipGeneric had this:
  return 50F * (f / 355F);

versus this in BigshipGeneric:
  return 150F * (f / 355F);

The latter has a 3X steeper slope. I suppose that making the depth fall-off less abrupt for lesser ships is more in keeping with their smaller sale.

Anyway, I reduced both to:
  return 20F * (f / 355F);

Here's the result after destroying a number of stationary ships placed quite near the shore at the west end of Ie Shima, on the Okinawa map. There are two types: 6X IJN Fishing Boat and 5X Camouflaged Japanese Ship Armed. This is LOOONG after their destruction, where they've settled to the depths seen here and sunk no farther. I seem to recall in this same test mission that well before this point in time all would have sunk to full invisibility.

This still seems to be a considerable amount of sinking, where the depth as calculated would be less than 2m.

If my notion is indeed making a difference, my next question is whether this might have an unintended impact on chiefs and their ability to navigate anywhere near shorelines...



Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Is it possible to have ships partially sink in shallow water?
« Reply #6 on: August 23, 2024, 04:46:45 PM »

Here's a generic IJN carrier, sunk at the closest point I could get it to sail to shore. (As you know, when setting waypoints for ships they will automatically 'bend' the paths around shorelines, and not permit to place a waypoint within some distance of the shore.) The tops of the two masts are sticking up a little above the surface, and remain there without dropping any amount farther.

I should restore the old depth algorithm and run this same mission again, to see if indeed there is any change...

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

RABIZO

  • member
  • Offline Offline
  • Posts: 512
Re: Is it possible to have ships partially sink in shallow water?
« Reply #7 on: August 23, 2024, 06:09:02 PM »

That's a good effect.

I would like to recreate the scene where a ship is half submerged in the Kure, but would that be too "extravagant"?
Logged

genXgamer

  • member
  • Offline Offline
  • Posts: 1358
Re: Is it possible to have ships partially sink in shallow water?
« Reply #8 on: August 23, 2024, 08:10:04 PM »

I think it looks strange seeing those ships in shallow water without submerged hulls.
If they were raised higher up like the wrecked ships we have it would be much better.


Logged
Go in quickly - Punch hard - Get out!

gunny0134

  • member
  • Offline Offline
  • Posts: 1152
  • no skill just simple, but seek the best beauty !!
Re: Is it possible to have ships partially sink in shallow water?
« Reply #9 on: August 23, 2024, 09:07:08 PM »

I agree.

That will only be recognized as a strange object from the sky.


Logged

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Is it possible to have ships partially sink in shallow water?
« Reply #10 on: August 24, 2024, 01:40:48 AM »

There is code in another method which further handles the calculated water depth. I'll be out in the sticks for the next 3 days, and will do some more fiddling after that...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6040
Re: Is it possible to have ships partially sink in shallow water?
« Reply #11 on: August 24, 2024, 05:45:19 AM »

Got up early enough this AM before leaving town to do a quick test. I simply reduced the sink depth applied by a factor of 0.25.

The carriers, being big ships, are handled by the more complex code in BigshipGeneric.class, wherein the computed water depth controls the total roll and pitch applied to a sinking vessel; deeper water, more roll/pitch is possible. This is the principal reason for the carrier farther from shore having a more pronounced roll/pitch.

The small vessels near shore are handled by a different code in ShipGeneric.class, which has them more commonly sink in a vertical orientation. A strange thing about these. They did sink to the deeper depth as shown in a previous post (tops of masts/sails only being seen), but then rose back upward to the shallower depth seen here. I'll have to look at this further, hopefully being able to halt the sinking at the intended, shallower depth (as happens for the big ships), and not continue to sink then rise back up.  ;)

Things are looking OK so far. I see no impact caused by the much shallower computed depths on the movement of chiefs.

One thing I wonder about is the rather small maximum radius of a mere 355m from a vessel as the sweeping search for land is conducted. Why not farther? I might explore this aspect further.

Anyway, experimentation will proceed, as this is a first crude testing of ideas...

In this screenie all ships are destroyed, now resting in their final repose, sitting on the bottom. Near the shore are 6X fishing boats and 5X armed, camouflaged vessels.

[click for larger]
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1] 2 3   Go Up
 

Page created in 0.043 seconds with 27 queries.