Jump to content
kronzky

Urban Patrol Script

Recommended Posts

The "Urban Patrol Script" has been ported to A3, and is available on my site: http://kronzky.info/ups

Most of you will probably be familiar with it, but for the newcomers, here's what it does:

It allows you to set up a quick mission in a couple of minutes, without having to worry about waypoints, scripts, or AI behaviour.

All you need to do is place a marker over the area to be patrolled, put some OPFORs in the area, and have them call the patrol script. That's it...

The script will take care of generating random movements, intelligent responses to enemy encounters, and notices when everybody's dead.

It's a very easy and fun way to familiarize yourself with a new map, without having to spend hours making a mission that will only be predictable after a couple of runs.

With this script every run will be totally random. And since you can set it up without even knowing the map too well, you will have a fairly realistic simulation of real-life scenarios, with unfamiliar environment and unpredictable enemy behavior.

Yes, you won't be able to make a "deep", multi-subjective, and inter-dependent "save-the-world" mission with this, but for simulating normal day-to-day patrolling missions, and the unpredictability associated with it, it does the job quite nicely.

Here's a rundown of the main features:

  • Setup Options
    • Patrol any "marker-designated" area with any unit or group, whether it's Infantry, Armored, Cars, Choppers, or even planes, using any side (east, west, resistance, civilians).
    • Several independent marker areas (for different units) can be used on the same map.
    • The start position of the units can be a random position anywhere in the active area - in that case some units may even end up on roofs.
    • You can create a random number of "clones" of a unit/group you placed in the active area.

    [*]AI Behavior

    • The AI will avoid "dangerous" areas, and react intelligently to attacks. If it sees a team-member being shot, or spots an enemy without themselves being detected, it will not continue on its regular path, but instead use a flanking approach to get to the shooter. The accuracy of the approach will depend on the "knowledge" the AI has about the shooter (i.e. whether the shooter was actually seen or only heard).(image)
    • If AI units get stuck (mostly due to bad pathfinding) they will try to free themselves after a while.
    • Units will make occasional stops of random lengths during their patrols.
    • When independent AI groups meet each other they will share their knowledge about any enemies they might have spotted.
    • By default units patrol in safe mode at limited speed, but they will switch to combat & full for a limited time when they encounter enemies.

    [*]"Intel" Options

    • An automatic trigger is generated for each area to announce when that section has been cleared of enemies. (image)
    • The units can be tracked via a dynamic marker on the map.

Here's what the paths look like, after a car and an infantry unit have been patrolling a city for about 15 minutes:

car_and_foot_patrol.jpg

  • Thanks 1

Share this post


Link to post
Share on other sites

Many thanks Kronzky!

THE classic patrol script, back for a new generation :)

B

Share this post


Link to post
Share on other sites

Nice Job Kronsky!

Question, did you fix the part of the script where the AI squads would gravitate and end up around the center of the marker?

Share this post


Link to post
Share on other sites
Many thanks Kronzky!

THE classic patrol script, back for a new generation :)

B

Yeah, i sense the same ..:)

Share this post


Link to post
Share on other sites

This is such a great script, Kronzky! Thanks for updating it.

The only problem I've run into is when I use the "track" parameter. I get an error at the start of the mission that says: "No entry 'bin\config.bin\cfgmarkers.DOT'". I'm not sure if I'm doing something wrong or if it's an UPSMON/Arma 3 issue.

Share this post


Link to post
Share on other sites

I have put UPS.sqf in My Documents\ArmA 3 Alpha Other Profiles\[profile name]\missions

But when I have edited the map in editor and click preview, it says the script cannot be found. Also I can't see the demo mission even though I have put mission.sqm in that folder.

This is my first time using this editor. Sorry if this is a noob question. Thanks.

Share this post


Link to post
Share on other sites

Legend!

This goes right into my next mission :)

-k

Share this post


Link to post
Share on other sites

@jelf

Script needs to be in the same folder as the mission you edited, also if when the editor creates and Sqm its in the correct folder.

 

