Jump to content

MOOSE - Mission Object Oriented Scripting Framework


Recommended Posts

So one thing with Squadron start/stop. Do you think you could setup both a red and a blue squadron at an airbase and stop start (invert) the squadron on the capture event?

I did this manually with a spawn, but using the entire module to do this is more preferable, it removes about 100 lines of code from a previous campaign.

Thanks for the feedback Rivvern!

 

On the error reported related to CAP, I will verify this thoroughly.

Not seen this error yet.

 

My answers:

 

Q1: These statements are for filtering the output of logging in the dcs.log.

I generate logging because I need to understand that is happening when developing.

But when released, these statements aren't producing any output by default.

So you can use the Trace, T, E, F methods of BASE class to activate and add trace...

Check the BASE class documentation here:

http://flightcontrol-master.github.io/MOOSE/Documentation/Base.html#BASE

 

Q2: This is a good suggestion and I will look into this.

Actually, was already planning to do such.

A nice additional feature for CAP is to set the zone selection probability for each zone. Imagine you hand zone1 and zone2 for CAP, but you wanna have zone1 40% and zone2 60% probability given to let planes CAP in a zone...

Another function would be to let CAP planes "switch zones" or "reselect" zones. This could be triggered over time or with a specific API. The zone probabilities could be modified during mission execution to ensure that the zones with the highest threat expected to be guarded are CAPped.

 

Q3: Also a good one and an important one... When we think about this, it could be implemented by adding a method SquadronStop and SquadronStart... When stopped, the airplanes airborne would then need to return home immediately... The SquadronStop could be made conditional, only to be executed when the squadron is not active in combat.

SquadronStop could also be used when an airbase with squadrons allocated is captured... In that case, further actions may be required to be done, but that depends on the mission designer.

Methods like SquadronTransferAirbase or SquadronTransferCoalition or SquadronDestroy are possible actions. In terms of resource management, it would be nice to have squadrons resupplied, that is, planes flying into the scene and landing add the base. Once landed, the plane could be added to the squadron.

 

There are a lot of things that can be added.that is what I mean with "flexible" and "expandable".

AWACS guarding, TANKER guarding, Squadron splitting, Squadron escorting, Squadron sweeping an area are all additional functions to be done.

 

The exciting thing will be when I start to make the AI_A2A_DISPATCHER interact with the TASK_A2A_DISPATCHER... So players (pilots) can get a view on what the AI defences are doing as part of the A2A dynamic tasking framework (which works today)...

 

These are the reasons why I started to develop the GCICAP replacement.

 

Sven

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

Done the job and find here some prototypes of the implementation ...

 

The class CONTROLLABLE has been added with the following new methods:

  • PatrolRoute()
  • PatrolRouteRandom( Speed, Formation )
  • PatrolZones( ZoneList, Speed, Formation )

 

You can now make a (ground) GROUP patrol in various ways.

 

I've added 4 demonstration missions, as outlined below and in attachment.

I've also added a prototype moose.lua (zipped) so you can try these yourself!

 

1. Patrol following the predefined route

 

 

Vehicle = GROUP:FindByName( "Vehicle" )
Vehicle:PatrolRoute()

2. Patrol selecting random points on the predefined route

 

Demo mission:

 

 

 

Vehicle = GROUP:FindByName( "Vehicle" )
Vehicle:PatrolRouteRandom( 120, "Vee" )

3. Patrol selecting random points in a zone

 

 

 

Vehicle = GROUP:FindByName( "Vehicle" )
Vehicle:PatrolZones( { ZONE:New( "ZONE" ) }, 120, "Vee" )

4. Patrol selecting random points in a list of zones

 

 

 

Vehicle = GROUP:FindByName( "Vehicle" )
Vehicle:PatrolZones( { ZONE:New( "ZONE1" ), ZONE:New( "ZONE2" ), ZONE:New( "ZONE3" ) }, 120, "Vee" )

Hope you like this addition and enjoy!

 

Please provide feedback if okay and I'll properly document the methods and add it to the moose.lua release 2.2.0.pre.

 

Enjoy!

FC

 

I've been waiting for something like this for sooo long, amazing! Missions are getting better and better :thumbup:

Link to comment
Share on other sites

I've been trying to use the AI Balancer all day today.. I am able to get both sides to spawn, and

