Friday, December 20, 2013

Integrating Nimitz into ATC mission

Currently I'm working on an Air Traffic Controller mission for ArmA3 on Altis. So far planes get spawned North, East, South and West and also at the center airport. These are usually Buzzards, though if the F/A-18 mod from John_Spartan/Saul is detected, F/A-18E and F are added to the mix for some variety. With a basic GUI the player can command the planes to take off, exit the airspace at one of the above directions, or land at the airport or any of the airfields on Altis.

The Nimitz is not part of the mix, yet. What follows are some thoughts on adding it. First there needs to be a check if the config for the Nimitz is present or not. If it's present, I also want to check for FUTARM maritime units by BloodOfTheScribe. If present their appearance add a lot of atmosphere to the soldiers on the carrier.

Given the Nimitz mod is present, it needs to be spawned somewhere in the water. Ideally dynamically and not to close to the coast. For a start it will be just a single spawn position, marked by an empty helipad. A dynamic spawning function might look like this: Use the four exit markers N, S, W and E (also empty helipads) as a base. Create an offset of lets say 1 to 2km to the center from there. Use these points as base for picking a random position within a 2 -3 km circle and place the carrier there if the coast is more than 1km away. Disadvantage might be the lack of randomness in these position. Ideally I'd write a function that detects sea positions on a grid over the map and use these sea position as base, rather than the static setup of the exit helipads.

Once the Nimitz is on map I need a couple of helper helipads for the automatic landing procedure, namely Approach1, Approach2, Approach3. In the traffic mission I simple placed them on map manually. Placing them dynamically should be not much a of a problem, I like to use a macro named CIRCLEPOS2 for that. It takes a center position, a direction and a distance and returns a point x and y coordinates:

#define CIRCLEPOS2(p,d,r) CIRCLEPOS((p select 0), (p select 1), d, r)

#define CIRCLEPOS(x,y,d,r) [x+r*sin(d),y+r*cos(d)]

Once these points have been setup I need to integrate the traffic missions functions. The traffic mission generates flightpaths that have the plane take off, visit some waypoints and return to the carrier via the Approach helipads. This needs to be changed, as the flightpath now is determined by the planes tasking and the ATCs commands. So instead of a single control function, two needs to be present, one for take off and one for landing.

Next is a big question: Should the player grant the taxi and take-off permissions on the carrier, as at the airport, or leave it to the AI? I think the player should take over this part. However, right now it's different from the airport: At the airport when a parked plane gets a take-off permission, it taxis and takes off in one go; on the Nimitz the path is divided into legs and a plane needs to get permission for any single leg. Like first getting access to an elevator, then taxiing to the catapult, then take-off permission. Actually not a bad separation, so I probably add the dividing of paths to the airport later as well.

Given that planes now ask the ATC player for taxi and take-off permission, there needs to be a GUI for this. It needs to hold the following information: general name of the location (Nimitz, airport), current plane position (elevator, hangar, taxi lane, catapult, runway) and desired plane position (taxi lane, catapult, runway, take-off) and a button to grant permission to do so.

Once all of this is in place I'll write what worked and what not :)

Thursday, December 19, 2013

Converting the Nimitz from ArmA2 to ArmA3

A couple of months ago a new mod appeared in ArmA3: The F/A-18 from John_Spartan and Saul. As I always liked planes, I tried it out ASAP and thought what a great mod it is! I modified a small mission by me on a Landing on Altis and swapped the Buzzard out for the Super Hornet.

Soon I thought about how nice it would be to have the boats and planes not spawn out of thin air, so I tried to create a form of pontoon, a 300 by 100 meter wide cube floating in the ocean. These were my first steps in oxygen2 and they were not exactly successful. With that in mind I tried to create an artificial island made of existing objects: Containers, bunkers and H-Barrier were all on the menu. The H-Barrier kind of worked with the F/A-18 - which is really forgiving when taxiing, taking off and landing on less than smooth surfaces. A short video on this attempt, featuring the F/A-18 and the H-Barrier island :)

Next I scrounged the BIS forums for any ships in ArmA3. There were quite a few work in progress threads, but nothing was released so far. Naturally the ArmA2 Nimitz thread started by piedebeouf  got my interest. The errors he reported seemed somehow familiar, as I tinkered with other ArmA2 mods in ArmA3 before. Soon I had something working, went ahead and posted a link to the modified scripts in the forums.

Foxhound took the initiative and informed JDog, the creator of the Nimitz for ArmA2, on the scripts. JDog replied on the forums and gave me permission to modify and improve the Nimitz. Since then a number of preview releases were made available to the ArmA community and hosted on Armaholic.