Jump to content

Autonomous Ground Force Tasking


Recommended Posts

Hello everyone,

 

 

Just wanted to present the "Autonomous Ground Force Tasking" project to the forum.

 

Project goal

Quote
This project aims to enable DCS World mission makers to easily set up dynamic battle scenarios by using zones.

AI units of a task force will automatically move to capture target zones, advance through captured zones and be reinforced when taking casualties.

Download here

 

Getting started

 

Visit project repository

 

https://www.youtube.com/watch?v=Cqv3Mj-Ss58

 

Any feedback is highly appreciated. If you have any questions or want to see more usage examples, feel free to ask.

 

 

(WARNING: The code is under development. The various links, code snippets, and discussions found throughout this thread will be subject to change. The project repository, the examples found there and this (initial) post will be kept up-to-date.)

 

:pilotfly:


Edited by gromit190
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hello everyone,

 

 

Just wanted to present our "Autonomous Ground Force Tasking" project to the forum.

 

Our goal

 

 

How it works

Task forces (AI units) will try to assume control of pre-defined mission trigger zones. Once the task force units has cleared a zone of enemy units, it will move to the next in the list (automatically). If any of the task force's previously controlled zones are invaded by enemies, the task force will retreat to retake that zone.

 

 

Project repository

 

 

Any feedback is highly appreciated. If anyone feel like they want to contribute to the project in any way, that'd be great. Currently we are just a couple of people where I do most of the coding and some people from my virtual wing help out on the system design.

 

 

(Credits to the creators of the very useful MissionScriptingTools project)

(Credits to MOOSE project, for providing LDT documentation for functions in DCS)

 

:pilotfly:

Great concept!

 

BTW, for YT videos all you need is the YT designated "name" for you video (Cqv3Mj-Ss58 ) between the YT tags.

YouTube Channel: https://www.youtube.com/channel/UCU1...CR6IZ7crfdZxDg

 

_____

Win 10 Pro x64, ASUS Z97 Pro MoBo, Intel i7-4790K, EVGA GTX 970 4GB, HyperX Savage 16GB, Samsung 850 EVO 250 GB SSD, 2x Seagate Hybrid Drive 2TB Raid 0.

Link to comment
Share on other sites

This is what i was waiting for, my group will be very glad to play some dynamich AG missions with A10C and Gazelle

 

Thank you very much appreciated :thumbup::thumbup::thumbup:

[sIGPIC][/sIGPIC]

 

 

I7 8700K @ 4.9 ghz, SSD 850 evo, MSI Z370 Gaming Pro, GTX 1080Ti, F/A-18C in the garage, F-16C in the backyard, F-14B in the garden

Link to comment
Share on other sites

Just ran this through its paces and what a great job! Thank you!!!

 

I noticed in the video that red units appeared to be spawning. I tried adding spawning zones for the red side and adding them to the example.lua and it doesn't work. It does state that it wont but I figured if I added them it might.

 

Can there be more than one staging area? I was thinking that I could stage ground troops closer to the combat zones and ferry troops to assist in the fight. Of course that is when CTLD works again with the new DCS version.

Link to comment
Share on other sites

Thanks guys!

 

BTW, for YT videos all you need is the YT designated "name" for you video (Cqv3Mj-Ss58 ) between the YT tags.

 

Ah, okay. Thanks for the tip :)

 

Just ran this through its paces and what a great job! Thank you!!!

 

I noticed in the video that red units appeared to be spawning. I tried adding spawning zones for the red side and adding them to the example.lua and it doesn't work. It does state that it wont but I figured if I added them it might.

 

When you've edited and saved your changes to the example.lua, please re-load it to the mission from the mission editor.

Select the action that is loading the example.lua script file, click "OPEN" and select the example.lua. That way, the code from the script is re-added to your mission.

 

b1HgY7g.jpg

 

 

This is kinda a pain in the a*s to do each time you modify your script, the workaround is to use a "DO SCRIPT" instead of a "DO SCRIPT FILE" and make the mission load the script from wherever you have saved it each time you start the mission. But beware: the script will then no longer follow your mission so if you send your mission to someone they will get an error saying that the script is missing.

I use this code in a "DO SCRIPT" action to re-load the script on mission start:

assert(loadfile([[C:\Users\birge\Workspace\dcs-autogft\build\example.lua]]))()

 

 

