[MOOSE] RAT - Random Air Traffic - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 10-03-2017, 12:28 PM   #1
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,100
Reputation power: 18
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Lightbulb [MOOSE] RAT - Random Air Traffic



Hi guys,

I have been working on a new implementation - simply named RAT - to generate random air traffic. This is something I was missing a lot in many of my missions

So what is RAT about?
RAT generates air traffic and fills the DCS sandbox with more life. Each aircraft will be spawned at a random airport of the map and gets a random route to another random destination. This creates a lot of dynamics and unpredictability to your missions with very little effort. Even the mission designer will not know what is going to happen.
When an aircraft has arrived at its destination it will be despawned and a new aircraft is spawned at another random departure airport and the game begins anew.


How much effort is it to use it?
One important aspect in the design of RAT was to keep it simple and easy to use even for people who are not so familiar with lua scripting but also very flexible at the same time. The most basic example needs two lines of simple lua code. But there are many options for fine tuning.


Which maps are supported?
All current DCS maps - Caucasus, NTTR and Normandy - are supported. Furthermore, the implementation of RAT is general, so that also all future maps such as SoH or whatever will come should be seamlessly usable as well.


Which airports are supported?
All airports of all maps. Again, the implementation is universal, so that there is no restriction regarding the airports. There are also several options to define which airports should or should not be used if this is desired.


What aircraft are supported?
There is no restriction regarding the aircraft type. You can use anything from civil aircraft over fighters and WWII birds to helicopters. Helos can also use FARPs and ships as airbases.
RAT works with templates. So you decide which aircraft will be included in the air traffic.


Will RAT interfere with the rest of my mission?
Only in the sense that your airspace gets more crowded. The main task of RAT planes is to fly from A to B. By default, they will not engage other units or even react to enemy threads if you don't ask them to.


What is the difference compared to other random air traffic scripts?
I'm aware of at least two other scripts that deal with random air traffic.
Firstly, there is a great script by SNAFU. However, in contrast to RAT it is rather specific and written to work only with airports on the Caucasus map.
Secondly, there is a very nice script by Zubetto. This script works with pre-defined routes the user has to create before the mission. So there is a bit more effort the user has to invest before the mission.


What about multiplayer?
RAT should work equally well in SP and MP.


Where is the catch?
The RAT implementation is kept general by supporting all maps, airports and aircraft types. This naturally leads to some problems. However, most of these can be handled by the user.

PROBLEM: The DCS AI logic sometimes causes aircraft to block each other on the taxi way. If that happens no aircraft is able to make its way to the runway or to its parking spot.
SOLUTION: If a RAT aircraft is on the ground and does not change its position for a certain time interval, it will be despawned automatically. By default the interval is set to 5 minutes. It has to be rather long (maybe even longer) because there are also many valid situations, where aircraft are waiting in a queue and don't need to be removed. The interval can be fine tuned by the TimeDestroyInactive option.

PROBLEM: If several aircraft arrive simultaneously at the same airport, the DCS ATC has often problems to manage the landing and/or take off queue. So it can happen that aircraft don't get landing clearance for a long time. This has been reported here.
SOLUTION: The RAT class has a build in rudimentary ATC queue. When RAT aircraft arrive simultaneously at the same aircraft, each one gets a holding point and the landing clearance is triggered for one aircraft after the other. This eases the workload for the DCS ATC but problems are still to be expected.

PROBLEM: Especially on the NTTR and Normandy map, there are quite a few smaller airports and airstrips. These can't be used by all aircraft especially bigger ones - the aircraft can land or takeoff but they don't have a parking space. This has two unpleasant consequences.
Firstly, if aircraft are spawned at these airports they are spawned in air on airports on the Caucasus map. On the NTTR and Normandy map however, aircraft are spawned on the runway and can even be spawned on top of each other - see here.
SOLUTION: The user can restrict the departure and destination airports for each aircraft type.
Secondly, if aircraft land at airports where they don't have a valid parking spot, they will be despawned directly after they land. This is a minor problem, but it causes that no new RAT aircraft is spawned since this is normally done after the aircraft has reached its parking position.
SOLUTION: RAT has an option so that aircraft can be respawned after the landing event with a certain delay. Check out the RespawnAfterLanding function.


Do you have an example?
There are several example missions available. These cover a lot of the basic RAT features and options. You can find them here. Most of the examples take place on the Caucasus map, but there are also some for NTTR and Normandy.


Is there a documentation?
The documentation is still WIP. But I have written a good portion already. You find it here.


