Jump to content
Sign in to follow this  
madrussian

Making a BUSY squad unit take orders again

Recommended Posts

Spent the day pursuing my goal of creating a system to release specified units from ALICE2. Learned all about FSMs, figured out how to get ALICE2 to spawn a mix of regular civs (civ side) and Wolle armed civs (res side) in each town. Made a script to have a small % of the resistance guys recruitable. Succeeded in effective release from ALICE2, in terms of the unit no longer moving around or doing civ things (talking to other civs etc). I'm about 99% of the way there, but now I'm totally stumped on this last bit!

When you join an ALICE2 released man into your group, he is marked "BUSY", and won't follow you around. He will take move orders, etc. However, once recruited, he's quite useless without returning to formation! I have tried everything I can think of, so far to no avail...

Any ideas on how to get a BUSY unit to stop being BUSY and return to formation?

Share this post


Link to post
Share on other sites

Did you try to set the AI to careless?

Share this post


Link to post
Share on other sites

Hey thanks for the help. :) Hadn't tried setting behaviour to "CARELESS". Just tried that... No dice!

I've tried doStop, doFollow, disableAI "FSM" / enableAI "FSM". Tried having the unit join another group (even on another side) first, then player group. Tried doFSM (to try and clear out any residual fsm running), tried reversing all the setVariables that ALICE2 does back to nil. These guys are persistently stuck on "BUSY". Maybe the order matters though. Should I be doing these things before the join player or after? Other ideas?

Something is bound to reset these guys!

Share this post


Link to post
Share on other sites

my best guess is that the simplest way to achive a clean recruited unit would be to simply store the units classname (_class = typeof _man), deletevehicle him, createunit a identical unit in the squad of the player

Share this post


Link to post
Share on other sites

Hi M8

Have you tried selecting the unit & giving it a "STOP" order? - that solves the issue of inappropriate markings on the player icon, so worth a try.

Cheers

Orcinus

Share this post


Link to post
Share on other sites
Have you tried selecting the unit & giving it a "STOP" order? - that solves the issue of inappropriate markings on the player icon, so worth a try.

Yeah, I did try that. And everything else I could think of in terms of player interface issued commands. These guys are really stuck. They are the "busiest" guys I've ever seen who just manage to stand there!

my best guess is that the simplest way to achive a clean recruited unit would be to simply store the units classname (_class = typeof _man), deletevehicle him, createunit a identical unit in the squad of the player

Well, I'm sure that would work. What I'm really after though is creating more dynamics with the ambient civs. Here's a few scenarios that are crying out for a functional release from ALICE2:

  1. The evil occupiers stroll into town, single out a few civs, arrest them, load them in a truck and haul them off to prison. The best part is the player might see all of this happen in real time. A rescue attempt is possible, and if the player succeeds the rescued civs join his group as resistance side fighters. Sure I could wait until the civs end up jailed and swap them out for fresh units, but what if they player decides to rescue them as they are being cuffed / loaded up?
  2. A collaborator is working with the enemy, and lives right here in town. An ambient civ is chosen for the role. We like for him to be an ambient civ, that way he blends right in to the population. However, he needs to be able to run away effectively. This is where functional ALICE2 release comes into play. Also, if the collaborator survives the players ambush, we can use him again as a character in a later sub-mission. Thus another reason for functional ALICE2 release... so he won't get deleted when the player leaves town.
  3. Citizens of town are kept with little or no weapons by the brutal occupiers. This town has two types of ambient units: regular civ side men and women who will never fight -and- resistance side Wolle armed civ units who have all weapons removed and setCaptive=true (this way they blend right in with regular ambient civs). If the player captures an enemy weapon truck and brings it to town, all hell breaks loose. The majority of the male population release themselves from ALICE2, move to the truck, arm up, and are ready to fight! The beauty of it is, the Wolle units went from passive townsmen who would rather hide inside, to full bore resistance fighters who (based on mission scripting), can subsequently launch an attack on a remote target (in another town perhaps), and this transformation all happened in a matter of seconds! How's that for mission dynamics!

Indeed, the possibilities of a functional release from ALICE2 are limitless! But we have to get past this "BUSY" issue first. I suppose the next step is to determine exactly what's making them busy to begin with, in order to come up with a remedy. There's really not that much code inside of ALICE2. Time to start stubbing things out and see exactly what locks these guys down.

Thanks for the suggestions guys. Any other brainstorms/ideas on how to un-busy these guys, please let me know. Your ideas could very well save me huge time/effort, and open up a whole new world of mission possibilities. :)

