| Author |
Convoys changing direction |
Floater
Joined: Oct 23, 2002 Posts: 246 From: England
| Posted: 2002-12-18 15:35  
OK, so I've got a random mission generator (YAMG) making convoys, and it plots zig-zagged waypoints for them, but there's a problem I can't fathom out.
Say you've got a convoy of 40 mixed-type ships in a 6x7 grid, and they hit a waypoint that requires a 90-degree turn during a zigzag maneouvre, what seems to happen is this: the lead ship (at the front starboard corner) changes course fine, and the nearby ships follow suit. But the ships at the back of the convoy suddenly have to accelerate to keep up with the turn (think of a tail whipping round), and they move at different maximum speeds. So, the convoy's formation is a complete mess at the back until they eventually sort themselves out and regain formation. It can be an hour or more before they eventually stop crashing into each other.
Now, this is a guess, but it certainly explains what happens if it's right. It seems the turning radius is determined by the lowest speed and turn ratio of the convoy, so it starts to turn before the waypoint's reached, but it's too tight a radius for the poor guys at the back, who have more distance to cover.
Has anyone encountered this before when setting changes of direction for convoys, and if so, do you have any ideas?
Also, on the same topic, I recall reading about the real-life recommendations for setting zig-zag courses for N Atlantic convoys, but I can't find the source. If memory serves, most course changes were around (and often on) the 90-degree mark, but I don't know how long each leg of the pattern was. For testing, I've set YAMG to give half a degree UTM in each axis before turning 90 degrees, which seems fair without having more detailed information.
But, I'm worried that if SH2 can't get convoys to synchronise their turns without breaking up, all this will have been a waste. Help, please!
[ This Message was edited by: Floater on 2002-12-18 15:38 ]
 
|
|
Mark K
Joined: Feb 27, 2002 Posts: 474 From: Petaluma, California
| Posted: 2002-12-18 17:09  
Yep that's an issue encountered when manually scripting scenarios, too. SH2/DC have little "formation turning" logic, especially for form_as_are groups.
Every ships position is always determines relative to the guide unit.
This I experimented with while manually scripting missions:
- "smoothing out" sharp turns by breaking each turn into multiple waypoints
- making the guide unit a middle ship instead of a lead ship
- ensuring the guide unit is the slowest ship in the group.
thanks,
Mark Kundinger
(Ultimation)
 
|
cdragon
Joined: May 29, 2002 Posts: 60 From: Boston, MA USA
| Posted: 2002-12-18 18:04  
What Mark K said.
Also ship spacing is important. I did a simple test with a 5 ship column and found that the greater the spacing, the better the formation keeping. At 650 meters between ships, the formation keeping was pretty good. The 3 ships at the back tended to fall behind as they whipped around but then accelerated to get back to the 650 meter spacing; quickly the column was back in shape. I'll try multi-column groups next.
I don't know the historical distance between ships in a convoy. 500 meters? Less? More? Anyone?
_________________

 
|
Drebbel
Joined: Mar 05, 2002 Posts: 1782 | Posted: 2002-12-18 18:45  
Typical WWII 1942 Atlantic Convoy (according to book 'Battle of the Atlantic'):
Colums = 12
Rows = 5
Ships = 60
Outside = raw material
Inside = war material, tanks, planes etc
Very inside = ammo
Second row, just off center column = troop ships
Between colums = 1000 mtr
Between rows = 500 mtr
Width = 10000 mtr
Convoy commander (torpedo hunter) = patrolling +/- 5000 mtr top left of convoy
Other torpedo hunter = at top right of convoy
Corvettes = one at 5000 mtr btm right and one at 5000 mtr btm left of convoy
More corvettes = one at 10000 mtr left of convoy and one right of convoy.
I used left/right instead of port/starboard because DC players also might read this post.
_________________
Drebbel
www.DutchSubmarines.com
The Submarines of the Royal Netherlands Navy

[ This Message was edited by: Drebbel on 2002-12-18 18:49 ]
 
