Submarines should be able to go under ships?
Moderator: Moderators
Submarines should be able to go under ships?
Why isn't it already in or it is, but sub collision just collides with ship collision?
Re: Submarines should be able to go under ships?
Bumped for not getting a reply on this! 

Re: Submarines should be able to go under ships?
would be great
Re: Submarines should be able to go under ships?
Because there's just one uniform "ground" collision system that applies to land as well as water.
Re: Submarines should be able to go under ships?
I've seen that in PURE buildings and units have box and other type of collision geometry. This most likely was a new feature for spring but I wouldn't know.KDR_11k wrote:Because there's just one uniform "ground" collision system that applies to land as well as water.

So if the collision spheres don't collide then submarines could go under ships? Of course this would be mod not engine wise.
Re: Submarines should be able to go under ships?
No, pathfinding is separate from collision primitives, it uses footprints.
Re: Submarines should be able to go under ships?
Can torpedos, that dont need to pathfind (At least I believe so since they move in a straigh line to target), pass above or below units then? If yes, (teory based on limited knowledge about spring engine) couldnt sub pathfinding be rebuild to ignore ships, and then make they be really deep so they wont bump or enter ships to achieve that effect?
-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Submarines should be able to go under ships?
Well amphibs have the same problem of not being able to pass floating DTs...
@manored:
Unit pathfinding and weapon behaviour are two different things. Apart from that afaik a torpedo will explode on the very first enemy thing it collides with even when targeting at another sub...
@manored:
Unit pathfinding and weapon behaviour are two different things. Apart from that afaik a torpedo will explode on the very first enemy thing it collides with even when targeting at another sub...
Re: Submarines should be able to go under ships?
Torpedoes definitely can go under naval units. It's just they usually try to go near the surface and thus hit everything. I've seen the torps launched from the torpedo bombers going under ships, that's because they gain some depth after hitting water and need a bit of time to go back to the surface.
Re: Submarines should be able to go under ships?
That would be awesom!
Submarines should move near bottom, not near surface.
It would be great to see submarines going under ships when on deep sea but coming to surface when on near shore.
And submarines should have possibility to surface anytime and shoot their deck cannon and small AA fire against torpedo bombers.
Then we could add for different mods units what has deck gun and/or small AA turret or even missiles (what usually can be fired just below surface, but not from deeper, in real world).
Submarines should move near bottom, not near surface.
It would be great to see submarines going under ships when on deep sea but coming to surface when on near shore.
And submarines should have possibility to surface anytime and shoot their deck cannon and small AA fire against torpedo bombers.
Then we could add for different mods units what has deck gun and/or small AA turret or even missiles (what usually can be fired just below surface, but not from deeper, in real world).
-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Submarines should be able to go under ships?
That should be possible right now...Fri13 wrote:And submarines should have possibility to surface anytime and shoot their deck cannon and small AA fire against torpedo bombers.
Then we could add for different mods units what has deck gun and/or small AA turret or even missiles (what usually can be fired just below surface, but not from deeper, in real world).
Re: Submarines should be able to go under ships?
I think it is, tough since our maps are used to submarines not passing under ships I think most of then probally dont have enough water deep[Krogoth86] wrote:That should be possible right now...Fri13 wrote:And submarines should have possibility to surface anytime and shoot their deck cannon and small AA fire against torpedo bombers.
Then we could add for different mods units what has deck gun and/or small AA turret or even missiles (what usually can be fired just below surface, but not from deeper, in real world).