Share this post


Link to post
Share on other sites

Ha! Nailed it! :yay:

It was a doFSM command after all! A slight modification of an FSM loop allows the FSM script to stop, and the unit relents from his ever-so-BUSY state. Also, I've figured out most if not all of the other commands necessary to restore the released unit to fighting form. I do not foresee any additional game-breaking roadblocks to a functional ALICE2 release system here.

What the finished product would look like is a mod of ALICE2 with a few additional commands/features:

  • Allow for any side unit generation (including units from multiple sides at once). Note that vanilla ALICE2 only allows for generating Civilian side units.
  • Release of Units from ALICE2 system. At this point you can do with them whatever you wish! (i.e. join the player, take up arms and independently go attack the enemy, get arrested and hauled off, run away from town like a madman, etc, etc)
  • Option to redirect ALICE2 data directory to your mission folder. The idea here is to allow mission creators the capability to easily make additional modifications to ALICE2 scripts directly inside the mission folder.

Absent using any of the features, I envision it working just like normal ALICE2.

I'm about 98% sure I can put something together here, though it will take some time. Anyone interested in the finished product?

Share this post


Link to post
Share on other sites

What the finished product would look like is a mod of ALICE2 with a few additional commands/features:

  • Allow for any side unit generation (including units from multiple sides at once). Note that vanilla ALICE2 only allows for generating Civilian side units.
  • Release of Units from ALICE2 system. At this point you can do with them whatever you wish! (i.e. join the player, take up arms and independently go attack the enemy, get arrested and hauled off, run away from town like a madman, etc, etc)
  • Option to redirect ALICE2 data directory to your mission folder. The idea here is to allow mission creators the capability to easily make additional modifications to ALICE2 scripts directly inside the mission folder.

Absent using any of the features, I envision it working just like normal ALICE2.

I'm about 98% sure I can put something together here, though it will take some time. Anyone interested in the finished product?

It sounds really intriguing - possible scenarios include revolution & organised crime as well as terrorism, etc., and some/all could be set to occur [randomly? - hope so!] during the course of an 'ordinary' mission or campaign.

Excellent stuff, please keep going :)

Cheers

Orcinus

Share this post


Link to post
Share on other sites

Finished product would open up lots of new posibilities, like where you are fighting a loosing war and then stumble across a town, hire some armed civilians and get them to attack the enemy from the sides and back.

Share this post


Link to post
Share on other sites
Anyone interested in the finished product?

Ummmm too bloody right we are !

Anything that helps to sort problems is always great ! You might also mention it to the MSO guys, as they use ALICE a lot.

Cheers and WELL DONE !

Krem

Share this post


Link to post
Share on other sites

OK then, starting in. Many thanks for all the encouragement!

I will do my best to provide updates periodically on progress... Stay tuned. :)

Share this post


Link to post
Share on other sites

If you need any help testing MadRussian, just ask mate!

If there was a script version as well .... that would be AWESOME!

Share this post


Link to post
Share on other sites

It's fun to dream, but unfortunately, unless they really put a lot of work into these kinds of little things, we could be faced with another situation like today where we need things like the Module Improvement Project to get ALICE2 to even recognize Chernarus buildings. Hopefully, that won't be the case.

Share this post


Link to post
Share on other sites
If you need any help testing MadRussian, just ask mate!

If there was a script version as well .... that would be AWESOME!

What he said, +1

Share this post


Link to post
Share on other sites

Quick update,

Happy to report that my "Release" function is working properly! Thinking about an "Insert" function as well, to insert editor placed (or otherwise created) foot units to ALICE2. That way you'll be able to release and insert at will, even the same AI man/woman if desired, all on-the-fly, which could allow for quite interesting mission possibilities. Also created a couple useful accessor functions that should come in handy.

Separately, I've got the whole ALICE2 data folder (which contains all of it's internal sqfs and fsms) broken out into a subfolder within the mission folder, with those scripts accessing one another. Next up, the modifications to allow creation of resistance side units (as opposed to standard ALICE2 civ-only side units) and mix them in user specified proportions with the regular civ-side guys/gals.

It's fun to dream, but unfortunately, unless they really put a lot of work into these kinds of little things, we could be faced with another situation like today where we need things like the Module Improvement Project to get ALICE2 to even recognize Chernarus buildings. Hopefully, that won't be the case.

