Quote:
Originally Posted by ben_wh
Agree that ship AI doesn't need to be very complicated; even an illusion of evasive maneuver (designed with collision avoidance in mind) would be welcomed.
|
One way to do this would be to allow mission builders to "copy and offset" waypoints in the FMB, and to assign them to different vehicles.
For example, say that you want to get a line of ships to zigzag in line abreast formation. You'd set the speed and zig-zagging waypoints for the first ship. Then you'd tell the FMB to copy that series of waypoints a certain number of times, offsetting each waypoint by a set direction and distance.
For example, for a formation of 5 ships, you'd tell the FMB to offset waypoints vertically (say north and south if the central ship is traveling east or west) by 300 m, centered on the first ship, with 2 iterations. That would give you a formation of 5 ships - one in the center, one offset by 300 m north, one at 600 m north, one at 300 m south, and one at 600 m south.
You could then edit each ship to make it different.
Alternately, or additionally, the FMB could allow the mission designer to include "station keeping" where certain vehicles are automatically linked in formation and are programmed to move identically to the "central" vehicle in the formation as best they can.
If the central vehicle is destroyed, or if a following vehicle cannot keep station for some reason, it automatically acquires the waypoints of the central vehicle, and attempts to follow those waypoints on its own.
This is already automatic, to some degree, for aircraft, but could be applied to any vehicle in the game. And, since simple "station keeping" routines in the FMB aren't true AI (with collision avoidance and enemy detection) they might not be that hard to program.
As a third idea, mission builders could be provided with "stock" sets of waypoints, such as zig-zagging, weaving, circling or altitude change which would modify the usual straight line path between waypoints.
For example, when the mission builder lays out waypoints, the FMB could give him the option for "zig-zag" with a set or "random within a given range" distance between zig-zags, and with a set or "random within a range" distance for each "leg" of the vehicle's path.
The mission builder would place his first waypoint normally, then "draw a line" to the second waypoint, but the FMB would interpret that as a whole series of zig-zagging waypoints and place them appropriately. That way, the mission builder just needs to place two waypoints and the FMB does the rest.
Pre-programmed movement using this option could be:
Zig-zag/weave - alternating 5 to 85 degree left and right turns with equidistant "legs" to each "zig" or "zag" and an offsetting turn of the same angle so that the vehicle consistently crosses its baseline path at the same interval of time or distance traveled.
Random zig-zag/weave - random 5 to 90 degree left and right turns that eventually get the vehicle to "point B".
Rectangular search pattern/overlapping squares/rectangles - The vehicle travels 2x meters, then turns 90 degrees left or right and travels y meters, it then turns in the 90 degrees in the same direction as it did before and travels for x meters in the opposite direction from its baseline course, it then turns again and travels back y meters, until it reaches its baseline course and turns 90 degrees again, at which the cycle repeats.
Circular search pattern/far escort/loiter - The vehicle travels 2n meters, then makes a circular turn to the left or right with a diameter of n meters.
Oval search/fare escort/loiter/"Race track" - As above, but the vehicle flies a series of overlapping ovals.
Corkscrew - aircraft makes a diving turn 5-15 degrees right or left and loses n/2 meters of altitude moving left or right until it until it reaches a point equal to (altitude to be lost/2). At that point, it reverses its turn and loses another n/2 meters of altitude until it reaches its baseline course and bottom baseline altitude. It then climbs and diverts from its baseline course until it regains (altitude lost/2) and reaches and equivalent point from its baseline course. It then reverses its turn and regains its baseline altitude and course at which point the cycle repeats.
Regular altitude change - As for zig-zag, but aircraft regularly gains and loses altitude within a set range.
Random altitude change - As for random zig-zag, but aircraft randomly gains and loses altitude within a set range. Always keeping a baseline distance above the ground.
Terrain hugging - Aircraft always adjusts altitude to remain X number of feet above the ground.