both sides fly to their assigned patrol zones, and then they ignore anything and everything around them. Other AI, other players, etc. The opposing patrol zones overlap each other so I expected a huge air battle.. but instead they just all fly around not doing anything. Landing and respawning works and they continually populate the air space. They just don't attack.

 

I'm a little confused by the example code for AIB-002

 

It seems within the function the intellisense breaks down and no longer gives hints as to what options are available for a given object.

 

function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )

 local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" )
 local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )


 PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
 PatrolZones[AIGroup]:ManageFuel( 0.2, 60 )
 PatrolZones[AIGroup]:SetControllable( AIGroup )
 PatrolZones[AIGroup]:__Start( 5 )

end

 

The PatrolZones[AIGroup] doesn't give hints as to options that can be set. I thought by adding a :SetEngageZone(PatrolZone) would help but it logs as a nil value.

 

Any tip as to what I'm doing wrong? :helpsmilie:

Link to comment
Share on other sites

If I am not mistaken, AI_PATROL_ZONE sets engagement to off for some reason. I would rather that be left to the mission designer. You might be able to set the engagement back on (I forget what the method is but try looking in CONTROLLABLE. However, may not work as AI_PATROL_ZONE might reset it whenever it sets a new route.

 

What you really want to use is AI_CAP_ZONE most likely. Works almost exactly the same as AI_PATROL_ZONE but you also setup an engagement zone. Take a look at CAP-011 demo mission.

 

All this was changed maybe 6-8 months ago when AI_CAP_ZONE was born.

 

I've been trying to use the AI Balancer all day today.. I am able to get both sides to spawn, and

both sides fly to their assigned patrol zones, and then they ignore anything and everything around them. Other AI, other players, etc. The opposing patrol zones overlap each other so I expected a huge air battle.. but instead they just all fly around not doing anything. Landing and respawning works and they continually populate the air space. They just don't attack.

 

I'm a little confused by the example code for AIB-002

 

It seems within the function the intellisense breaks down and no longer gives hints as to what options are available for a given object.

 

function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )

 local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" )
 local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )


 PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
 PatrolZones[AIGroup]:ManageFuel( 0.2, 60 )
 PatrolZones[AIGroup]:SetControllable( AIGroup )
 PatrolZones[AIGroup]:__Start( 5 )

end

 

The PatrolZones[AIGroup] doesn't give hints as to options that can be set. I thought by adding a :SetEngageZone(PatrolZone) would help but it logs as a nil value.

 

Any tip as to what I'm doing wrong? :helpsmilie:

Link to comment
Share on other sites

Don't work, maybye only on my side....

I have used your 'Patrol following the predefined route' mission and just change the unit from the M113 to the Admiral Kuznetsov aircraft carrier (rename the group name).

 

when the carrier hit the last waypoint, it is not start a new patrol round - it just turning on WP 4 (DP) with more or less 0 knots.

GRP-550 - PatrolRoute-RU-Carrier.miz

Playing: F-16C

Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof.

Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh

Ghost0815

Link to comment
Share on other sites

Don't work, maybye only on my side....

I have used your 'Patrol following the predefined route' mission and just change the unit from the M113 to the Admiral Kuznetsov aircraft carrier (rename the group name).

 

when the carrier hit the last waypoint, it is not start a new patrol round - it just turning on WP 4 (DP) with more or less 0 knots.

 

 

OK. I haven't tested ships yet in the prototype. Let me have a closer look at this. Ships or Vehicles, it should not matter, should it? Let's see!

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

That was it! Thx! :pilotfly:

 

Cool! Great you got that working with the help of Delta99!

 

You may also wanna have a look at the AI_A2A_DISPATCHER!

 

What is the next thing you're going to use?

 

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Updated versions

 

Don't work, maybye only on my side....

I have used your 'Patrol following the predefined route' mission and just change the unit from the M113 to the Admiral Kuznetsov aircraft carrier (rename the group name).

 

when the carrier hit the last waypoint, it is not start a new patrol round - it just turning on WP 4 (DP) with more or less 0 knots.

 

I agree, it was my mistake. I am sorry. I should have tested ships too.

 

So, i did some work on the logic and improve a lot of stuff.

Tested ships also.

 

Attached you can find an updated prototypes, now also with ships tested.

 

Patrol a route:

 