Good points. Looked into Module Improvement Project. Very nice! The scope of their project appears to go well beyond what I'm intending to do here. No reason for me to reinvent the wheel though. Perhaps through cooperation, we can (eventually) combine our efforts. (Please be advised, a merge would be necessary to get my new features working with what anyone else is doing. Therefore, I have clearly marked all my modifications to the ALICE2 scripts/fsms with comments.)

If there was a script version as well .... that would be AWESOME!

Good news, I figured out how to do script-only version. :)

Also, if you guys would like to check everything out beta-test wise before release, well... that would be awesome!

Share this post


Link to post
Share on other sites
Good news, I figured out how to do script-only version. :)

Also, if you guys would like to check everything out beta-test wise before release, well... that would be awesome!

Thanks for the update - you have been busy! Only to happy to help when you need testers.

:bounce3:

Share this post


Link to post
Share on other sites
Good news, I figured out how to do script-only version. :)

Also, if you guys would like to check everything out beta-test wise before release, well... that would be awesome!

Excellent news. Yes to helping beta test!

Well done !

Share this post


Link to post
Share on other sites

OK, my ALICE2 mod is now feature complete and essentially ready to go!

You can now specify which factions ALICE2 will create and in what proportions. For example, if you want towns to populate with roughly one third ArmA2 civs, one third OA civs, and one third Wolle armed civs, you would add the following to the main logic:

this setVariable ["MRU_MAL_FactionProportions",[["CIV", 0.333], ["BIS_TK_CIV", 0.333], ["Civilians", 0.333]]];

Also, unit release is now working flawlessly, with no busyness or lingering strange AI behavior. They get completely released and are free to do whatever you (the mission designer) wish of them.

That's the good news. However, I am now up against a rather insidious and perplexing issue, completely separate from my project. (In other words, it's an issue within ArmA2 itself.) Allow me to explain.

Most of us are probably aware of "dead zones" for AI pathfinding in various ArmA2 terrains. These are spots where the AI simply will not go. If you setPos an AI inside of a "dead zone", he can be made to move around inside the confines of the "dead zone", but he will never leave. Apparently, there are numerous dead zones throughout some of the default ArmA2 terrains (Takistan in particular).

The reason that "dead zones" are a problem for my ALICE2 release mechanism, is because ALICE2 creates civilians inside buildings, some buildings of which happen to be inside dead zones. These "dead zone" civilians never leave the premises of their home building even when vanilla ALICE2 orders them across town for a stroll. They are prisoners in their virtual "dead zone" home.

Believe me, it's a big problem to release ALICE2 "dead zone" civilians! Suppose you were counting on this civ you released to go do something, something very important to your mission. Opps, he's just stuck there in his dead zone, never to leave! Worse yet is doing a mass release to join a group (perhaps the player's group). Suppose the "dead zone" guy becomes #2 or #3 in your group. Everyone behind him in formation, lines up based on his position, which is always stuck in the dead zone. Suddenly, half your group is permanently stuck too! :butbut:

After thinking long and hard on this complex turn of events, I've thought up a couple potential solutions. If all goes well, I'll have ALICE2 creating only prosperous civs, each able to leave his home, with no one ever confined to a "dead zone"!

Then the "ALICE2 Release" will have meaning once again.

Anyhow, I'm 98% sure I can manage it. Stay tuned... :)

Edited by MadRussian

Share this post


Link to post
Share on other sites

Again, thanks for the encouragement. Keeps me moving forward.

For those awaiting a functional release of units generated by ALICE2, more good news! I figured out how to identify and avoid the "dead zones", with startling accuracy. :)

Also, changed my mind a bit about not letting the system build dead-zone people. As far as using vanilla ALICE2 has always gone, these dead-zone folks never really caused any problems. They just... stayed at home, and if anything, added a bit of variety. ;) So now in my ALICE2 mod, I simply limit release to non-dead-zone units. I'll say, this modified system is really coming together!

For those interested in details...

The way in which I'm identifying dead-zones is by brute force. In a separate purpose-built mission (which I guess you could call a tool), I am creating a unit for each and every single spot that an ALICE2 unit can be generated. We're talking about 40-100 units at a time. I then send these newly created brave men off in mass via doMove to a location far away. After a set period of time (a minute seems to do just fine), I check the unit's distance from its individual "spawn home". If the man is stuck at home, well that's a dead-zone. This dead-zone identifying system is entirely automated, and the result is a list of dead-zone buildings which gets populated to the clipboard. My ALICE2 mod then receives this list of bad buildings. You only have to run this dead-zone detection system once per island, and after that the dead-zone data is stored permanently. Upon loading up a mission, the system will auto-load the dead-zone data, specific to the terrain.