Are there YouTube tutorials?
YT videos about RAT can be found on the MOOSE channel but I will also link them here in another post. They provide the basic concepts and cover important examples what can be done with RAT. With time, I'll add more episodes showing RAT in action.


What do I need for RAT?
RAT is a class of the MOOSE framework. You can download the latest Moose.lua file which includes RAT here. Note that you need at least MOOSE version 2.2.0!
I will make step-by-step guide how to set up a mission employing RAT in separate post of this thread.

Last but not least, a big thanks to Sven aka FlightControl! Without his help this project would not have been possible.

I hope RAT helps to fill your DCS sandbox with nice toys

PS: Note that the class is new and still WIP. I'm looking forward to your feedback.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1
funkyfranky is offline   Reply With Quote
Old 10-03-2017, 12:28 PM   #2
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,100
Reputation power: 18
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Lightbulb RAT Tutorials

Part 1: Introduction and Concepts


Part 2: Examples and Options



Step-by-step Setup Guide

Step 1:
First, you need to download the Moose.lua file from the MOOSE github page. This contains the RAT class. Here is also the direct link.

Step 2:


Open the DCS mission editor and:
  • Add an aircraft of your choice. In this example I use a Yak-40 as template group.
  • Rename the group to "RAT_YAK".
  • Check the "LATE ACTIVATION" tick box.

Step 3:
  • Create a new text file and rename the extension to .lua. In the following I will refer to this as "RAT Script.lua"
  • Open the "RAT Script.lua" file with a text editor and insert the lines
    Code:
    local yak=RAT:New("RAT_YAK")
    yak:Spawn(5)
    (If you are really lazy, you can also download the "RAT-001 - Basic.lua" file from the RAT example page: link.)

Step 4:


In the mission editor:
  • Add a new trigger: TYPE=ONCE, EVENT=MISSION START.
  • Add a new action for this trigger: ACTION=DO SCRIPT FILE.
  • Click on OPEN and load the "Moose.lua" file you downloaded in step 1.

Step 5:


Repeat similar steps as in Step 4 to include the "RAT Script.lua":
  • Add a second trigger: TYPE=ONCE, EVENT=MISSION START.
  • Add a new action for this trigger: ACTION=DO SCRIPT FILE.
  • Click on OPEN and load the "RAT Script.lua" file you created in step 3.

Step 6:


Start the mission and observe five Yak-40 being spawned at random airports.


Tips 'n' Tricks

Random Liveries
These are the available liveries of the Civil Aircraft Mod. Each spawned aircraft will get a random livery from the list.
Code:
local b737=RAT:New("RAT_B737")
local b747=RAT:New("RAT_B747")
local b757=RAT:New("RAT_B757")
local a380=RAT:New("RAT_A380")

local b737skins={"AM", "Air Berlin", "Airzena", "American_Airlines", "airBaltic", "British Airways", "C40s",
 "Clean", "Disney", "EA", "FINNAIR", "JA", "Jet2", "kulula", "LH", "OLD_BA", "OMAN AIR", "PAN AM",
 "Polskie Linie Lotnicze LOT", "QANTAS", "RYANAIR", "ThomsonFly", "TNT", "HARIBO", "Ukraine Airlines", "UPS"}
 
local b747skins={"AF-One", "AF", "AI", "IM", "LH", "NW", "PA", "KLM", "TA"}

local b757skins={"AA", "BA", "Delta", "DHL", "easyJet", "Swiss", "Thomson"}

local a380skins={"BA", "China Southern", "Emirates", "KA", "LH", "LHF", "Qantas Airways", "SA", "TA", "Clean"}

b737:Livery(b737skins)
b747:Livery(b747skins)
b757:Livery(b757skins)
a380:Livery(a380skins)
Note that the livery names are not necessarily identical to the ones you see in the mission editor!


Radio Communication
If you don't want to get spammed by RAT group radio messages like "passing waypoint", you can simply disable the COMM tick box of the RAT template group in the ME.
Click image for larger version

Name:	RadioOFF.png
Views:	37
Size:	36.5 KB
ID:	170846
In future, it will also be possible to enable/disable this setting via scripting.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1

Last edited by funkyfranky; 10-18-2017 at 09:47 PM. Reason: Corrected names of CAM liveries.
funkyfranky is offline   Reply With Quote
Old 10-03-2017, 12:34 PM   #3
rogonaut
Member
 
rogonaut's Avatar
 