Screen_170925_130017.jpg

 

-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )

-- Patrol the route of the Vehicle.
Vehicle:PatrolRoute()

-- Find the Ship and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )

-- Patrol the route of the Ship.
Ship:PatrolRoute()

 

 

Patrol random points of a route:

 

Screen_170925_130027.jpg

 

-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )

-- Patrol to random points of the route at 120 km/h in "Vee" formation.
Vehicle:PatrolRouteRandom( 120, "Vee" )

-- Find the Ship and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )

-- Patrol to random points of the route at 120 km/h in "Vee" formation.
Ship:PatrolRouteRandom( 120, "Vee" )

 

 

Patrol a zone:

 

Screen_170925_130048.jpg

 

-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )

-- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format.
Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE" ) }, 120, "Vee" )

-- Find the Vehicle and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )

-- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format.
Ship:PatrolZones( { ZONE:New( "ZONESHIP" ) }, 120, "Vee" )

 

Patrol between multiple zones:

 

Screen_170925_130105.jpg

Screen_170925_130112.jpg

 

-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )

-- Patrol to random points in the trigger zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format.
Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE1" ), ZONE:New( "ZONEVEHICLE2" ), ZONE:New( "ZONEVEHICLE3" ) }, 120, "Vee" )

-- Find the Ship and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )

-- Patrol to random points in the trigger zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format.
Ship:PatrolZones( { ZONE:New( "ZONESHIP1" ), ZONE:New( "ZONESHIP2" ), ZONE:New( "ZONESHIP3" ) }, 120, "Vee" )

GRP-550 - Patrol a route.lua

GRP-550 - Patrol a route.miz

GRP-551 - Patrol to random points of a route.lua

GRP-551 - Patrol to random points of a route.miz

GRP-552 - Patrol in a zone.lua

GRP-552 - Patrol in a zone.miz

GRP-553 - Patrol in a list of zones.lua

GRP-553 - Patrol in a list of zones.miz

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

That was going to be the next thing I try FC. Thank you.

 

I did have a few question about the ai balancer though. My missions tend to have a lot of slots. 20+ on each side in some cases. Having 40 AI take off at the beginning trends to have them all clumped together. I found a way to limit how many are active at any giving time and how often they take off, so was able to get the balance right in that regard.

 

Question: if I have 40 slots, but used an initlimit() on the spawn object.. To say 10 (so only 10 active AI at time) when players join slots will the number of AI be reduced? Or will all slots have to be full before AI slots are reduced?

 

Or put another way. Server has 40 slots, If there are 10 blue AI flying around, and a player joins blue, will I have 11 aircraft in the air? Or will one ai go home / be disabled?

 

What I would really like to do to balance a mission with AI is Instead of the entire server launching every plane.. That it works one for one. I. E

 

Player joins blue. Red AI is spawned.

Player joins red. Blue AI is spawned.

1 player on each side, No AI is spawned.

5 players on blue, 5 AI on red.

 

Etc


Edited by TracerFacer
Link to comment
Share on other sites

That was going to be the next thing I try FC. Thank you.

 

I did have a few question about the ai balancer though. My missions tend to have a lot of slots. 20+ on each side in some cases. Having 40 AI take off at the beginning trends to have them all clumped together. I found a way to limit how many are active at any giving time and how often they take off, so was able to get the balance right in that regard.

 

Question: if I have 40 slots, but used an initlimit() on the spawn object.. To say 10 (so only 10 active AI at time) when players join slots will the number of AI be reduced? Or will all slots have to be full before AI slots are reduced?

 

Or put another way. Server has 40 slots, If there are 10 blue AI flying around, and a player joins blue, will I have 11 aircraft in the air? Or will one ai go home / be disabled?

 

What I would really like to do to balance a mission with AI is Instead of the entire server launching every plane.. That it works one for one. I. E

 

Player joins blue. Red AI is spawned.

Player joins red. Blue AI is spawned.

1 player on each side, No AI is spawned.

5 players on blue, 5 AI on red.

 

Etc

 

Ok. Lots of questions, which is good.

 

 

Question: if I have 40 slots, but used an initlimit() on the spawn object.. To say 10 (so only 10 active AI at time) when players join slots will the number of AI be reduced? Or will all slots have to be full before AI slots are reduced?

 

The AI will be reduced when 1 players has joined.

 

 