The editor will create a folder with the same name as what you saved your mission as in the editor, inside that folder that the editor creates is the mission.sqm,

you do not want to move that out of that folder, so the UPS script will go into that mission folder, no where else, then you just need to add the code to a

squad leaders init line in the editor, and create a marker area where the squad will patrol.

 

Thats how the editor has worked since the series started so i highly doubt anything has changed in terms of that in Arma3.

If you want to know how to setup the UPS script in the editor, then heres a picture tutorial of the UPS script for previous games, it should be the same for the new script for A3.

http://kronzky.info/ups

also linked in the first post.

Share this post


Link to post
Share on other sites
Script needs to be in the same folder as the mission you edited,

[...]

I dont have the Arma3 Alpha but thats how the editor has worked since the series started

Thanks for explaining the usage, Günter; and yes, it's still the same in A3.

(I've modified the readme a bit now, to hopefully make the requirements more clear.)

Share this post


Link to post
Share on other sites

Thanks Kronzky for this great script.

I have an "issue" that I was wondering if you could clarify for me.

I'm creating a co-op mission for blue side where we are to attack and destroy some buildings held by the east side.

I placed a 2 man patrol at first just to test it out and it worked flawlessly, they where patrolling in a safe condition and speed was walking pace.

But the moment I started placing other east soldiers around the camp the behaviour of the patrol changed. They entered a combat state and their movement tempo increased.

Is there a way to tweak this in the actual script file?

Exi

Share this post


Link to post
Share on other sites
Thanks Kronzky for this great script.

I have an "issue" that I was wondering if you could clarify for me.

I'm creating a co-op mission for blue side where we are to attack and destroy some buildings held by the east side.

I placed a 2 man patrol at first just to test it out and it worked flawlessly, they where patrolling in a safe condition and speed was walking pace.

But the moment I started placing other east soldiers around the camp the behaviour of the patrol changed. They entered a combat state and their movement tempo increased.

Is there a way to tweak this in the actual script file?

Exi

Had the same problem and the cause seems to be that, according to the main loop of the script, the AI goes into "combat"-behaviour if there is another friendly troop in "aware" or "combat" -behaviour close enough (default 100m). Problem was fixed by ensuring that all units on the same side as the AI are forced to "safe"-behaviour at mission start, for example by using the setBehaviour-command (http://community.bistudio.com/wiki/setBehaviour).

Share this post


Link to post
Share on other sites

I just started messing around with the ARMA editor on the Alpha so I might be doing something stupid.

So I downloaded the script and made it work beautifully with footman patrols, my problem now is that I want to do the same with a vehicle.

So I searched a bit and I used a built in function to spawn a vehicle with a crew:

veh = [getMarkerPos "patrol1", 180, "O_Galkin_MG_F", patrol_squad] call bis_fnc_spawnvehicle;

And the vehicle spawns no problem, then I call:

nul = [units (veh select 0), "patrol1", "random"] execVM "ups.sqf";

And the vehicle respawns as expected on a random place in the marker, but the crewman spawns outside and only one of them enters it (the gunman) and the suposed driver stays still where he respawned.

After this I tried to provide the script with the leader of the squad object and after that an array with the crewmen, both approaches giving the same problem.

Can someone point me in the right direction? Thanks for your time and thank you Kronzky for this great script :)

Edited by skkeeper

Share this post


Link to post
Share on other sites

Not sure what goals / timeline looks like for the UPS script, however performance is verrry bad right now. We just removed this from every mission we were using it on for A3:A due to the performance overhead. Removing the script from the mission will remove about 2/3 of server load for the same mission unchanged in any other way.

I haven't had time to look at the logs at all, and I'm at work now; Just wanted to give you a heads up.

-Seil

Share this post


Link to post
Share on other sites

I successfully added UPS 2.1.1 to a mission I made today. It works wonderfully. I have two questions, though.

1. There's a big red circle following the players on the map. Is this some kind of UPS debug leftover? Anyway to turn it off?

2. There's no fortify parameter to make AI get into buildings and such, is that correct? Any ETA when it will be implemented?

Share this post


Link to post
Share on other sites

Do reinforcements and respawns work with the A3 version? I can't seem to get mine to respond to my triggers for reinforce, and also to respawn once they are killed. Here is my usage:

this,"area0","RANDOM","NOWAIT","reinforcement:",1,"spawned","respawn:",100] execVM "UPS.sqf";

