RoyAwesome

Capture Zones and AAS

Took the time the last week to rewrite AAS into C++ and improve the amount of features.

 

 

First post will be how to set up the Capture Zones (Flags) and their components, the second post will be how to set up the 'lattice' for AAS.  Third post will be technical documentation for how they work and how to create custom flag components to modify Capture Zone behavior.

 

This system is modular and highly extensible.  It's intended to be the ultimate solution for any type of capturing gamemode we want, as well as to enable modding in the future. 

 

The Capture Zone

 

The base Actor for creating flags is SQCaptureZone.  It governs capture percent, ownership, and sends events when things happen.

 

sIpQHTs.png

 

  • Flag Name - The name of the capture zone.  Will appear on the capture widget and in notifications when the flag is captured or neutralized
  • Initial Team - The team that owns this flag at match start.  
  • Time to Cap -  How long this flag takes to go from Fully Capped to Neutral.  (So, 2x this number to fully go to the other team)
  • Uncappable - Whether or not this can be captured.  Set to true for team mains.  
  • Minimum Enemies To Capture -  Number of enemies required in the capture zone to capture this zone.  
  • Nuetralizes Fully -  If true, then when the flag hits neutral, it will stay neutral until fully capped by another team.  If false, it will instantly switch to whichever team is capturing it.

 

Additional flag mechanics are goverend by Capture Zone Components.  To add a Component, simply place the Capture Zone, select it, and hit 'Add Component'.  Search for the component you want, and add it.

 

The Following Components are available:

 

Flag Bleed Component

 

The Flag Bleed Component is used to create a ticket bleed for a team that doesn't own the flag.  Multiple Flag Bleed components can be placed on the same flag to create a king of the hill type flag that bleeds whichever team doesn't own it.  Or you can place just one to make a flag a primary defense.  

 

d52mgJv.png

 

  • Bleed for Team - If this flag is held by the opposite team, then the bleed component will start bleeding tickets for the set team.  Component will do nothing if this is set to Team Neutral
  • Bleed Tickets -  How many tickets to subtract after the interval
  • Bleed Rate -  How fast the tick is

 

 

 

Share this post


Link to post
Share on other sites

AAS

 

There are a few important concepts when it comes to AAS.  

 

  • Lattice - The lattice is the definitions of which flags in AAS are linked to which other flags.  It's defined in the SQAASLattice actor.
  • Link - A link is the concept of a connection between two flags in the lattice.  A link can have a few states which are goverened by the state of the Lattice and the gamemode
    • Neutral Link - A neutral link is when one end of the link has a neutral flag.  They do not count towards whether the flag can be captured
    • Friendly Link - A friendly link is a link where both flags are owned by the same team.  
    • Contested LinkA contested link is a link where both flags have opposite teams
    • Home Link -  A Home Link is a link where the neighbor is closer to the owning team's main base.  
    • Forward Link - A Forward Link is a link where the neighbor is away from the owning team's main base
  • Link Distance - Link Distance is distance calculated by link hops from any given flag to another flag.  Any reference to 'Closer', 'Further', or 'Distance' in context with Links are measured in Link Distance, not physical distance.
  • Neighbor - Given a flag, a Neighbor is any flag that is connected to that flag by a link.
  • Main - A team main is a specific flag that is considered the 'home' for that team for determining home links.  It's used to determine which flags give forward progress and which flags are 'behind' the lines.  AAS can have multiple Mains.  
  • Unlinked Flag - An unlinked flag is a flag on the map but not part of the Lattice.  These are completely ignored by AAS, and have no capture rules associated with them (and therefore can be captured by any team at any time).  

 

 

 

SQAASLattice actor

 

The SQAASLattice actor MUST be present on the map for AAS to work.  It's used for the mapper to define default settings for each flag and also define the lattice for AAS

 

 

GF5CHvo.png

 

AAS Settings