If you already reloaded the script and it's still not working, would you mind sharing the code you're trying (the contents of your example.lua)?

 

Can there be more than one staging area? I was thinking that I could stage ground troops closer to the combat zones and ferry troops to assist in the fight. Of course that is when CTLD works again with the new DCS version.

 

Yes. If you specify more than one staging area ("base zone"), the script will look through all the staging areas to "take" the units it needs to reinforce the task force.

With that said, it is possible to have a task force that keeps respawning units, then sends them to the staging area of another task force.


Edited by gromit190
Link to comment
Share on other sites

Is it possible to define more than one task force group per side?

 

say blue group 1 move north through trigger zones: A1, A2, A3 ...A9; and blue group 2 move east through trigger zones: B1n B2, B3....A9?

 

Is it also possible to use pre-define groups on the map (not repawned)?

Waiting for: DCS: Mi-24 Hind, and AH 64D Apache

Intel i5-7600K @4.1GHz, 32GB DDR4 @2400MHz, GTX 1070 Gigabyte Gaming OC 8GB DDR5, WIN 10 64Bit Prof.

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

Ghost0815

Link to comment
Share on other sites

Is it possible to define more than one task force group per side?

 

say blue group 1 move north through trigger zones: A1, A2, A3 ...A9; and blue group 2 move east through trigger zones: B1n B2, B3....A9?

 

Yes.

 

Here's an example of how you can create multiple task forces. Also I'd like to mention that target and base zone(s) can be shared across multiple task forces (including enemy task forces).

-- A task force of 2x4 USA M-1 Abrams
-- Spawning at zone "SPAWN1"
autogft.TaskForce:new()
 :setCountry(country.id.USA)
 :addBaseZone("SPAWN1")
 :addTargetZone("A1")
 :addTargetZone("A2")
 :addTargetZone("A3")
 :addUnitSpec(4, "M-1 Abrams")
 :addUnitSpec(4, "M-1 Abrams")
 :respawn()
 :setTargetUpdateTimer(120)
 :setRespawnTimer(300)

-- Another task force of 2x4 USA M-1 Abrams
-- Spawning at zone "SPAWN2"
autogft.TaskForce:new()
   :setCountry(country.id.USA)
   :addBaseZone("SPAWN2")
   :addTargetZone("B1")
   :addTargetZone("B2")
   :addTargetZone("B3")
   :addUnitSpec(4, "M-1 Abrams")
   :addUnitSpec(4, "M-1 Abrams")
   :respawn()
   :setTargetUpdateTimer(120)
   :setRespawnTimer(300)

 

Is it also possible to use pre-define groups on the map (not repawned)?

 

Yes. This is actually what's done in the example mission (included in the autogft.zip).

 

Example code:

-- (STAGING AREA EXAMPLE)
-- Same as the previous code, but this time for some russian units and with a different base 
-- Note this task force will not respawn units. Only pre-existing units located in the base zone will be used to reinforce it
autogft.TaskForce:new()
 :setCountry(country.id.RUSSIA)
 :addBaseZone("STAGING1")
 :addTargetZone("Combat3")
 :addTargetZone("Combat2")
 :addTargetZone("Combat1")
 :addUnitSpec(4, "T-90")
 :reinforce()
 :setTargetUpdateTimer(120)
 :setReinforceTimer(300)

 

Here's a screenshot of the example mission:

ef528744-c305-11e6-9fa4-d19f45ac4b78.jpg


Edited by gromit190
Link to comment
Share on other sites

Okay, but the pre-define groups will not move forward or withdrawn - to act on the situation in the triggerzone!

 

Can you set the skill level for the spawned units?

 

What i like to do, have a fix number of groups (preset on the map) act like your spawn units. Red holding different trigger zones....

 

Edit: okay, i see the red units are not repawn but will taken from the unit stash in the zone.


Edited by mwd2

Waiting for: DCS: Mi-24 Hind, and AH 64D Apache

Intel i5-7600K @4.1GHz, 32GB DDR4 @2400MHz, GTX 1070 Gigabyte Gaming OC 8GB DDR5, WIN 10 64Bit Prof.

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

Ghost0815

Link to comment
Share on other sites

Okay, but the pre-define groups will not move forward or withdrawn - to act on the situation in the triggerzone!

 

Sorry, I'm not sure I understood what you meant. The pre-existing units in the example mission will just stay where they are initially placed. When the task force needs reinforcements, it will "take" the units it needs from the staging area (i.e. the "base zone").