|
Floater
Joined: Oct 23, 2002 Posts: 246 From: England
| Posted: 2002-12-18 19:11  
Col7777:
I'd not planned to have the escorts do anything more than keep on the outside of the convoy, in this order (bearing in mind there's a random number of escorts)
1st: front centre
2nd: rear centre
3rd: left centre
4th: right centre
5th: left front
6th: right rear ... and so on
That's how it's programmed at the moment, anyway, and it was how I understood the escorts kept their home positions, at least in a very rough way. I didn't realise that they entered the convoy at all - thanks for the info. We never stop learning, do we?
As for stragglers, I was thinking of having those as separate groups of one, following the same waypoints as the convoy but on a "SLOW" speed (or simply positioned way behind in the same group), but that was for a later date. It certainly would make the missions more interesting.
Mark:
Regarding the smoothing-out of turns - I'd love to do that, but it would push my knowledge of trigonometry so far my head would explode. I'd not touched a cosine or an arctangent in 25 years, and had to learn it all again to get the waypoints for a zig-zag course plotted. It was very interesting getting back into all that, but I doubt I could stretch my brain around curving the turns without help from maths experts. Do we have any here? Or, clutching at straws, is there maybe a parameter in a waypoint order that gives a radius?
"Making the guide unit a middle ship instead of a lead ship." Yes, I should have done exactly that in the first place. The placement of ships in the convoy currently starts from the group start position, and fills in backwards for a previously calculated number of columns and rows, so the guide ship is on one corner. Not too difficult to change that - it's a case of calculating the shape and positions of the convoy, then finding the nearest to middle ship, rather than making the first ship the lead.
"Ensuring the guide unit is the slowest ship in the group." Can anyone recommend off-hand a really slow Allied merchant unit for this? It sounds like another good idea, and it should be very easy to do. It just reduces the randomness a bit, but I can live with that
cdragon:
"Also ship spacing is important." Yep. They're currently hard-coded to .016 degrees apart, but if that were increased, it would reduce the chances of collision. I suppose that in a rectangular-shaped convoy, ideally the ships should be spaced apart far enough for the slowest ship to turn without hitting its neighbour, but there's a danger of ending up with one big convoy covering the whole of the Atlantic. )
Also, you're talking about distances between ships calculated in metres, and YAMG works entirely in UTM co-ordinates - I don't know how that's done internally in SH2. Is the real world really represented in SH2 as a flat surface, so that 1 degree W/E at the equator ends up the same relative distance as 1 degree W/E south of Iceland? I'm really confused about that one.
Anyway, things to work on:
1. Put the guide ship in the middle
2. Make the guide ship slower than the rest
If those don't work:
3. Space the ships out more
4. Reduce the angle of zig-zag
Any other ideas? And ... am I right in that people are interested in being able to generate a zig-zagging convoy with random start and end points, and an unknown complement of merchants/warships and escorts?
 
|
Floater
Joined: Oct 23, 2002 Posts: 246 From: England
| Posted: 2002-12-18 19:28  
Drebbel:
Thanks for the information there. I'm not planning to get the spacing too accurate (the metres vs degrees longitude problem, dammit!) but that gives a good indication of the overall shape of the convoy. For a start, the number of columns vs rows, and the difference in distance between rows and columns - that's a surprise.
The positioning of merchant and troop ships in there, I can't see implementing for a long while. The escorts' positioning is interesting, though. I'll code that in when I get this zig-zag thing worked out.
 
|
cdragon
Joined: May 29, 2002 Posts: 60 From: Boston, MA USA
| Posted: 2002-12-18 21:46  
Drebbel,
Thanks for the convoy info. I had read descriptions of convoys as rectangular rather than square, with the wide, broad front and narrow profile, but I didn't know for sure, and the details of it.
Who wrote the book "Battle of the Atlantic" that you mention? A search on Amazon.com turned up a number.
Thanks again!
_________________
[ This Message was edited by: cdragon on 2002-12-18 21:47 ]
[ This Message was edited by: cdragon on 2002-12-18 21:49 ]
 
|
Drebbel
Joined: Mar 05, 2002 Posts: 1782 | Posted: 2002-12-18 22:59  
Quote:
|
On 2002-12-18 21:46, cdragon wrote:
Drebbel,
Thanks for the convoy info. I had read descriptions of convoys as rectangular rather than square, with the wide, broad front and narrow profile, but I didn't know for sure, and the details of it.
|
|
Yep, wide front
convoy front = 11000 meters
convoy side = 2000 meters
Including escorts front = 30000 meters
Quote:
|
Who wrote the book "Battle of the Atlantic" that you mention? A search on Amazon.com turned up a number.
|
|
Battle of the Atlantic by Barrie Pitt
_________________
Drebbel
www.DutchSubmarines.com
The Submarines of the Royal Netherlands Navy