Thanks very much for any direction.

Share this post


Link to post
Share on other sites

Thanks a bunch for this script it's awesome, I have encountered two issues however.

The first issue is if I have units using the patrol script and they happen to be named, then they automatically spawn in combat stance and normal speed instead of safe/limited <-(as an example lets say 2 units named A1 and A2, and a trigger with the condition of "!alive A1 and !alive A2"), however I can fix this issue by removing their names, putting "NOFOLLOW" in the unit(s) init code (so they "hopefully" don't leave the area), and simply adding a trigger that stays active as long as opfor are in that area.

The second issue is, that I added this script to a mission I have been working so opfor units would patrol, however... As long as there is even a single blufor unit on the map (literallyother side of the play field, doesn't matter), then all the opfor patrols spawn as hostile instead of how they should be, they spawn in safe mode if no blufor are spawned in... This is the bigger issue of the two because the only way I can see to solve this is to make a clone of what I already have from scratch.

If anyone has any other solutions to these two issues I'm having, please let me know

**EDIT**

I have found a strange solution to my problem... It seems my opfor units are spawning in combat stance IF there is more then one group (2 groups, 1 group + 1 lone unit, etc) set to patrol the same marker area. If I just have one group of any size patrol the zone, the spawn in safe/limited as they should. However this test was done with no blufor units on the map besides the player unit and a couple of units in the player's group. I do not know how they will react if other blufor units are added that are not in the players group or if there are opfor units in their zone that are not under the effects of the script.

Edited by mdgrim

Share this post


Link to post
Share on other sites
1. There's a big red circle following the players on the map. Is this some kind of UPS debug leftover? Anyway to turn it off?

What does the circle look like (can you post a screenshot)?

The only "debug" mode for UPS is the "track" option, but that only creates a small dot over the AIs.

2. There's no fortify parameter to make AI get into buildings and such, is that correct? Any ETA when it will be implemented?
Do reinforcements and respawns work with the A3 version? I can't seem to get mine to respond to my triggers for reinforce, and also to respawn once they are killed.

Neither "fortify", "reinforcement", "spawned", or "respawn" are part of the options for UPS (and have never been). Perhaps you have been using a modified version of UPS that had these options added?

As far as the general AI behavior is concerned — there haven't really been any behavior-related changes to UPS for Arma3 (only some markers had to be renamed), so any new (and unexpected) behavior would be caused by the engine. Since Arma3 is still in Alpha I wouldn't want to go down, and chase these kinds of issues at the moment (and implement any workarounds in the code), until we're pretty sure that that's the final status in A3, and not some temporary glitch (which might already disappear with the next patch).

Share this post


Link to post
Share on other sites
What does the circle look like (can you post a screenshot)?

The only "debug" mode for UPS is the "track" option, but that only creates a small dot over the AIs.

Neither "fortify", "reinforcement", "spawned", or "respawn" are part of the options for UPS (and have never been). Perhaps you have been using a modified version of UPS that had these options added?

As far as the general AI behavior is concerned — there haven't really been any behavior-related changes to UPS for Arma3 (only some markers had to be renamed), so any new (and unexpected) behavior would be caused by the engine. Since Arma3 is still in Alpha I wouldn't want to go down, and chase these kinds of issues at the moment (and implement any workarounds in the code), until we're pretty sure that that's the final status in A3, and not some temporary glitch (which might already disappear with the next patch).

The red circle is in the game and nothing to do with the script.

The other options like fortify etc were all part of UPSMON which I think he's referring to :D

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

×