Jump to content
thirith

Defending a building/camp/down - looking for tips

Recommended Posts

I'm thinking of creating a simple defend mission to use as a warmup for my group (6-10 people). They'd be placed in a small town or a camp and told that several waves of attackers are bearing down on them; then, after a couple of minutes, the first wave would attack, then the second (based either on time or on the first wave having been killed), then the third etc.  However, there are a number of questions I have before getting started on this:

 

  1. I have a fairly good idea of how to do this in a fully scripted way, but I'd like the waves to be somewhat randomised, in particular in terms of the direction they're coming from. How do I best do this?
  2. Any rule-of-thumb suggestions how many enemies there should be in each wave? And are there any good ways (e.g. useful scripts) that help with respect to adjusting enemy numbers to the number of players?
  3. Any tips on how I can best let the number of waves be a parameter that the admin can set before launching the mission?
  4. I'd probably set this mission on Altis, putting my players in Alikampos. Any suggestions for other good locations so I can change it up? (We're using Apex as well as the CUP maps.)

 

Any tips would be much appreciated!

Share this post


Link to post
Share on other sites

ah..... there is so mutch parameters you can capture with this what you just ask

 

1.to have waves randomize you can define like a spawning area in range lets say 200 m , 200 m. and you can put more spawn points then 1

2. you can put a global variable that will define a difficulty like check the number of players on the server then increse the ai for every player

3.tip for a each player use foreach then increse difficulty by so mutch

4.tip for admin calling number of waves just put a global variable int and use loop foreach number of waves * difficulty for each wave and when wave is complited just add increment ++ to next wave

5.

7 hours ago, thirith said:

Any rule-of-thumb suggestions how many enemies there should be in each wave?

well that depends what your guys are haveing and who are they fighting if they are fighting CSAT lets say you will put less guys if they are fighting AAF you will put more guys

 

6.well this gameplay againts bots are great and all but me personally i would like to fight zombies like this it would be mutch more fun and scary at the same time

Share this post


Link to post
Share on other sites

I built a mission to defend the coastal town of Girna on Stratis.  I created multiple enemy groups to attack the town:

  • 2 Assault boats with 10 AI came in from the sea
  • One amphibeous APC came in from the sea
  • Truck load of troops by road
  • APCs from different starting points
  • Mulitple Infantry groups from different starting points.

For each of the above Groups I created waypoints all in the Editor:

  • Add a Talk Waypoint as first waypoint for each group with this in the waypoint code line:   this lockwp true;
    • The group then won't move to next waypoint until lockwp is set to false.
  • Add Move waypoints to move teh group to attack the town.

 

Then in the init.sqf, the waves of attacks are randomized like this:

// Put all attacking Group names in a list and randomize it with arrayShuffle function.
gAttackGroupList = [boat1,amphib1,truck1, inf1, inf2,inf3, inf4, apc1, apc2] call BIS_fnc_arrayShuffle;

// loop through the attack groups with a delay before each, and unlock their waypoints to start them moving to attack.
{
	sleep 60 + (random 60);  // delay 1 to 2 minutes before releasing next wave.
	_x lockwp false;
} foreach gAttackGroupList;

This is easy to throw together as you use the editor for 99% of the work, and just add a small script to init.sqf.

 

  • Like 3

Share this post


Link to post
Share on other sites

Cool, that looks exactly like what I need! I'll see that I can adapt it to my needs. (Attack boats off Alikampos might not be the best strategy, though they might be fun. :f: )

  • Like 1

Share this post


Link to post
Share on other sites

Some follow-up questions:

  • At present each wave consists of multiple groups. Can I use a multidimensional array - along the lines of gAttackGroupList = [[wave1group1, wave1group2, wave1group3], [wave2group1, wave2group2, wave2group3]] - with BIS_fnc_arrayShuffle? Or will that also shuffle the subgroups, so the invidiual waves might end up being mixed?
  • Also, I'm making some of the subgroups conditional based on the number of actual players; is this a problem for a script like the one suggested by johnnyboy?
  • Finally, is there anything I have to keep in mind with respect to MP, locality and the like? Do I have to check that the code is only run on the server?

 

More specifically, I've adapted the script above as follows:

// Put all attacking Group names in a list and randomize it with arrayShuffle function.

gAttackGroupList = [
    [wave1group1,wave1group2,wave1group3,wave1group4],
    [wave2group1,wave2group2,wave2group3,wave2group4],
    [wave3group1,wave3group2,wave3group3,wave3group4],
    [wave4group1,wave4group2,wave4group3,wave4group4]
    ] call BIS_fnc_arrayShuffle;