[ This Message was edited by: Drebbel on 2002-12-18 23:06 ]
 
|
Mark K
Joined: Feb 27, 2002 Posts: 474 From: Petaluma, California
| Posted: 2002-12-19 06:47  
The SH2 earth is flat, but 1 degree is still a smaller distance up north than it is at the equator. To illustrate, take your boat to way up north and kick the rudder in a hard circle and go to the map screen. It will trace an ellipse.
By naming convention, Slow cargo ships for whatever country are named "MSC..." and fast onesa are "MFC...". And make sure that the convoy speed is less than the max speed of that slow guide, and you should be okay. Unless then guide unit gets damaged, that might be bad.
I can't really help with math. it makes me sad. I guess one ghetto way to approach it would be instead of ordering on 90 degree turn, just order three 30 degree turns, which are presumably no harder to calculate than 90 degree turns (?).
Turning radius in the waypoint order? Riiiiight... We put that in after we put in the dancing leprechaun code.
I've read info similar to drebbels on rough convoy shape, although I think it listed the escorts as close as 3000 yards from the convoy edge.
thanks,
Mark Kundinger
(Ultimation)
 
|
Drebbel
Joined: Mar 05, 2002 Posts: 1782 | Posted: 2002-12-19 10:37  
Quote:
| I've read info similar to drebbels on rough convoy shape, although I think it listed the escorts as close as 3000 yards from the convoy edge. |
|
My source has escort make 'elliptical patrol' at indicate positions. Unfortunately size of the ellips is not indicated.
_________________
Drebbel
<a href="http://www.DutchSubmarines.com" target="_new">www.DutchSubmarines.com</a>
The Submarines of the Royal Netherlands Navy

 
|
Floater
Joined: Oct 23, 2002 Posts: 246 From: England
| Posted: 2002-12-19 15:33  
Quote:
|
The SH2 earth is flat, but 1 degree is still a smaller distance up north than it is at the equator. To illustrate, take your boat to way up north and kick the rudder in a hard circle and go to the map screen. It will trace an ellipse.
|
|
That makes sense. I'm not going to get too hung-up on distance vs UTM for the moment, but it seems that around 0.008 degrees is about 1600 metres at North Atlantic latitudes. I may need to adjust that distance for the Arctic circle or equatorial regions, but that's for another day.
Quote:
|
Unless then guide unit gets damaged, that might be bad.
|
|
I was wondering about that. If the guide ship gets sunk, does the group ignore waypoint commands, or does another ship then act as a guide?
Quote:
|
I guess one ghetto way to approach it would be instead of ordering on 90 degree turn, just order three 30 degree turns, which are presumably no harder to calculate than 90 degree turns (?).
|
|
When your maths is as rusty as mine, it's a lot harder! That's the way to go, though I might as well program in a variable number of turns, so it's easier to adjust while testing. I'll need to go back to the drawing board on the methods I've used, though. We're approaching waves of movement here, rather than simple triangles.
The question is: is this really time well spent? I may well be wrong, but the primary advantage of a zigzag course was surely to prevent a sub taking a couple of bearings and radioing a projected course back to HQ for the wolfpacks to intercept? In that case, I can't see zigzagging being important to SP players, and I doubt if MP players would be interested in tracking convoys over hundreds of miles. Any thoughts on that?
Quote:
|
Turning radius in the waypoint order? Riiiiight... We put that in after we put in the dancing leprechaun code.
|
|
Yeah, but make sure them leprechauns stay in formation, will ya?
Here's the conclusions of hours of testing: it doesn't seem to make much difference which ship is the guide ship when you're turning 90 degrees (or 60, for that matter). This is what happens with a convoy of 40 ships at 0.016 degrees separation when it hits a 90 degree turn (REACH objective shown is location of waypoint):
Screenshots of convoy breaking up
The last of those shots shows the convoy suddenly back in formation in the new direction, and this was puzzling at first. It seems that when a convoy's really messed up, and you go to more than 8x acceleration, SH2 picks the ships out of the water and plonks them down a short distance to one side, all rearranged and ready to go. A very neat idea for general stability, but not what's needed here, sadly.
Anyway, I'll keep working on adding more waypoints to smooth the curve out, unless someone can come up with a definitive quote that convoys only zig-zagged by 3 degrees . Or, more likely, says "so why bother with zigzagging at all? Other things are more important!"
 