Best of all, all of this should be completely transparent to the end user. With the dead-zone issue resolved, ALICE2 unit release works like a charm! So far I've got the tool working for one town at a time, and I need to make it process the whole map in sequence, hence a sizable bit of work left to do. Good thing you guys are patient. :p

I plan on including pre-generated dead-zone data for Takistan and Linger with the mod. If people want to get dead-zone data for other islands, they can simply run the tool, and paste the results directly into my ALICE2 mod. It should be a streamlined process, well documented in the readme. Please be advised though - As many of you are already aware, even vanilla ALICE2 looks for specific memory points that are only in certain objects, which are only present on certain islands. So without additional heavy modifications, my ALICE2 mod will likely only work on the same terrains that vanilla ALICE2 does.

In any event, busy RL weekend/week ahead. Look for an update sometime late next week. We're going to get there!

Edited by MadRussian

Share this post


Link to post
Share on other sites

That sounds like a great solution, looking forward to trying it out :)

Have a fun w/end

Orcinus

Share this post


Link to post
Share on other sites

Quick update on progress towards functional ALICE2 release.

My automated dead-zone detection system for whole terrains is now together and working well!

Town by town, it creates foot units at all available ALICE2 spawn points, orders these men to positions far away, waits a full 2 minutes, then checks to see if they are still at home (indicating a bad spawn point). Bad building combinations are tallied dynamically. System starts with a destination 1000m from town at 0° bearing, then 30°, 60° 90°, ending up at 330°. (In my testing , it is necessary to send the units off at different angles. Otherwise, you miss some bad spawn points.) A new batch of detection men is created for each bearing.