// loop through the attack groups with a delay before each, and unlock their waypoints to start them moving to attack.
{
    sleep 60 + (random 60);  // delay 1 to 2 minutes before releasing next wave.
    _wave = _x;
    {
        _group = _x;
        _group lockwp false;
        _group hideObject false;
    } forEach _wave;
} foreach gAttackGroupList;

I'm thinking that if this is in init.sqf, it'll be executed on each player machine, which means that the randomised sequence will be different on each machine; however, I'd need one centralised randomisation but lockwp and hideObject would have to be executed on each PC.

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, thirith said:

At present each wave consists of multiple groups. Can I use a multidimensional array - along the lines of gAttackGroupList = [[wave1group1, wave1group2, wave1group3], [wave2group1, wave2group2, wave2group3]] - with BIS_fnc_arrayShuffle? Or will that also shuffle the subgroups, so the invidiual waves might end up being mixed?

Your subgroups as sub-arrays should work great.  Just try it.

4 hours ago, thirith said:

Also, I'm making some of the subgroups conditional based on the number of actual players; is this a problem for a script like the one suggested by johnnyboy?

After shuffling but before the loop, delete elements (sub-arrays of groups in your case) from the array.  Since its shuffled, removing X elements from the beginning or end of the array will do this.  Use deleteAt or resize.

4 hours ago, thirith said:

Finally, is there anything I have to keep in mind with respect to MP, locality and the like? Do I have to check that the code is only run on the server?

Good thinking.  Put all that code within an if statement in your init.sqf, and you should be good

if (isServer) then
{
	...your sweet wave code here...
};

 

  • Like 2

Share this post


Link to post
Share on other sites

Though the lockwp and hideObject commands would have to be outside the in statement, right? The effects of those commands seem to be local.

Share this post


Link to post
Share on other sites

For hideObject use hideObjectGlobal instead.  For lockwp, just try it .  I'm 95% sure I've used this method for MP and didn't see an issue.  But you can aways remoteExec lockwp command if it truly needs to be executed globally.

Share this post


Link to post
Share on other sites

Weird... If the units are hidden and then unhidden, lockWP false doesn’t seem to do anything, but if they’re not hidden, it works as it should. :icon9:

Share this post


Link to post
Share on other sites
On 2/27/2018 at 2:31 PM, thirith said:

I'm thinking of creating a simple defend mission to use as a warmup for my group (6-10 people). They'd be placed in a small town or a camp and told that several waves of attackers are bearing down on them; then, after a couple of minutes, the first wave would attack, then the second (based either on time or on the first wave having been killed), then the third etc.  However, there are a number of questions I have before getting started on this:

 

  1. I have a fairly good idea of how to do this in a fully scripted way, but I'd like the waves to be somewhat randomised, in particular in terms of the direction they're coming from. How do I best do this?
  2. Any rule-of-thumb suggestions how many enemies there should be in each wave? And are there any good ways (e.g. useful scripts) that help with respect to adjusting enemy numbers to the number of players?
  3. Any tips on how I can best let the number of waves be a parameter that the admin can set before launching the mission?
  4. I'd probably set this mission on Altis, putting my players in Alikampos. Any suggestions for other good locations so I can change it up? (We're using Apex as well as the CUP maps.)

 

Any tips would be much appreciated!

 

Just a few thoughts:

 

Like making any other mission, AI numbers depend on quite a few factors:

Are the players arma veterans and able to toss a grenade through a second floor window without having to aim? Or are they rather new to the game and press G for gear?

How is the mission set?

Spec Ops with Thermals defending against Insurgents without even NVGs needs another number of incoming hostiles than a mission where forces are more balanced in terms of equipment and force multipliers (are there tanks or static weapons that help defending?).

AI skill also hugely plays into this.

 

A good ratio would be 3:1 attackers to defenders if both sides are balanced well. Depending on the skill of your players you could easily double that to 6:1.

 

Depending on how many AI you end up using it's probably best to have them on the map from the start, don't hide them, don't disable simulation on them, but put them to use.

Make them start out closer together, start laying down suppressive fire or fire RPGs on the defenders position and slowly make them encircle the defenders, then move them in, increasing pressure as the time advances.

Use a script to reveal all targets between all attacker groups once every 10 seconds so they are more aware of what they're attacking.

 

As to locations I recommend Goisse on Malden, neat little village with enterable chapel, and just the right amount of buildings for ~10 players, sea to the west/northwest and hills on the other sides.

Ravanay on Takistan located in the northeast also has "Deathtrap" written all over it.

On Altis you could take a look at Fotia ([3013.39,18497.2]), has a Solar Array, Cliffs to the north and landside hills with trees, a nightmare to defend. If enemies were to come in from the northeast until you spot them they're pretty much on top of you, could make some intense firefights.

 