Join Date: Oct 2015
Posts: 421
Reputation power: 2
rogonaut will become famous soon enoughrogonaut will become famous soon enough
Default

awesome stuff thank u, ill try this for sure!
rogonaut is offline   Reply With Quote
Old 10-03-2017, 12:36 PM   #4
59th_RAVENS
Senior Member
 
59th_RAVENS's Avatar
 
Join Date: Sep 2015
Location: United Kingdom
Posts: 1,181
Reputation power: 8
59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough
Default

Wow this is great, cant wait to give this a try.

Thank you
__________________
Decoy
i7-7700K oc at 5Ghz | GTX 1080ti | 32GB DDR4 Ram | Warthog & Saitek Peddles | 2DOF Reality Platform | Custom GAMETRIX Jetseat | CV1

Our Website
Our Facebook Page
YouTube Channel

59th_RAVENS is offline   Reply With Quote
Old 10-03-2017, 03:25 PM   #5
grunf
Senior Member
 
grunf's Avatar
 
Join Date: Jul 2015
Posts: 1,843
Reputation power: 12
grunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nicegrunf is just really nice
Default

Awesome!
grunf is offline   Reply With Quote
Old 10-03-2017, 04:48 PM   #6
EntropySG
Member
 
EntropySG's Avatar
 
Join Date: Feb 2015
Posts: 617
Reputation power: 5
EntropySG has a spectacular aura aboutEntropySG has a spectacular aura aboutEntropySG has a spectacular aura aboutEntropySG has a spectacular aura about
Default

Sweet congrats on the release!
__________________
EntropySG is offline   Reply With Quote
Old 10-03-2017, 05:19 PM   #7
Chicki
Member
 
Join Date: Aug 2010
Posts: 112
Reputation power: 8
Chicki is on a distinguished road
Default

How do I setup multiple types of aircraft?
Chicki is offline   Reply With Quote
Old 10-03-2017, 06:05 PM   #8
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,100
Reputation power: 18
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Default

Quote:
Originally Posted by Chicki View Post
How do I setup multiple types of aircraft?
Hey Chicki - good question

For each aircraft type you want to include, you need to add an own template group in the mission editor.

So if you want, for example, to add a C-130 additionally to a Yak-40, you have to add a new group of a C-130 in the mission editor, name it e.g. "RAT_C130" and set the "LATE ACTIVATION" tick box.

The lua code would look like this:
Code:
local yak=RAT:New("RAT_YAK")
yak:Spawn(5)

local c130=RAT:New("RAT_C130")
c130:Spawn(3)
This would spawn five Yak-40 and three C-130.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1
funkyfranky is offline   Reply With Quote
Old 10-03-2017, 06:12 PM   #9
59th_RAVENS
Senior Member
 
59th_RAVENS's Avatar
 
Join Date: Sep 2015
Location: United Kingdom
Posts: 1,181
Reputation power: 8
59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough59th_RAVENS is a jewel in the rough
Default

We have added various random flights into our training map for QRA.


Thank you for this gem

Sent from my SM-G950F using Tapatalk
__________________
Decoy
i7-7700K oc at 5Ghz | GTX 1080ti | 32GB DDR4 Ram | Warthog & Saitek Peddles | 2DOF Reality Platform | Custom GAMETRIX Jetseat | CV1

Our Website
Our Facebook Page
YouTube Channel

59th_RAVENS is offline   Reply With Quote
Old 10-03-2017, 08:04 PM   #10
Rudel_chw
Member
 
Join Date: Nov 2013
Location: Antofagasta, Chile
Posts: 777
Reputation power: 9
Rudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really niceRudel_chw is just really nice
Default

I'm a newbie when it cames to LUA programming, but was trying the demo missions and it works really well, I can fully envision a more alive world into which to fly.


However, wanting to test how much of a load it made on the performance of my PC, I increased the amount of planes ... but only five are being spawn ... ¿is there a limit to the quantity of planes it can handle?


Anyway, fantastic job ... thanks a lot
__________________
For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS Sierra
For Gaming: 24" Monitor - Ryzen 1500X - 16 GB DDR4 2400 - MSI GTX970 - SSD 384 GB - HDD 8 TB - Windows Server 2012R2 - Thrustmaster HOTAS Cougar
Mobile: iPad Pro 12.9" of 128 GB
Rudel_chw is offline   Reply With Quote
Reply

Tags
moose, random air traffic, rat

Thread Tools
Display Modes

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 02:23 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.