Server has 40 slots, If there are 10 blue AI flying around, and a player joins blue, will I have 11 aircraft in the air? Or will one ai go home / be disabled?

 

 

When a player joins, an AI will return if the maximum of AI in the air has been achieved.

Note that the return of the AI is conditional. If there is an enemy in the range of the AI to return, and the enemy is a player, the AI won't return but will remain engaged with the enemy.

 

What I would really like to do to balance a mission with AI is Instead of the entire server launching every plane.. That it works one for one. I. E

 

 

You don't need an AI balancer for this, but can use the event system to spawn AI when a player enters a slot. But in this case it is MUCH better to look into AI_A2A_DISPATCHER.

This helps you to configure a complete A2A defence system.

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Some new updates have been pushed.

 

Now the moose.lua file is reduced in size ... from 2.1 MB to 0.8 MB which results in faster mission loading, faster performance. Less overhead.

 

Also a minor error has been fixed in AI_A2A_DISPATCHER where the GCI would fail if unlimited resources were allocated to a Squadron (Resources = nil).

 

Please reload the new moose.lua from the releases page:

 

https://github.com/FlightControl-Master/MOOSE/releases

 

good luck!

Sven


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

First of all thanks ALOT for all the scripts. I really dont know where you guys find the will to write code after getting home from the office, so again, thank you.

 

I have simple question: where can i find a commented version of the moose.lua?

 

You know, 26.2K lines of code without a single line of comment or any sort of indentation is pain to read :book:

200m butterflier inside :harhar:

 

MERLO forever

Link to comment
Share on other sites

First of all thanks ALOT for all the scripts. I really dont know where you guys find the will to write code after getting home from the office, so again, thank you.

 

I have simple question: where can i find a commented version of the moose.lua?

 

You know, 26.2K lines of code without a single line of comment or any sort of indentation is pain to read :book:

 

I think I asked for both versions too when it was changed to strip all comments.

 

I knew there would be a lot of requests for the original with comments.

Link to comment
Share on other sites

Hi all,

 

You knew it was coming, well, here it is ...

 

Release 2.2.0 of MOOSE

The new Release 2.2.0 of the MOOSE framework has a focus on bringing or extending the A2A and A2G capabilities!

It brings a lot of fixes and optimizations.

 

The latest moose.lua file can be downloaded from the

 

MOOSE Release Page ON GITHUB

 

Download the moose.lua and include in your .miz file using a DO SCRIPT Trigger.

Mission Designers need to read here for a detailed usage description.

Consult the MOOSE documentation for further details on the framework.

 

Find here a short summary of each added major function block, with a link to the documentation.

 

 

1. Setup an advanced AI Air Defense System

 

687474703a2f2f666c69676874636f6e74726f6c2d6d61737465722e6769746875622e696f2f4d4f4f53452f50726573656e746174696f6e732f41495f4132415f444953504154434845522f446961312e4a5047

 

The AI_A2A_DISPATCHER is a new class, that brings a GCICAP capability to be used by mission designers. It is very versatile, introduces squadrons located at specific airbases.

 

The GCICAP is not a one to one conceptual copy of the existing GCICAP script, a lot of new stuff has been added, lots of improvements have been made, and more flexibility has now become possible to tweak the behaviour.

Per squadron defined, specific options can be set:

 

  • Execute Control Air Patrol (CAP) at defined zones.
  • Execute Ground Control Intercept (GCI) towards intruders.
  • Define the defense overhead, meaning, the amount of defending planes to be spawned based on the attackers counted.
  • Define the grouping of the defenders, group per 1, 2, 3, 4.
  • Define the border zones
  • Define the take-off methods.
  • Define the landing methods.
  • Resource management.
  • Airborne Refuel management of CAP planes.

A derived class from AI_A2A_DISPATCHER is AI_A2A_GCICAP, which brings a more end-user friendly implementation, where noob users can configure easily a defense system and visually place the squadrons on the defending airbases and define the zones. A lot is defaulted.

 

2. Dispatch INTERCEPT, ENGAGE, SWEEP tasks to online players

 

 

687474703a2f2f666c69676874636f6e74726f6c2d6d61737465722e6769746875622e696f2f4d4f4f53452f50726573656e746174696f6e732f5441534b5f4132415f444953504154434845522f446961312e4a5047

 