Cheers

  • Like 4

Share this post


Link to post
Share on other sites

Those are some fantastic tips. I won’t put all of them into practice in my first defend mission, simply because I tend to overcomplicate my missions compared to my actual scripting skills, but I’m thinking of doing 3-4 such missions (thanks for the suggested locations!) and add some elements with each one.

 

Right now I’ve definitely got too many enemies, though; one wave consists of 32 attackers to my 12 defenders (some groups don’t spawn based on the number of defending units), but there are four waves. That’s probably too many...

 

I’m also wondering if the waves should be timed or based on how many attackers are still alive, e.g. once 25% of a wave has been killed, the next wave comes in. Any opinions?

Share this post


Link to post
Share on other sites
7 hours ago, Grumpy Old Man said:

.....Ravanay on Takistan located in the northeast also has "Deathtrap" written all over it.....

Now I know why they call him Grumpy.  Not only is he a scripting guru, but also a merciless tactician.   I'm going to have to go scout all those locations.

 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, thirith said:

I’m also wondering if the waves should be timed or based on how many attackers are still alive, e.g. once 25% of a wave has been killed, the next wave comes in. Any opinions?

My "attack waves" mission I originally described had the time delays set up so the waves overlapped.  So it increased the tension (as Grumpy described).  It was very replayable, since the wave groups were randomized, and never felt gamey (ie., "wave 1 complete...countdown to wave 2").

 

Just experiment with the timing, and try your "% of wave killed" too until it works to your liking.  These missions can be entertaining where you win one time and get slaughtered the next.  Have fun building and testing it!

 

Edit:  I favor Respawn to Group for these types of missions also.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks. I ended up not using your lockwp tip, since I couldn't get it to work (no idea where I went wrong); instead, I've now got OPFOR starting at a somewhat greater distance and prone. Still using your TALK waypoints, though, and a couple of variables that need to be set to true before the teams continue to the next WP; so far it seems to work okay.

 

I'll only be able to test the mission this coming Saturday (we only play every two weeks or so). If anyone wants to try it out (players: 1-12), though, I'd be happy to share the PBO on OneDrive. Once I've tested it with others, I might put it on the Steam workshop.

Share this post


Link to post
Share on other sites
19 minutes ago, thirith said:

I'll only be able to test the mission this coming Saturday (we only play every two weeks or so). If anyone wants to try it out (players: 1-12), though, I'd be happy to share the PBO on OneDrive.

If you set Respawn to Group, you can test it solo on a player hosted server and get all the wave mechanics worked out and other bugs squashed.  Of course, you ultimately need others to flush out any MP problems.

 

Good luck, and have fun.

  • Like 1

Share this post


Link to post
Share on other sites

Good tip, johnnyboy, I didn't know that about Respawn to Group. That'll make it easier for me to play the mission from beginning to end at least once.

  • Like 1

Share this post


Link to post
Share on other sites

Final follow-up question before I test the mission on my guys: is it worth setting allowfleeing to 0 and set OPFOR courage to 1? I want to make sure that I don't have too overly cautious enemies hiding in bushes and behind walls where the players might not find them.

Share this post


Link to post
Share on other sites
1 hour ago, thirith said:

Final follow-up question before I test the mission on my guys: is it worth setting allowfleeing to 0 and set OPFOR courage to 1? I want to make sure that I don't have too overly cautious enemies hiding in bushes and behind walls where the players might not find them.

 

You could use disableAI "AUTOCOMBAT" on the attackers to make them more fierce when pushing in.

Makes them take less cover, not slow down and constantly push towards their assigned waypoint.

Just be sure to set their behavior to AWARE after issuing the command, in case they're already in combat mode.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Thanks! Will they fire back at all like that? Or do I have to re-enable autocombat once they’re closer?

Share this post


Link to post
Share on other sites
1 minute ago, thirith said:

Thanks! Will they fire back at all like that? Or do I have to re-enable autocombat once they’re closer?

 

I usually use a hit eventhandler to fall back to regular behavior, so that if a units health drops below 50% after being hit autocombat will be enabled again.

They'll return fire just fine, and really start pushing forward with lots of pressure in a constant moving - firing - moving pattern.

Gives them more of an Insurgent behavior just running up at all costs and even eating a bullet or two without desperately heading to cover.

You could also use setUnitPos "UP" so they stay up all the time.

 

Cheers

Share this post


Link to post
Share on other sites

Again, great tips. I'll probably try the current mission without any adjustments to see how it works (and adjust if OPFOR proves to be too cautious), but especially if I go with your Takistan/Ravanay suggestion I'd probably go for your suggestion above.

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

×