-
- Posts: 1176
- Joined: 23 Aug 2007, 19:46
Re: Submarines should be able to go under ships?
Well it's perfectly fine for one method which gets used like in EE for example where you morph/replace the unit with an emerged / submerged version...
But I think you also could set a waterline setting in the FBI tag and then move up the entire model per script until the turrets are above the water. I didn't test this yet but the turrets might fire then...
But I think you also could set a waterline setting in the FBI tag and then move up the entire model per script until the turrets are above the water. I didn't test this yet but the turrets might fire then...
Re: Submarines should be able to go under ships?
The turret may fire but the hitsphere wouldn't move, so it'd still be wherever it was to begin with.
Re: Submarines should be able to go under ships?
Maybe we should just allow mods to "distort" the notion of underwater depths to give submarines more clearance. Suddenly shallows become deep and the deep becomes the abyss...
Re: Submarines should be able to go under ships?
Probably the simplest solution would be to have multiple blocking maps - just a way to say "the blocking map for unit Q is x1 by y1 in blocking map 1, and x2 by y2 in blocking map 2". For pathing, the unit considers the union of their blocking maps if they exist in multiple blocking maps.
Thus, you could have a blocking map dedicated to ships that would be seperate from the blocking map used for subs and land units (which live on the ocean floor when they're overboard). The only problem would be things overlapping in shallows, so ships would need to have a deep mindepth. This would probably be the approach that requires the least perversion of existing logic.
You could also create a floating-unit layer for hovercraft that float above the height of normal units but still use normal unit handling. For example, if Kernel Panic had the Bytes float a little higher, then you could have Bits scooting around underneath it.
But yeah, if you applied this business to ships, you'd lose compatibility with a lot of maps to get the mindepth wrangling you'd need to keep ships from running into ocean-floor stuff in shallows.
Thus, you could have a blocking map dedicated to ships that would be seperate from the blocking map used for subs and land units (which live on the ocean floor when they're overboard). The only problem would be things overlapping in shallows, so ships would need to have a deep mindepth. This would probably be the approach that requires the least perversion of existing logic.
You could also create a floating-unit layer for hovercraft that float above the height of normal units but still use normal unit handling. For example, if Kernel Panic had the Bytes float a little higher, then you could have Bits scooting around underneath it.
But yeah, if you applied this business to ships, you'd lose compatibility with a lot of maps to get the mindepth wrangling you'd need to keep ships from running into ocean-floor stuff in shallows.
Re: Submarines should be able to go under ships?
Pxtl's way is the right way to do this, computationally. However, pathfinding would go at least linearly with the number of maps, and probably worse, and pathfinding is one of the most intensive processes in the Spring engine, so you're opening a large can of worms, performance-wise.
Re: Submarines should be able to go under ships?
Either way, multi-map-blocking-units would be pretty convoluted to path unless you converted them into a single map. You'd probably have to make the multi-map units have the same pathing footprint in each map (so a 4x4 in map 1 that extends into map 2 is still a 4x4), and simply union the maps... in which case, the pathing would be of the same computational expense, but you'd have the additional expense of constructing the unioned-blocking-map.Erom wrote:Pxtl's way is the right way to do this, computationally. However, pathfinding would go at least linearly with the number of maps, and probably worse, and pathfinding is one of the most intensive processes in the Spring engine, so you're opening a large can of worms, performance-wise.
So, pathing the units is of the same computational expense, but the construction of blocking-maps is increased... and even then, I would think that mobile multi-map units would be rare - most multi-block units would be large immobile structures. Maybe experimentals that are so huge they stick out of the water while walking on the ocean floor.
The real drawback would be the shallow-water bugs - ships/subs would not function in shallows because they'd collide with the other blocking map.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Submarines should be able to go under ships?
Air units have a block map of all green (can go anywhere). They ignore units and features.
The only way to assign this behavior to a unit is to make it canfly in the unit definition. I would like a new tag other than canfly to give a unit that can have terrain blocking assigned to it as normal by its movetype (based on water level, slope) but ignores all units and features. Subs would benefit from this, as well as my babies, the burrowing units. Such units move somewhat in 3D space, so it makes sense that they can avoid units, but in the case of subs cannot go above water, and for burrowers optionally cannot go below water.
The only way to assign this behavior to a unit is to make it canfly in the unit definition. I would like a new tag other than canfly to give a unit that can have terrain blocking assigned to it as normal by its movetype (based on water level, slope) but ignores all units and features. Subs would benefit from this, as well as my babies, the burrowing units. Such units move somewhat in 3D space, so it makes sense that they can avoid units, but in the case of subs cannot go above water, and for burrowers optionally cannot go below water.
Re: Submarines should be able to go under ships?
Why not just consider subs as aircrafts in water? they can go under the ships, they can go above/under each other too.
of course, water has its depth and ... maybe there should be some limitation so that only a certain amount of subs can be in the same (x,y) position?

of course, water has its depth and ... maybe there should be some limitation so that only a certain amount of subs can be in the same (x,y) position?