The TASK_A2A_DISPATCHER defines tasks for human players to engage upon in order to accomplish a larger mission, and is the human counterpart of the AI_A2A_DISPATCHER.

 

The system provides a true dynamic environment for mission designers and players to define exciting missions.

The system uses the DETECTION_ class suite to detect targets, which are reported to a COMMANDCENTER. The COMMANDCENTER is then collecting and grouping the detections and planning or assigning tasks to individual players who are logged onto the server. A complete menu system is defined that allows players to interact with the tasking system: enquire the briefing, enquire reports on the different tasks, enquire status and engage/abort tasks...

 

The TASK_A2A_DISPATCHER works together with the SCORING class to setup exciting scoring schemes to allow mission designers to accomplish individual scores on a score board.

 

3. Dispatch CAS, BAI and SEAD tasks to online players

 

 

687474703a2f2f666c69676874636f6e74726f6c2d6d61737465722e6769746875622e696f2f4d4f4f53452f50726573656e746174696f6e732f5441534b5f4132475f444953504154434845522f446961312e4a5047

 

The TASK_A2A_DISPATCHER is built on the overall TASKING system, which also the TASK_A2G_DISPATCHER is using. As a result, the TASK_A2G_DISPATCHER has also been improved, especially the menu system and the overall coordination of the different tasks.

 

4. Settings and Options management for online players

 

The SETTINGS class is a new capability within MOOSE that allows to define various settings for different moose classes, and are kept persistent per server for players. The current settings that are modeled are for A2G and A2A formats used during communications, like BR, LL, MGRS, BULLS, BRAA ... Additionally, an imperial and metric measure system has been setup.

So players can use this menu to configure their own preferred settings, and automatically the system will use the right communication format during routing, briefings etc.

 

On top, COMMANDCENTERS will have menus to setup the default settings for a server.

 

The system is automatically included within the MOOSE system and these menus will be automatically available when you design missions using MOOSE.

 

5. Keep airbases clean from clutter and debris

 

687474703a2f2f666c69676874636f6e74726f6c2d6d61737465722e6769746875622e696f2f4d4f4f53452f50726573656e746174696f6e732f434c45414e55505f414952424153452f446961312e4a5047

 

This class has been a while in MOOSE, but has now been completely revised and improved. Use the the class to keep your airbases clean and to guarantee airbase operations (airbases stop operations if a plane crashes on the runway, or if any missile or bomb is dropped on the runway).

 

6. Let online players Transport Infantry to various locations

 

The release 2.1 of MOOSE introduced the TASK_CARGO_TRANSPORT capability. The system has been heavily debugged and more functionality has been added, like automatic respawing of cargo when it is destroyed in the field, or when a carrier crashed when the cargo was loaded in the carrier etc. The menu system to transport cargo has been optimized, and the overall workings have been improved and bugs have been resolved.

 

7. Setup Random Air Traffic, make use of the airspace!

 

The new RAT class, which implements Random Air Traffic, has been added, and is a development of FunkyFranky... (Frank)... He has done a magnificent job and I really encourage you all to try this out. I will let Frank introduce further the RAT class in a separate post!

 

8. Reduction of moose.lua file size!

 

Based on a great idea of Shadowze, an optimization has been done to reduce the moose.lua file size from 2.1 MB to 0.8 MB. This results in faster mission loading, faster performance.

 

 

 

We hope that Release 2.2.0.pre of MOOSE will even more increase the fun level for DCS fans while using the MOOSE framework.

 

Thanks to all those who have helped and contributed!

 

Thanks,

FC and FunkyFranky

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Thanks to ED for putting down a solid hotfix!

Thanks to FlightControl and community for MOOSE!

[sIGPIC][/sIGPIC]

 

 

Asus Z390-E, 32GB Crucial Ballistix 2400Mhz, Intel i7 9700K 5.0Ghz, Asus GTX1080 8GB, SoundBlaster AE-5, G15, Streamdeck, DSD Flight, TM Warthog, VirPil BRD, MFG Crosswind CAM5, TrackIR 5, KW-908 Jetseat, Win 10 64-bit

 

”Pilots do not get paid for what they do daily, but they get paid for what they are capable of doing.

However, if pilots would need to do daily what they are capable of doing, nobody would dare to fly anymore.”

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...