zorrobyte 30 Posted November 30, 2014 (edited) 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 November 30, 2014 by zorrobyte Share this post Link to post Share on other sites
CoA|Saint 5 Posted November 30, 2014 I'm at a loss for words... Aky4fP-8lio Share this post Link to post Share on other sites
kremator 1065 Posted November 30, 2014 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
zorrobyte 30 Posted November 30, 2014 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
kremator 1065 Posted November 30, 2014 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
zorrobyte 30 Posted November 30, 2014 (edited) Basic behavior plan: 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 November 30, 2014 by zorrobyte Share this post Link to post Share on other sites
serjames 357 Posted November 30, 2014 I think there is something similar in MCC, so it's definitely possible. SJ Share this post Link to post Share on other sites
SavageCDN 231 Posted December 1, 2014 yep I believe UPSMON and DAC also have a similar feature Project GoalShould 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
zorrobyte 30 Posted December 1, 2014 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
kremator 1065 Posted December 1, 2014 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
zorrobyte 30 Posted December 1, 2014 (edited) Expanded a bit on the empty vehicle behavior plan after some testing: 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 December 1, 2014 by zorrobyte Share this post Link to post Share on other sites
kremator 1065 Posted December 1, 2014 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
zorrobyte 30 Posted December 1, 2014 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
SteveJA 12 Posted December 1, 2014 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
zorrobyte 30 Posted December 2, 2014 (edited) 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 December 2, 2014 by zorrobyte Share this post Link to post Share on other sites
kremator 1065 Posted December 2, 2014 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
SavageCDN 231 Posted December 2, 2014 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
zorrobyte 30 Posted December 3, 2014 (edited) 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: Edited December 3, 2014 by zorrobyte Share this post Link to post Share on other sites
Hatchet_AS 201 Posted December 3, 2014 Really great looking stuff here so far. Lots of good ideas on the table. Share this post Link to post Share on other sites
kremator 1065 Posted December 3, 2014 Looking good mate. Keep up the good work. Share this post Link to post Share on other sites
CoA|Saint 5 Posted January 20, 2015 May I carefully ask how are you getting on? Share this post Link to post Share on other sites
teilx 4 Posted January 20, 2015 (edited) maybe on vacation to get new ideas for some funky new Projects or so.........xD Edited January 20, 2015 by TeilX Share this post Link to post Share on other sites