58
edits
(Created page with "AI scenarios are very simple. Simply tie a flightplan to a model, and you have a scenario. Below, I'm going to go explain exactly how this is done. == Flightplans and Their Wa...") |
|||
Line 23: | Line 23: | ||
Next, you need to create the scenario XML file. For the example, I will simply borrow an existing one, and make modifications to it. I’ll choose aircraft_demo.xml. As you will see, you need PropertyList and scenario tags. A description is optional, but recommended. Then, there’s an entry for a model. It starts with an entry tag. Then, it’s given a callsign. The type is aircraft. There are different types you can specify for different kinds of scenarios; however, we’re just going to focus on the aircraft type. There are various classes as well. This one is set to jet transport. I think there’s a light class as well, but they all seem to behave the same to me. If someone else, more knowledgeable in this area could clarify things that would be helpful. Next is the model. Just set the path to the aircraft of your choice. It’s recommended that you use a low-poly aircraft from the AI directory, but a regular aircraft works fine as well. After that is the flightplan parameter. Simply set the path to your flightplan. Finally, there is an option to set your scenario to either simply terminate or repeat once completed. Enter a 1 for repeat, a 0 for no repeat. Remember to add all your end-tags when you have finished, and save it with a name other than the one you modified (if you chose to modify an existing scenario). | Next, you need to create the scenario XML file. For the example, I will simply borrow an existing one, and make modifications to it. I’ll choose aircraft_demo.xml. As you will see, you need PropertyList and scenario tags. A description is optional, but recommended. Then, there’s an entry for a model. It starts with an entry tag. Then, it’s given a callsign. The type is aircraft. There are different types you can specify for different kinds of scenarios; however, we’re just going to focus on the aircraft type. There are various classes as well. This one is set to jet transport. I think there’s a light class as well, but they all seem to behave the same to me. If someone else, more knowledgeable in this area could clarify things that would be helpful. Next is the model. Just set the path to the aircraft of your choice. It’s recommended that you use a low-poly aircraft from the AI directory, but a regular aircraft works fine as well. After that is the flightplan parameter. Simply set the path to your flightplan. Finally, there is an option to set your scenario to either simply terminate or repeat once completed. Enter a 1 for repeat, a 0 for no repeat. Remember to add all your end-tags when you have finished, and save it with a name other than the one you modified (if you chose to modify an existing scenario). | ||
==Special Tools == | ==Special Tools == | ||
There are two great tools for making flight plans. You can use Oscar’s Flightplan Generator or redneck’s Flightplan Generator. They work very differently, but can be used together to further enhance your AI scenarios. Oscar’s Flightplan Generator uses a Google Maps interface in which you simply click on the location you want to place a waypoint at, and enter the rest of the data (speed, altitude, on-ground, etc.). redneck’s Flightplan Generator is a custom FlightGear logger. Simply start FG with the logger, using the --generic=file,out,0.1,path/to/flightplan/file,dgrecord2 command. This won’t work in FGRun’s interface, so just tack it on to the executable line, being sure to add a space between the executable and the command. Then, just fly the flight you want the AI aircraft to fly. Once finished, close FG, and check the flightplan file. You will find your once blank file is suddenly filled with all the necessary data, plus some useless data points. You will need to trim off the waypoints with KTAS < 10 so that your AI model can get off the ground in some reasonable amount of time. Both tools can be found at the Official FlightGear Forum. | There are two great tools for making flight plans. You can use Oscar’s Flightplan Generator or redneck’s Flightplan Generator. They work very differently, but can be used together to further enhance your AI scenarios. Oscar’s Flightplan Generator uses a Google Maps interface in which you simply click on the location you want to place a waypoint at, and enter the rest of the data (speed, altitude, on-ground, etc.). redneck’s Flightplan Generator is a custom FlightGear logger. Simply start FG with the logger, using the --generic=file,out,0.1,path/to/flightplan/file,dgrecord2 command. If you have named the logger something other than dgrecord2, then subsitute the actual name for dgrecord2. This won’t work in FGRun’s interface, so just tack it on to the executable line, being sure to add a space between the executable and the command. Then, just fly the flight you want the AI aircraft to fly. Once finished, close FG, and check the flightplan file. You will find your once blank file is suddenly filled with all the necessary data, plus some useless data points. You will need to trim off the waypoints with KTAS < 10 so that your AI model can get off the ground in some reasonable amount of time. Both tools can be found at the Official FlightGear Forum. | ||
==Common Issues == | ==Common Issues == | ||
I believe I have created the flightplan correctly, yet, when I run the scenario, the plane doesn’t follow the route as expected. | I believe I have created the flightplan correctly, yet, when I run the scenario, the plane doesn’t follow the route as expected. |
edits