Range (Procedure)
BehaviorEdit
Description:
The Range Procedure makes the actor try to "range" out ahead (and somewhat to the side) of another actor (henceforth referred to as the "leader"). If the leader is stationary, the ranging actor will wander and idle around the leader.
Also, if multiple actors are ranging with the same leader, they will automatically fall into a double-file line formation. (See below for more info.)
The procedure completes:
Procedure does not end unless conditionalized out, or paired with a procedure that ends in a simultaneous branch.
ParametersEdit
- MinDistance (Float): Minimum distance actor wants to be out in front of the "leader." (Using negative values for this and MaxDistance will make the actor follow behind the leader instead of out in front.)
- MaxDistance (Float): Maximum distance actor wants to be from the "leader." (Using negative values for this and MinDistance will make the actor follow behind the leader instead of out in front.)
- MaxRadius (Float): The maximum acceptable distance from the ranging point.
- Offset (Float): The left/right distance that the actor wishes to be from whomever it is escorting.
- Meander (Boolean): Whether or not to meander, which bends the ranging path into a serpentine shape.
- MeanderAmpMin (Float): Minimum distance to meander from center of ranging path, when at a maximum. (This and the next value define the amplitude of the sinusoid wave that modulates the ranging path when "Meander" is true.)
- MeanderAmpMax (Float): Maximum distance to meander from center of ranging path, when at a maximum.
- MeanderWavelengthMin (Float): Minimum distance between crests of the meander. (This and the next value define the wavelength of the sinusoid wave that modulates the ranging path when meander? is on.)
- MeanderWavelengthMax (Float): Max distance between crests of the meander.
- IdleWanderMinRadius (Float): When the leader is stationary, wander/idle at random points that are at least this far away from them.
- IdleWanderMaxRadius (Float): When the leader is stationary, wander/idle at random points that are no farther away from them than this.
- Leader (Target): Specifies the "leader" (the actor in front of whom we are ranging). If not specified, the default is the player.
- IdleWhenLeaderStops (Boolean): Controls what happens when the leader remains motionless. If true, switch from ranging to idling around the leader. (If false, stay at ranging point.)
- FormationGroup (Int): Controls "marching order" for actors following the same leader. Can be any integer. List of followers will be sorted by this, (low-in-front to high-in-back; equals ordered arbitrarily), then arranged into double-file (one straggler per group, if an odd number).
- FormationRowSpacing (Float): When walking in a formation, specifies the space between this actor and the row in front of it.
NotesEdit
- What if the leader dies, or is dead?
- The procedure should be considered invalid, and will not run.
- Is there some "sweet spot" that the ranging actor looks for?
- Yes, the "sweet spot" is a point on the navmesh that is as near as possible to the point that is:
- MinDistance ahead of a walking leader, MaxDistance ahead of a running leader, or somewhere in between, if the leader's speed is in between.
- Offset to the left or right of the leader(based on whichever side of the leader they're already on).
- Yes, the "sweet spot" is a point on the navmesh that is as near as possible to the point that is:
- Does the ranging actor try to move at the same speed as the leader? Do they begin running to the "sweet spot" point if they're too far away?
- Yes on both counts.
- Is the calculated distance between ranging actor and leader a raw GetDistance check, or some sort of distance derived from pathing between the two? (i.e. Will the ranging actor be ok if the target is just on the other side of a wall?)
- It is using an actual pathing-distance check from the ranging actor to the leader.
- That automatic double-file line formation sounds nifty. How does that work?
- If multiple actors run a Range procedure targeting the same leader, they will form a double-file line automatically.
- Their "Offset" parameter will specify how far left/right of center to be.
- The gamesetting fAIRangeLineFormationSpacing will determine how far apart each row of two actors will be.
- Can I get the actor to follow behind the leader instead of out in front? (I like the side offset, meander, auto-idle-wander and/or double-file features, which aren't in the Follow procedure).
- Yes, this is easy: just use negative values for the MinDistance and MaxDistance parameters.
Relevant Gamesettings
- fAIRangeLineFormationSpacing : In a double-file line formation, determines how far apart each row of two actors will be.
***This page uses a template (Template:Procedures). To change the data of this particular page, edit the whole page and set the parameter values. If you try to edit the sections, you will be editing the template.***