In the example mission, it is specified that the task force should have 4x T-90s, so only 4 units will be used at a time. The rest of the units will just stay put until they are needed.

 

(You can test the example yourself to see what I mean: start the the example mission, go into the map, speed up the mission and you'll see red units are "picked out" from the pre-existing units located in the "STAGING1" trigger zone.)

 

Can you set the skill level for the spawned units?

 

Currently, I'm afraid not. The skill is set to "hard" by default and I havent added a function to set it. I'll add that ASAP :) Hopefully I can add it today or I won't be able to do it until tuesday...

 

What i like to do, have a fix number of groups (preset on the map) act like your spawn units. Red holding different trigger zones....

 

Okay. Let me show you an example:

 

- Make two trigger zones, for bases, name them "STAGINGAREA1" and "STAGINGAREA2".

- Put a lot of T-90s inside the trigger zones

- Add two more trigger zones, for targets, name them "ObjectiveA" and "ObjectiveB"

- Then, use this code

 

autogft.TaskForce:new()
 :setCountry(country.id.RUSSIA)
 :addBaseZone("STAGINGAREA1")
 :addBaseZone("STAGINGAREA2")
 :addTargetZone("ObjectiveA")
 :addTargetZone("ObjectiveB")
 :addUnitSpec(4, "T-90")
 :addUnitSpec(4, "T-90")
 :reinforce()
 :setTargetUpdateTimer(300)
 :setReinforceTimer(600)

 

 

EDIT:

Edit: okay, i see the red units are not repawn but will taken from the unit stash in the zone.

 

Okay :) I'll leave this post here anyways, in case it comes in handy for anyone else trying to do the same.


Edited by gromit190
Link to comment
Share on other sites

s

Okay, but the pre-define groups will not move forward or withdrawn - to act on the situation in the triggerzone!

 

Can you set the skill level for the spawned units?

 

What i like to do, have a fix number of groups (preset on the map) act like your spawn units. Red holding different trigger zones....

 

Edit: okay, i see the red units are not repawn but will taken from the unit stash in the zone.

 

Good point.

 

Many of uss likes to work with all units in map, not using respawning... so using the DAWS, you can do longer battles, and the enemy work autonomosly.

 

ANother question... did you test a limit of units??' there is a long time I dont do tests but when there are many units moving, the DCS start to get slower.

Link to comment
Share on other sites

s

 

Good point.

 

Many of uss likes to work with all units in map, not using respawning... so using the DAWS, you can do longer battles, and the enemy work autonomosly.

 

I hear you, and as we've stated in the readme:

 

When a task force is attacked and taking casualties, it can be set to be automatically reinforced using two modes:

 

- Spawn new units in the base(s)

- Assume control of pre-existing units located in the base(s)

 

What that means is that respawning units is just an option. You can choose not to respawn the units, and only use pre-existing mission units.

 

ANother question... did you test a limit of units??' there is a long time I dont do tests but when there are many units moving, the DCS start to get slower.

 

Units will only be respawned when they are killed, so there won't be any "flood" of units in the mission :)


Edited by gromit190
Link to comment
Share on other sites

i see that infantry are not included in the unit types... is there a reason for that or can the unit type list be modified to include infantry?

 

When I created the unit types list, I just ran a script extracting all the type names from a directory in DCS. I honestly haven't tested infantry, but I assume it should work. The same goes for aircrafts. Unfortunately I have noe chance to test it myself until tuesday...

 

I'm planning to get all the available unit types into the list soon. I know people have made quite extensive lists of all the types in DCS (as we discussed here), so it's should be fairly quick to do.

 

I have a little question, is it possible to trigger the moment when the units start moving ?

 

Hmm, good question (it should be). For now, you can put the "do script file" for the mission script (the "example.lua") in a different trigger than mission start, but I can add functions to have flag conditions for the task force movement later :)

 

For the next days, I'll be away from my computer (unfortunately ...) because of christmas celebration. So I apologize in advance for late replies :)

  • Like 1
Link to comment
Share on other sites

I cannot wait to try this on Sunday! Any chance of doing something like this for Helicopters?

 

Sierra

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

Wow, this is really fantastic work dude! Love it! Can you maybe consider popping onto the Moose forums and linking up with other great minds to see if it can be built into the Moose framework as a module? Other than that, I'd love to see more options on the spawning front, otherwise this is massive.

