Jump to content
Sign in to follow this  
zorrobyte

[WIP] ZBE_Logistics - AI driven transport module

Recommended Posts

Project Goal

Addon/script based automatic AI transport module for dynamic movement/logistics on the battlefield.

What problem am I trying to solve?

Group A is an infantry unit with a fresh waypoint several clicks from current location. Stock A3, the AI will run until fatigue sets in then continue sluggishly moving along. There may be empty vehicles nearby, close technicals and an airfield full of aircraft yet the group will continue on foot.

Overview and functionality

With ZBE_Logistics the AI are aware of close empty vehicles, nearby friendly vehicles with cargo capacity for their group and friendly air assets that can transport their group to the objective.

How?

Each group is monitored for distant waypoints. Once a group with a distant waypoint is found, an FSM is ran on the group to evaluate available transport methods. This can be empty vehicles, friendly vehicles near the group and air assets available per side. If no logistical support is found, the FSM continues to check along the way until the group is close to the end of the waypoint. If found, transport is assigned and the group is transported to the waypoint.

Wishlist listed here are the "dream" goals for the project:

Optional ability for players to provide logistical support with cargo and air assets to AI and other players (think Arma's support gamemode)

Ability for AI<->AI sling load and transport of vehicles (could be very difficult to implement reliably)

AI fastrope dismount during certain situations

Optional custom sounds for AI radio chatter regarding logistics

Misc notes

Find nearest safe location and spawn hidden helipad for safer helicopter landings

Parameter to find a safe LZ at destination (some distance from final WP if enemies in area)

One FSM per infantry group or one fsm per plus FSM for available manned transport methods?

How to handle dumb AI driving, what if assigned transport reverses and drives into a rock repeatedly on the way?

If an AI finds an armed vehicle, in which conditions should they keep ahold of it and use it at the objective?

Should the AI attempt to mount static weapons once they reach the AO? If so, should the AI disembark from the static weapon once they get a new distant WP?

Will be ran from server only

Available aircraft should be included as transport by using setvariable (or global param)

Available empty vehicles should be included by default unless mission maker setvariable to exclude (or global param)

Available friendly ground vehicles should be included by default unless mission maker setvariable to exclude (or global param)

Document code and setup a Wiki

Timeline and expectations

This will be a long term, major project for me. I cannot guarantee a timeframe or if the idea will even work. Posting on the forums will help me stay accountable to my goals and collects useful feedback along the way.

License

This as with all of my projects (that permit) will be under a CC Attribution-ShareAlike 4.0 International license. Free to use, adapt and transform as long as you give credit and any modifications are under the same license. Don't like my work or something my projects do? Open it up, tweak it and rerelease - the whole community benefits.

Edited by zorrobyte

Share this post


Link to post
Share on other sites

I'm getting a good feeling about this .... good work old chap !

Now all you have to do is crack AI reviving players and you will be a god amongst coders :)

Share this post


Link to post
Share on other sites
I'm getting a good feeling about this .... good work old chap !

Now all you have to do is crack AI reviving players and you will be a god amongst coders :)

Would greatly depend upon which revive system was used as there is no universal solution. Awesome idea though, I'll put it on my project wishlist ;)

Share this post


Link to post
Share on other sites

We want the ZBE_revive system :)

Putting it on your list gives me that warm fuzzy feeling!

Share this post


Link to post
Share on other sites

Basic behavior plan:

NqBFqnH.jpg

Need to think about what if the vehicle is armed or tank, even if the whole group can't fit may be worth picking up vehicle anyway for additional firepower.

Need to put in checks for if the vehicle/aircraft is exploded before boarding so unit continues to WP, looking for other transport methods.

Need to confirm that FSMs auto end for dead groups as documented in OFP days, may need to add isalive checks.

Edited by zorrobyte

Share this post


Link to post
Share on other sites

I think there is something similar in MCC, so it's definitely possible.

SJ

Share this post


Link to post
Share on other sites

yep I believe UPSMON and DAC also have a similar feature

Project Goal

Should the AI attempt to mount static weapons once they reach the AO? If so, should the AI disembark from the static weapon once they get a new distant WP?

I would say yes as long as the unit is not the leader of the group... also if the leader moves X metres away unit should disembark static and join group formation.

Share this post


Link to post
Share on other sites

Wrote my first bit of code to break ground:

if ((((_x emptyPositions "Commander")+(_x emptyPositions "Driver")+(_x emptyPositions "Gunner")+(_x emptyPositions "Cargo")) >= (count units (group player))) && {((count crew _x) == 0)}) then {
wee = wee + [_x];
player moveInAny _x;
}
} foreach ((position player) nearEntities ["Car", 500]);

Really loving the new moveInAny command and I believe a FSM is going to be perfect to handle group behavior.

Share this post


Link to post
Share on other sites

Why isn't this finished yet? You've had a day .... come on you slacker :) Just kidding mate. The behaviour plan looks good, but does the Vehicle branch need the 'nearby within X metres' ?

Share this post


Link to post
Share on other sites

Expanded a bit on the empty vehicle behavior plan after some testing:

YyPIbw5.png

The real pain is how to handle waypoints as they are never deleted when units complete a WP. Bla bla bla

I just found the currentWaypoint command which will make it much easier to choose which WP to check for a long distance.

Edited by zorrobyte

Share this post


Link to post
Share on other sites

Remember to stick a 'Stuck vehicle' solve code in there - you know how AWFUL the AI are at driving!

Share this post


Link to post
Share on other sites
Remember to stick a 'Stuck vehicle' solve code in there - you know how AWFUL the AI are at driving!

Could write a separate module for this, ZBE_Unstuck. Would simply run a FSM on each manned ground vehicle and check POS every 5 seconds. If the vehicle doesn't move X meters within a certain timeframe, the vehicle is setPOS to findEmptyPosition nearest to original position. In fact, I'll work on this now as easy to do.

Share this post


Link to post
Share on other sites

Hello zorrobyte,

Would it be possible to check the type of waypoint before dismounting the troops. For example a seek and destroy waypoint will cause the group to dismount 1k away from the objective whereas a move waypoint is like the above. This would reduce the chances of ai driving blindly into fortified enemy positions in a car/truck. Would like to hear your thoughts.

Share this post


Link to post
Share on other sites
Hello zorrobyte,

Would it be possible to check the type of waypoint before dismounting the troops. For example a seek and destroy waypoint will cause the group to dismount 1k away from the objective whereas a move waypoint is like the above. This would reduce the chances of ai driving blindly into fortified enemy positions in a car/truck. Would like to hear your thoughts.

Wouldn't be difficult to do, would you find it beneficial if the group all dismounted other than driver/commander/gunner to take found armed vehicle into the S&D area? Possibly this can be a parameter for the module.

How does this look as a condition for an empty vehicle?

PreCondition:

_emptyVehicle = [];
{
if ((((_x emptyPositions "Commander")+(_x emptyPositions "Driver")+(_x emptyPositions "Gunner")+(_x emptyPositions "Cargo")) >= (count units _group)) && {((count crew _x) == 0)} && {(canMove _emptyVehicle)}) then {
_emptyVehicle = _emptyVehicle + [_x];
if (_debug) then {diag_log emptyVehicle};
}
} foreach ((position _zbeGroup) nearEntities ["Car", 300]);

Condition:

!(_emptyVehicle isEqualTo [])

Action:

_emptyVehicle = _emptyVehicle select 0;

Edited by zorrobyte

Share this post


Link to post
Share on other sites

Surely even a S&D WP would be fine going into the AO as long as there are no enemies seen. So a check on a side-shared KnowsAbout could be added prior to a disembark ?

Good news on the UNSTUCK ZB ! Cheers mate. Anything that helps the useless AI driving is surely a bonus. This maybe good as an addon that can always be run (in the same way that I run Ryd's 'Don't harm friendly troops you run over' mod :)

Share this post


Link to post
Share on other sites
Wouldn't be difficult to do, would you find it beneficial if the group all dismounted other than driver/commander/gunner to take found armed vehicle into the S&D area? Possibly this can be a parameter for the module.

I would say no to the entire group dismounting - driver gunner should stay in the vehicle.. unless it is not an armed vehicle like a truck? So if it has a turret keep the driver gunner, if not dismount the whole group? Then you have a problem of the group's empty vehicle... do they go back and grab it or try to find another? Hmmm....

Share this post


Link to post
Share on other sites

First WIP video showing group mounting empty vehicle and continuing to waypoint. Group mounting mannedvehicle and continuing to waypoint. In both tests, I setFuel 0 to show that AI will dismount if vehicle can no longer move and continue to next WP.

http://youtu.be/ovsG90xwJJs

FSM so far:

HIutxlH.png

Edited by zorrobyte

Share this post


Link to post
Share on other sites

maybe on vacation to get new ideas for some funky new Projects or so.........xD

Edited by TeilX

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×