From The Depths - Forum
Thoughts regarding carrier deck ops, winches/tethers and Lua - Printable Version

+- From The Depths - Forum (
+-- Forum: Forgotten Shores Prealpha (/forumdisplay.php?fid=215)
+--- Forum: Info (/forumdisplay.php?fid=216)
+--- Thread: Thoughts regarding carrier deck ops, winches/tethers and Lua (/showthread.php?tid=30769)

Thoughts regarding carrier deck ops, winches/tethers and Lua - Soar - 2017-10-11 01:38 AM

Since the realistic physics in FS will mean that a runway will be required for launching heavier-than-water aircraft, I've been considering how you would go about creating a system for transferring aircraft between a carrier hangar and a flight deck in the game. I think automating this might be technically possible in FTD, using Lua and some trickery with harpoon missiles. Under FTD's physics constants, there's little point, but I've been thinking about the implications for FS.

I've prepared a simple diagram to illustrate the problem.


The aircraft being unloaded has to be moved through a couple of different points within the hangar in order to make it to the lift, which will carry it to the flight deck (the lift has to use a winch in FTD, in FS it could be an actual elevator). The problem with using the FTD tractor beams for this is that each vehicle can only be assigned to one tractor beam at a time, and the assignment cannot be changed through Lua (the Lua for tractor beams only includes a simple on/off switch, AFAIK), so the process cannot be automated, hence my proposed solution of winching the aircraft around using harpoon missiles instead.

Based on this thread, FS will include an all-new, improved system for winching, tethering and docking. I hope it will be flexible enough to be used for this sort of thing as well.

Another problem I've considered is the process of landing an aircraft on a flight deck. In FTD, craft can always be easily recovered simply by using tractor beams - I don't know whether there will be a direct equivalent to this in FS. If it were necessary to actually land on a flight deck, and the tethering system can be used in a way similar to the harpoons from FTD, perhaps it would be possible to replicate the function of a tail hook by tethering onto the flight deck to bring the aircraft to a stop. In this case, the trickiest part would be scripting the AI to execute a landing.

This leaves another related problem: Coordinating takeoffs and landings. Excess traffic on the flight deck could easily turn into excess debris on the flight deck. The carrier can control what outgoing traffic gets lifted up to the flight deck, but landing aircraft would have to run a Lua script that figures out when it's safe to land. If you also want the carrier to clear the flight deck for incoming traffic when it needs to recover aircraft before they fall down for lack of fuel or whatever, and to maintain course when aircraft are landing so the landing doesn't get fouled by a sudden maneuver, things continue to get more complicated. Although scripting all of this is probably possible, it also sounds like it would be more of a pain in the ass than it strictly needs to be.

With that in mind, I have a Lua suggestion to simplify this kind of inter-vehicle cooperation: Add a customizable string that each vehicle can modify via Lua to the FriendlyInfo object. This would allow vehicles' Lua scripts to communicate with each other. The carrier could look up whether any aircraft want to land, and the aircraft could see whether they have landing permission from the carrier. Creative scripters could use it for many other kinds of cooperation between vehicles as well.

RE: Thoughts regarding carrier deck ops, winches/tethers and Lua - Fernir - 2017-10-11 09:53 AM

I would go for international array and global enumeration so you can have faster runtime and readable code.

RE: Thoughts regarding carrier deck ops, winches/tethers and Lua - Ixos - 2017-10-11 11:44 AM

Real carriers (WW2) did not leave empty space inside their hangars, the only empty space was the elevators.

Here is an example layout used for Japanese Carrier Akagi:

[Image: VA21Xv9.png]

Here is an example image from inside the cramped hangar of a British Carrier:

[Image: Pawson46.jpg]

If we want game mechanics which support realistic constraints without super complex moving parts I would say just teleport the aircraft up to the flight deck and have the amount of elevators determine how long cool-down this "teleportation" have. Or maybe at most teleport aircraft to the rearmost elevator in bottom position and then move it up to the flight deck 1 aircraft at a time.

RE: Thoughts regarding carrier deck ops, winches/tethers and Lua - Soar - 2017-10-11 02:43 PM

The hangar configuration can be made more cramped than in the example diagram, but if there isn't a set open path the aircraft can be moved through, you have to program the script to do a complicated shuffle if you want to make sure the exits and flight deck can't get clogged up with aircraft that happen to be unlaunchable at the moment (due to being damaged, unfueled, unpiloted, etc), and that starts getting into more scripting complexity than I think I can be bothered to figure out.

I would not be averse to a simplified game mechanic for hangar ops if Nick wants to spend the development time for it.