|
Mark K
Joined: Feb 27, 2002 Posts: 474 From: Petaluma, California
| Posted: 2002-12-19 18:08  
A sunk guide unit should make another ship the guide. But damaged... nope.
The "snapping" to the formation is group mode. Groups collapse into it to allow higher time compression. Doesn't happen when no enemies are nearby.
You're sorta right about the strategic use of zigzagging. Depends partly on if the player is getting frequent contact reports, or using infinite visibility. Or if they want to work for an hour just to intercept the convoy.
thanks,
Mark Kundinger
(Ultimation)
 
|
Floater
Joined: Oct 23, 2002 Posts: 246 From: England
| Posted: 2002-12-19 19:41  
Thanks, Mark.
I think what I'll do is this: forget the zigzagging idea, if it's not wanted, and carry on with other aspects that need attention.
I've got convoys moving across the Atlantic, each generated scenario having a random (but optionally controlled, a bit like the built-in mission generator):
1. Number of convoys
2. Convoys' routes across the Atlantic, and their starting dates
3. Unit types in each convoy, and number of units
4. Combinations and positions of ships
5. Escorts and positions outside the convoy
6. Weather (no fronts yet)
7. Dates & times of day
8. Player's U-boat type
Next is the idea of putting warship convoys in there (say, a BB or a carrier or a cruiser, with variable escorts). Nearly all of that's done.
Along with general tidying-up, that's enough work left to last for a few weeks, then it's time to look at packaging it up for a rough beta release. After that (in no particular order):
- Weather fronts
- Stragglers, and random lone vessels
- Aircraft
- Areas other than the North Atlantic
- Multi-player (!)
- Lots of other stuff, requests welcome
For the time being, though, it's probably best to concentrate on getting the fundamentals working solidly.
Thanks for everyone's help on this.
 
|
cdragon
Joined: May 29, 2002 Posts: 60 From: Boston, MA USA
| Posted: 2002-12-19 23:41  
Floater, your screenshots are great. Convoy cohesion, not so great, but the screenshots, they're terrific. Really. They tell a story, and I think I know what the story is.
The ships are executing their turns at the same time. I don't know if that was how it was really done, the turning of whole convoys, during the war. That method of turning, tho, is truly an efficient use of space. Its turning on a dime. Its like turning a marching band by having the marchers all turn in place ninety degrees; BOOM! Ninety degree turn. Very cool.
The problem is the guide ship. The guide ship function is tied to a single unit, and is only transferred to a different unit when the original guide unit is destroyed. In your example, in the screenshots, the front left ship is the guide, I think, because thats the one aiming at the waypoint. The rest of the convoy forms up relative to that ship AS_ARE, I think. For a ninety degree turn to work with the method of turning being attempted, the sim would need to dynamically transfer the guide ship function to the unit that becomes the front left ship in the formation, which is the top right ship in the formation before the turn. Or the sim could leave the guide ship function with the original ship, but not worry about where the guide ship is in the formation and where the other ships are relative to it. Just as long as each ship keeps its neighbors the same, the convoy can turn in any direction, and maintain cohesion.
Whats happening in your screen shots is that the convoy is trying to maintain formation relative to the guide ship. The sim is trying desperately to keep the guide ship the left front ship in the formation. Each ship is trying to manuevar into position. Its like the sim has rotated the original formation pattern to the new direction, and then instructed each ship to proceed to its place in the pattern independently of the others. So as the ships wheel about, they encounter other ships wheeling about, following their own path to their spots. And these encounters are in close quarters, so the ships swerve to avoid collisions, but in such close quarters, swerving to avoid one collision puts the ship in threat of another collision, so it swerves again. And so on. The whole formation quickly cascades into chaos.
To maintain formation where the left front ship is ALWAYS the left front ship, the sim needs to use a different turning technique. It should execute turns like a marching band; each ROW would pivot about the turn as it came to the waypoint. That kind of manuevar requires each ship in a row to turn a different rate, dependent on its position in the row.
_________________

[ This Message was edited by: cdragon on 2002-12-19 23:55 ]
 
|
|