Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik > Daidalos Team discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2016, 06:37 PM
Pursuivant Pursuivant is offline
Approved Member
 
Join Date: May 2010
Posts: 1,439
Default

Quote:
Originally Posted by RPS69 View Post
Zig Zags were for anti torpedo tactics, anti dive bombers tactics, they turn hard all the time.
My idea for "automatic zig-zag" option for ship movement in the FMB would be simpler than full AI for ships. All it would do is allow the mission builder to set a ship's course from Point A to Point B, and the "zig-zag" option would automatically turn that straight line movement into a series of S-curves by automatically plotting the additional waypoints needed.

You could use a simple sine wave function and plot new way points at maximum and minimum amplitude along a line described by the ship's baseline course. If the programmers wanted to get fancy, they could give options for amplitude and frequency to control width of each "curve" and frequency of course changes.

This would be realistic for "non-combat" movement by ships in a war zone, where zig-zagging was standard submarine defense.

For "emergency" movement against air attack, it would "good enough".

If you wanted to move into "pseudo AI" for ships, there are some simple "swarming" or "flocking" algorithms which could be used for basic station-keeping and collision avoidance, as long as ships are assumed to be in a convoy or some other formation and are programmed to keep a certain distance from other ships. These could be used to make a formation of ships all turn in the same direction when under attack.

Collision avoidance, especially realistic avoidance of shallow waters, and "intelligent" tactics vs. air attack, would require a lot more effort.

Realistic ship movement is way beyond IL2's ability, since it doesn't take factors such as hull draft, turning radius, acceleration, deceleration, heeling angle, waves, wind, etc. into effect when determining ship movement.
Reply With Quote
  #2  
Old 06-14-2016, 10:46 AM
Asheshouse Asheshouse is offline
Approved Member
 
Join Date: Oct 2007
Location: UK
Posts: 271
Default

Quote:
Originally Posted by Pursuivant View Post

You could use a simple sine wave function and plot new way points at maximum and minimum amplitude along a line described by the ship's baseline course.
Zig zag would normally be done as a series of straight lines not curves. Each leg would be for a standard time, 10min I think.

There were different "standard" zig zags. Commodore would use signal flags to order the start, thereafter each ship could work to the clock, knowing what turn was next. On each "leg" they would follow a straight line.
Reply With Quote
  #3  
Old 06-14-2016, 10:57 AM
Pursuivant Pursuivant is offline
Approved Member
 
Join Date: May 2010
Posts: 1,439
Default

Quote:
Originally Posted by Asheshouse View Post
Zig zag would normally be done as a series of straight lines not curves. Each leg would be for a standard time, 10min I think.
You're correct, but since IL2 ships don't turn realistically (they instantly pivot around their Z axis), something resembling a sine wave path is needed to simulate a realistic turn. The long, straight "legs" you describe would be almost indistinguishable from a very relaxed sinusoidal path.

Obviously, not ideal in terms of absolute realism, and a crock when it comes to giving ships actual AI, but a potentially very simple hack (just 1 line of code for the movement pattern) for a programmer, which would make it slightly more challenging for players to hit moving ships.
Reply With Quote
  #4  
Old 06-14-2016, 09:44 PM
sniperton sniperton is offline
Approved Member
 
Join Date: Mar 2011
Posts: 253
Default

Quote:
Originally Posted by Pursuivant View Post
since IL2 ships don't turn realistically (they instantly pivot around their Z axis), something resembling a sine wave path is needed to simulate a realistic turn.
This is exactly how ground units turn, and this has a lot of to do with how routes follow straight lines between two pivotal waypoints, no matter if ground or naval units are concerned. What TD could do (if they can do) is to change the code to support bezier curve calculations for waypoints. This would also enable realistically bent roads on maps, what has been long desired by the community.
Reply With Quote
  #5  
Old 06-15-2016, 12:35 AM
Pursuivant Pursuivant is offline
Approved Member
 
Join Date: May 2010
Posts: 1,439
Default

Quote:
Originally Posted by sniperton View Post
This is exactly how ground units turn, and this has a lot of to do with how routes follow straight lines between two pivotal waypoints, no matter if ground or naval units are concerned. What TD could do (if they can do) is to change the code to support bezier curve calculations for waypoints. This would also enable realistically bent roads on maps, what has been long desired by the community.
+1

In the FMB, you could automatically have ground vehicles follow roads by using a variation of the "select similar color" function (AKA "Magic Wand" or "color picker") used by graphic design programs. Since on just about every map roads are lighter in color than the surrounding terrain, the "color picker" selects adjacent pixels of "road color" and plots a line based on that info. (For winter maps, the process is reversed and the color picker selects the darker colors.)

That, plus a bezier curve tool option would allow "realistic enough" turning.
Reply With Quote
  #6  
Old 06-15-2016, 09:41 AM
sniperton sniperton is offline
Approved Member
 
Join Date: Mar 2011
Posts: 253
Default

Quote:
Originally Posted by Pursuivant View Post
Since on just about every map roads are lighter in color than the surrounding terrain, the "color picker" selects adjacent pixels of "road color" and plots a line based on that info.
Yes, something like that would be the easiest way as far as ground units are concerned. All the more so, as maps are generated from a set of greyscale images, where the 'tile map' actually uses a brighter shade to specify tiles with roads. So summer and winter maps are all the same in this respect. Nevertheless, the tile map is a low resolution image, so keeping on the road could not be guaranteed that way, unless combined with bezier curve calculations between waypoints.

Now it works like you go from A to B in a straight line, there you turn for C, and go from B to C in a straight line again. All three waypoints are specified in the mis file. But with A, B, and C we also have all the coordinates for a bezier curve between A and C. All you need is to add the info that B is only a virtual coordinate to be used by the plotting algorithm.

Last edited by sniperton; 06-15-2016 at 12:50 PM.
Reply With Quote
  #7  
Old 06-16-2016, 03:55 AM
Pursuivant Pursuivant is offline
Approved Member
 
Join Date: May 2010
Posts: 1,439
Default

Quote:
Originally Posted by sniperton View Post
Nevertheless, the tile map is a low resolution image, so keeping on the road could not be guaranteed that way, unless combined with bezier curve calculations between waypoints.
Possibly, the "color tracking" method of keeping on roads would still work if the game took a large enough sample of nearby pixels, or if a particular color of pixels was reserved for roads. In the latter case, the "road line" could be a line just 1 pixel wide, invisible to the human eye in most cases. The former solution would require more processing power, the latter would require a lot of reworking for roads and railroads.

Quote:
Originally Posted by sniperton View Post
Now it works like you go from A to B in a straight line, there you turn for C, and go from B to C in a straight line again. All three waypoints are specified in the mis file. But with A, B, and C we also have all the coordinates for a bezier curve between A and C. All you need is to add the info that B is only a virtual coordinate to be used by the plotting algorithm.
This would work as well, possibly better.

Hopefully, someone from DT is reading this!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.