AAS Settings here are the same as the AAS Settings in AASCaptureZoneComponent.  However, if you place a flag into the lattice that does not have the AAS Component, the gamemode will create one for that flag and use the following settings.  

  • Ticket Penalty -  The default ticket penalty for flags in the AAS Lattice.  Ticket Penalty is applied when a flag fully switches from one team to another
  • Team Main - (Don't set this to true here).  True if this flag is considered a main base for the AAS Lattice
  • Single Link for Contest -  If true, the flag can be contested when the enemy team has one contested link.  False, all contestable links must be contested

Lattice

 

Lattice is an array of Lattice Links for the AAS lattice.  Simply connect two flags and the game will figure out the rest based on the above definitions and logic.  Use the plus sign to add to the array and select the flags. 

 

 

 

SQAASCaptureZoneComponent

 

AASCaptureZoneComponents are automatically generated by the AAS Gamemode at the start of the match and set with the default settings listed in the AAS Settings.  However, there may be times where a mapper wants to change those settings and create different penalties or set the team main base.  Simply add this component to a Capture Zone (as explained in the previous post) and set the settings.

 

6HKk1hS.png

 

  • Ticket Penalty -  The default ticket penalty for flags in the AAS Lattice.  Ticket Penalty is applied when a flag fully switches from one team to another
  • Team Main -  True if this flag is considered a main base for the AAS Lattice.  Read above what being a team main means. 
  • Single Link for Contest -  If true, the flag can be contested when the enemy team has one contested link.  False, all contestable links must be contested

Share this post


Link to post
Share on other sites

Adding Features

 

If the above components aren't enough, you can simply ask a programmer to add the features needed for what you are trying to achieve.  If you know blueprint, you can try your hand at creating things yourself.

 

 

Creating Capture Zone Components in Blueprint

 

To create a capture zone in BP, simply create a new Blueprint based on SQCaptureZoneComponent. 

 

SQCaptureZone has a number of Events that are exposed for when the Capture Zone does things

 

  • FlagChangedTeamEvent(SQCaptureZone Flag, ESquadTeam Team) - Called before the team changes, this event is used to notify subscribers when the flag is just about to change teams.  It's called when the team is Neutral.
  • PostTeamChangeEvent(SQCaptureZone Flag) - Called after the team changes.  Used to notify that a team change did happen.  By this point, the flag is all set up and the team has changed
  • CaptureTickEvent(SQCaptureZone flag, int32 Friendlies, int32 Enemies) - Called right after the CapturePercent changes.  Gives a number of enemies and friendlies.

To gain access to these events, simply pull out a BindEvent node and set up an event delegate for it.  

 

K4QSm94.png

 

The CaptureZoneComponent also has a number of overridable functions

 

  • CanTeamCapture(ESquadTeam team) - Called by the CaptureZone every capture tick to see if the team can capture.  If any component returns false, the flag is uncappable for that team.  There is no UI indication when this happens.
  • ScaleCaptureTick(int friendlies, int enemies) - Return a scale (0-1) for how much each team can contribute to the cap.  All scales are combined multiplicative.  Default returns 1

Share this post


Link to post
Share on other sites

Building an AAS map:

 

To create an AAS map, you must do the following.

 

Step 1: Place SQCaptureZones in the map

 

This should be pretty straight forward.  Create a number of SQCaptureZone Actors in the world where you want flags to be.  

 

Step 2: Place SQCaptureZones for each team's main

 

Different from the old system, you must place atleast one SQCaptureZone for each team where you want their main base to be.  Set the Initial Team to be the team you want for the main base, and set Uncappable to true.

 

Step 3: Add a SQAASCaptureZone component to every main

 

As illustrated above, add the SQAASCaptureZoneComponent to the main bases.  Set Team Main to true on each of these components.  

 

Step 4: Place a SQAASLattice actor to the map

 

The Lattice actor is the controller for which flags are cappable and which flags are not.  When this object is selected in the editor, it will draw red lines between connected flags.

 

From here, you can set the default behavior of every flag in the AAS lattice.  You can specify how many tickets are lost when the flag is lost (useful for creating very important flags), and you can specify whether the default behavior of how many links must be secured before a team can move past a chokepoint flag.

 

Step 5: Link the flags together to create the AAS Lattice

 

In the Lattice property of the SQAASLattice actor, you can now start adding in Links to the AAS lattice.  If two flags are linked, a red line will be drawn between them.

 

Links, as defined above, will create a path of captureable flags for each team.  The lattice will automatically find the Mains if they are in the Lattice, so there is no requirements on the order that you place flags into this array.  You simply need to define two flags that are linked together.  

 

Here is an example:

 

RAaAAP1.png

 

 

Notice that the flag zones are linked by red lines in the editor viewport.  Also, in the Lattice list, flags may show up more than once to denote that they are chained together.  For example, 'Generic Flag 1 INS (+1)' is linked to 'AAS INS Main', 'Middle Flag (+2)' and 'Fort Kickass (+2)', and shows up in 3 entries in the list.  AAS will figure out that this means that you intend for the Insurgents to go from Main -> Generic Flag 1 -> Middle Flag OR Fort Kickass.  

 

If Single Link for Contest on 'Generic Flag 1 INS (+1)' is false, then US must own both Middle Flag and Fort Kickass to take Generic Flag 1.  If it is True, US can own either Fort Kickass or Middle Flag to take Generic Flag 1 from the Insurgents.  

 

Step 6: In World Settings, set the gamemode to 'BP_Gamemode_AAS'

 

Not setting the gamemode will cause the AAS lattice to not initialize, and any flag is capturable at any time.  

 

 

---

 

Notes:

 

You can have multiple mains.  This behaves as expected, as distance to a main is calculated to the nearest main.  This also means that you can create an odd lattice choke point and have a main give interesting behavior.

 

You can mix and match Single Link for Contest behavior.  You simply need to add an AASCaptureZoneComponent to any given flag, and you can override it's behavior, allowing you to create a mix and match lattice with different contesting rules.

Share this post


Link to post
Share on other sites