For Takistan, which has 24 towns, the process took about 9 and a half hours (so yes it's really an overnight test):

24 towns * 360° / 30° * 120 seconds = 34560 seconds = 9.6 hours

Got some interesting results!

Takistan has 2048 ALICE2 spawn point combinations that result in unit being created inside a dead zone. This boils down to 137 bad buildings.

Here is what it looks like on the map:

deadzonestakistan.jpg

Note that most towns have a handful of dead zones, while a few towns are perfectly clear of dead zones. Two towns in particular are teaming with them! Feruz Abad and Mulladost, with 27 and 31 respectively. Together these two towns account for 42% of all the bad buildings in Takistan!

Here are all the bad building positions (Takistan):

[[4332.3,724.517,2.17065],[8384.12,2498.87,2.49908],[8401.95,2535.55,2.79678],[8478.54,2545.17,2.86578],[8519.39,2571.98,1.28647],
[8501.41,2572.03,2.10571],[1499.92,5809.77,1.10213],[1542.72,5524.32,0.649704],[1506.89,5794.73,2.2641],[1517.89,5771.6,0.714294],
[1517.71,5618.67,2.08945],[3394.43,3889.84,0.626465],[3455.46,4062.58,1.16432],[3581.76,4155.63,1.60197],[3339.02,3880.82,0.97934],
[3497.66,4105.53,-0.0834045],[5285.48,4722.01,0.298859],[5317.38,4716.05,0.137054],[5317.67,4732.17,2.22951],[5392.93,4742.82,1.02435],
[5356.33,4760.88,0.944229],[5404.77,4728.38,2.58669],[5218,6175.99,-0.0713806],[5267.85,6038.71,-0.207184],[5348.93,5960.87,0.273605],
[5323.93,5953.18,2.65244],[5366.7,5971.89,0.0330048],[5363.07,6013.87,0.369125],[5351.2,6066.2,0.482956],[5395.1,6129.57,1.40515],
[5376.38,6131.79,1.69139],[5379.33,6173.7,1.5062],[5382.29,6232.35,0.225113],[5403.82,6065.69,1.75146],[5444.15,6179.72,3.71349],
[5430.21,6191.96,-0.962219],[5449.82,6198.75,2.0433],[5368.19,6032.99,2.87006],[5398.28,6148.37,1.98904],[5394.62,6109.33,3.7836],
[5355.94,6139.23,3.99553],[5374.67,6152.19,1.30872],[5411.26,5978.56,1.96831],[5440.95,6131.53,1.83279],[5405.59,6173.61,2.51544],
[5429.53,6164.21,0.9758],[5266.87,6072.75,1.40527],[5379.23,6079.84,3.27194],[5413.45,6204.78,1.0607],[5807.5,5636.02,0.517059],
[5839.31,5633.75,0.159851],[5850.5,5621.3,0.19986],[5826.31,5666.08,1.83533],[5877.23,5587.15,1.6001],[5910.59,5687.44,1.67673],
[5906.42,5720,1.69681],[6190.63,5693.33,0.4776],[5738.33,5680.17,0.704132],[6075.42,7364.08,1.65767],[9074.01,5304.47,2.64032],
[8952.37,5240.76,2.6936],[10772.2,6451.38,-0.0464783],[10785.8,6463.9,2.34406],[10800.4,6453.62,1.88138],[10632.9,6241.73,2.81583],
[10674.8,6263.86,1.358],[10830.9,6240.93,3.38281],[10678.9,6241.06,0.563416],[1838.91,7565.88,1.39252],[1826.75,7604.37,0.645935],
[1897.69,7583.33,1.47253],[1882.88,7617.77,1.98206],[1889.13,7602.1,1.17557],[1926.31,7549.23,1.23218],[1918.2,7578.55,0.594177],
[1937.35,7585.55,0.524872],[1929.85,7651.21,0.889862],[1932.62,7764.12,0.269623],[1947.05,7756.97,2.26193],[1959.33,7577.41,1.54626],
[1982.96,7568.5,1.26227],[1990.61,7770.33,1.21988],[2016.91,7756.62,-0.105591],[2093.7,7573.09,3.06955],[2100.42,7634.44,0.398376],
[2122.89,7636.87,-0.041687],[2138.93,7613.92,0.567932],[2116.06,7614.97,1.22275],[2115.28,7659.64,0.0489502],[2170,7623.18,2.93765],
[1862.45,7609.04,0.679779],[1930.29,7601.72,-0.1492],[1917.45,7621.83,2.71375],[2173.44,7570.75,1.23615],[2170.68,7600.4,-0.267212],
[1951.23,7637.06,3.12033],[1869.03,7636.44,2.16385],[2083.03,7619.71,0.75174],[1916.99,7601.62,2.4761],[3572.94,8637.24,0.00836182],
[3705.74,8429.5,1.19193],[3736.39,8521,0.825485],[3700.63,8540.17,0.159973],[3718.96,8529.46,3.73868],[3713.02,8555.84,1.97575],
[5712.41,9002.67,1.00706],[2872.02,9969.43,0.323257],[3086.67,10020.7,1.3052],[3123.43,10010.6,1.66619],[1698.7,11840.5,1.85602],
[1704.38,11826.5,0.0105438],[1800.39,11862.5,0.887772],[1892.91,12014.1,1.27582],[1972.39,12010.3,1.1852],[2051.21,11757.5,1.27431],
[2046.27,11801.4,2.22859],[9735.05,11477.6,0.333984],[9719.62,11511.5,2.31822],[9879.16,11558.8,2.71398],[9867.41,11570.3,0.303108],
[9945.43,11289.5,0.022522],[9910.56,11537.3,4.02489],[9905.93,11558.4,0.633362],[9971.68,11298.5,5.20697],[11481.9,8093.11,2.41534],
[11480.8,8106.98,0.557129],[11460.3,8103.1,1.89651],[9118.44,6833.24,2.64304],[9181.81,6794.97,3.00609],[9197.1,6777.69,3.63882],
[9192.95,6789.11,6.36031],[9167.79,6700.07,0.525482],[9159.05,6751.71,0.667908],[9202.72,6770.59,2.377],[4198.08,11789.8,1.41595],
[4197.94,11806.2,1.52811],[4202.51,11827.5,0.824085]]

I plan on running dead-zone detection for Linger tonight, and in the mean time putting together a demo mission or two for the ALICE2 Release system. Which is of course the overall goal here, having ALICE2 create units, and being able to "release" them from the system on-the-fly (in a clean way), at which point they can be used by the mission creator for all sorts of exciting things.

Also beginning to wonder how much use people will really get out of functional ALICE2 release, considering ArmA3 is right around the corner. On the other hand, I'm sure we'll have ALICE3 soon enough, so I figure best to keep going with this. :)

Share this post


Link to post
Share on other sites

That is really remarkable :pc:

Looking forward to trying this out...

Given the number of islands and the length of time for the check, are you planning to analyse them all yourself, or will you release the tool?

In either case, I would be willing to carry out some overnight runs to help out.

Heh, it's going to be a while before A3 hits the shelves, and there will still be a lot of people playing A2/OA/CO. Hell, people are still playing OFP and A1 :)

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  

×