___________________________________________________________________________

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

Link to comment
Share on other sites

Any chance you can add a finite limit to the reinforce() function, something like reinforce(100) to allow a 100 unit pool? I see you handled reinforcing vs respawning, the only limitations in the "all units at start" scenario is the numbers of units in the mission at one time.


Edited by Pikey
reading closer

___________________________________________________________________________

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

Link to comment
Share on other sites

Great script! Just having a slight problem with it. No changes made to the example mission other that adding a Mi-8 or Uh-1 to the mission will case a CTD. The mission loads and as soon as I hit "Fly" it will CTD

The strange part, is adding the SA342 or Ka-50 no problem and everything works great.

Has anyone else come across this? Just wonder if it's something on my end or Belsimtek helicopters not playing nice with the script.

OB 1.5.560503

Last part of the log file.

EDCORE: # -------------- 20161225-232013 --------------

00496.148 INFO EDCORE: �

00496.150 INFO EDCORE: # C0000005 ACCESS_VIOLATION at 00000053 00:00000000

00496.153 INFO EDCORE: 00000000 00000000 0000:00000000

00496.158 INFO EDCORE: 00000053 0131E590 0000:00000000

00496.167 INFO EDCORE: 7810D78D 0131E5C0 0000:00000000 ?isGroup@wControl@@QEBA_NXZ()+D

00496.170 INFO EDCORE: 765FD3D4 0131E600 0000:00000000 ?regLuaEnv@Scripting@@YAXPEAUlua_State@@_N@Z()+8B4

00496.172 INFO EDCORE: 7A2B7254 0131E640 0000:00000000 luaD_growstack()+7A4

00496.175 INFO EDCORE: 7A2C6FB5 0131E7C0 0000:00000000 luaS_newlstr()+49C5

00496.177 INFO EDCORE: 7A2B7541 0131E7F0 0000:00000000 luaD_growstack()+A91

00496.179 INFO EDCORE: 7A2B684F 0131E970 0000:00000000 lua_getinfo()+11AF

00496.180 INFO EDCORE: 7A2B785E 0131E9B0 0000:00000000 lua_yield()+9E

00496.180 INFO EDCORE: 7A2B2440 0131EA00 0000:00000000 lua_pcall()+60

00496.181 INFO EDCORE: 3D2EC98E 0131EA70 0000:00000000

00496.181 INFO EDCORE: 3D33B9A3 0131EAD0 0000:00000000

00496.181 INFO EDCORE: 7A2B7254 0131EB10 0000:00000000 luaD_growstack()+7A4

00496.181 INFO EDCORE: 7A2C6FB5 0131EC90 0000:00000000 luaS_newlstr()+49C5

00496.181 INFO EDCORE: 7A2B7541 0131ECC0 0000:00000000 luaD_growstack()+A91

00496.182 INFO EDCORE: 7A2B684F 0131EE40 0000:00000000 lua_getinfo()+11AF

00496.182 INFO EDCORE: 7A2B785E 0131EE80 0000:00000000 lua_yield()+9E

00496.182 INFO EDCORE: 7A2B2440 0131EED0 0000:00000000 lua_pcall()+60

00496.182 INFO EDCORE: 3D32A13D 0131EF00 0000:00000000

00496.183 INFO EDCORE: 3D32AAE4 0131EF50 0000:00000000

00496.183 INFO EDCORE: 7FD5642F 0131EFD0 0000:00000000

00496.183 INFO EDCORE: 7FD56975 0131F020 0000:00000000

00496.183 INFO EDCORE: 3D2F6CE8 0131F090 0000:00000000

00496.183 INFO EDCORE: 3D2FE4B1 0131F0F0 0000:00000000

00496.183 INFO EDCORE: 3D2EC344 0131F120 0000:00000000

00496.183 INFO EDCORE: 3D2EC294 0131F150 0000:00000000

00496.184 INFO EDCORE: 3CFC743F 0131F800 0000:00000000

00496.185 INFO EDCORE: 3D402B5D 0131F840 0000:00000000

00496.185 INFO EDCORE: 87578364 0131F870 0000:00000000 BaseThreadInitThunk()+14

00496.185 INFO EDCORE: 8A0370D1 0131F8C0 0000:00000000 RtlUserThreadStart()+21

00496.278 INFO EDCORE: Minidump created.

00496.278 INFO DCS: try to write track file

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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