Entry Point system – Overview

Nodes used to control this script…

Figure 1

The purpose of this script

This scripts runs on every character’s state machine inside Riot Control with a few exceptions (Bosses and Tanks). After a character has been through the Riot Control – 04 – spawn point system, they are then processed by this script. What this does it takes them from their spawn point and selects for them an entry point into the playable area that they will run to and perform a scripted entry animation.

  • Its split into 3 major zones North, East and West. From inside each zone there are a number of possible entry points that can be used.
  • Once it has chosen an entry point to use, it commands the character to move to that selected point, and then when it is within distance perform the entry animation.
  • If it fails it has a loopback system that will make the character try again, until he is out of the spawn zone and inside the playable area.
  • And finally when they are out of the 3 spawn zones, a move to command is given to tell the character to move towards the player with a success radius of 2500. (The reason why it is so high will be explained later).
Now why do this?

This adds another layer of un-predictability to the spawning system. First of all the spawn system randomly selects a spawn point, then this randomly selects an entry point. This double randomisation of spawning makes it impossible to predict when and where an enemy will spawn from.
This is one way I’ve tried to implement a non-farming situation of the scoring system. Once the round is underway and all hell has broken loose, the adjustment of the active character count during the round keeps enough alive and inside the play area to allow new characters to spawn, select, move to and use the spawn point of their choosing to enter the fight.

Below is a Birdseye view of Danvers Island Riot Control with coloured overlays.
RED – Non playable spawn area
BLUE – Playable area
RED DOT – Spawn point (various animations)
GREEN BAR – Entry point (various animations)

Figure 2

This picture shows the distribution of the spawning / entry points.

  • The East block has 5 spawn points and 3 entry points all to itself.
  • The North block has 5 spawn points and 2 entry points and access to 1 of the West entry points.
  • The West block has 5 spawn points and 2 entry points and access to 1 of the North entry points.

Why didn’t I connect up all 4 entry points for the WEST and NORTH blocks? Well the distance from West spawn 1 to North entry point 2 is too big. (Same as North spawn 5 to West entry point 1) It would take too long for the Character to get from start to finish.

Breakdown
Part 1

Figure 3

As this script is on every character (with exceptions) the first condition we get to is a “do I have a host?” This is generally a good idea to have as your first call on every AI script. Reason – If he hasn’t got a host, he’s not alive, so why bother to continue the script and give out commands to thin air? This also helps track down problems where commands are being given, to characters not yet enabled so when they do come alive they have no actions.

  • If the first test is like this “do I have a host” it will not proceed any further until he has one. This makes sure all commands given are received and waiting to be processed.
  • Now we have a host we can carry on. First we increase the group value store counter. This lets the round script know how many people it has spawned so far.
  • This modifies the $body_count_value_store$ parameter by 1. Each rounds sub-group will change the name of this node to match itself so we only use 1 spawn system for all rounds/groups.
Part 2

Figure 4

After increasing the body count value store in part 1, we come to 3 more conditions.

  • The first simply asks “am I in the West trigger”? If yes carry on.
  • If not it drops down off of the NO and tests for the North trigger.
  • If not again then it must be in the East trigger.

This establishes early on where the character is located and we can now select an entry point for him that is valid for him to get to and use.
From now on all of the scripting will be the same for each entry point that he selects and I will only talk about one from now on.

Part 3

Figure 5

  • Now this next state block will randomly generate a number between 1 and 3.
  • The next two conditions deal with whatever number it just picked for the character.
  • If value = 1, carry on off of the first YES.
  • If value = 2, pickup off of the NO and into the second condition and feed off of that YES.
  • If value = 3, come out of the second NO as that is all there is left.
    Now the script has broken down into 3 again. We now know up to this stage where we are, and have chosen an entry point to use. I shall only deal with the top line. So we can say that the script picked for us, west trigger zone and west entry point 1.
Part 4

Figure 6

  • First state block sends the command to move to the previously selected entry point.
  • Then it tests if nodes are within distance (the character and the entry point).
  • If they are continue on and use the scripted animation controller.
Part 5

Figure 7

After being told to use the selected scripted animation controller we enter a looping system to check if the character has finished using the scripted animation controller, in case he got stuck and couldn’t finish the animation event.

This tests multiple things here…

  • Animation controller not in use by yourself?
  • Animation controller not being used by anyone else?
  • Character out of the spawn area?

This makes sure that the character has used the scripted animation controller and is now inside the play area of the map and is ready to receive more commands.

Part 5

Figure 8

All of the individual entry points link back up here to receive the next command. When the character is inside the play area and is ready to engage, we send the move to player command.

The success radius is set high at 2500 units. In most cases you would tell a character to run to within 150 units to ensure they get to the spot, but in riot control it helps to have a large radius set so they know where the player is, get to their large success radius and let the AI take over.

Commanders and scouts will generally decide to camp up and lay down suppressing fire, while soldiers and brawlers will come close and engage in H2H combat. And all the other AI character types fill their roles during the battle.

So, to round this up…

  • Do I have a host?
  • Where am I, East, North or West?
  • Randomly select an entry point
  • Go to that entry point
  • Use scripted animation controller
  • Double check to make sure I’m out of the spawning zone
  • Move to the player and attack.

NEXT PAGE