Attunement Arena – Air Currents

Attunement’s Air Currents

Edit: Attunement Arena has since been renamed Attunement: Power of the Gods

A 3D Versus Elemental Brawler

Three Dimensional Math

The simplest math from the Orange Book (Realtime Collision Detection)

The simplest math from the Orange Book (Realtime Collision Detection)

In order to accomplish the gameplay goal here, I used Closest Point to Segment 3D math.

A step by step of the process is available here:

  1. This was accomplished by using a 3D problem simplified to 2 dimensions.
  2. For each segment of the air current, evaluate as follows.
  3. Evaluate the vectors for the start and end points of the line. We will call this line AB.
  4. Find the closest point on the AB line to the target. We will call this D.
  5. Evaluate the distance between the player and D. If this distance is greater than the player’s radius plus the radius of the current, we’re done.
  6. Evaluate the forces applied to the player and the input applied by the player. If either of these is too great, we want to stop so the player can leave or be knocked from a current.
  7. Create a vector that points along AB but points slightly towards the center of the current so the player can ‘settle in’ to enjoy the ride.
  8. If the player is at the start or end of the current, apply slightly different logic. Near A, behave normally. Near B, dont pull to the center of the current (or the end current can get frayed and fling you across it instead of behaving like a air spout)
  9. If the player is affected by the current, negate their current velocity and disable the effect of gravity upon them.
CODE: Air Current - Check Current Segment


The end result of the behavior is as follows:

An elementalist can enter a current from any point. If the player enters the current, they cease to fall and are ferried along the current from each segment to the next.

If a player inputs commands to their character to move, the force of the current is overridden allowing the player to fall or leave the current easily. Similarly, if the player is affected by any significant force (external forces are tracked and decay quickly), the current ceases to negate falling/current velocity, allowing the player to be thrown from the current.

The basis of this 3D math was provided by the amazing Orange Book: Realtime Collision Detection

Visual effect

This was done by using circular meshes emitted in the same direction.

Parts of the scripting set the particle velocity and lifetime based on the distance to the next node.

Game Implication

The gameplay implication of this is that it provides players a tool to quickly move around the game environment.

One of Attunement Arena’s design goals is to provide high degrees of player movement. A design problem that quickly emerges is the characters can move too fast for players to track what is going on.

A way to solve this issue is to reduce the base movement speed and to provide powerful and fast movement tools. The caveat is that the player won’t always be using the movement tools. This results in a contrast of movement speeds for the player, which make the faster movement feel more enjoyable. The additional benefit is that when a player is moving slower, they are a more vulnerable target allowing for depth of skill in the play-counterplay department.

Thank you for reading.

 

Post Edit: Check out more info on the Attunement: Power of the Gods blog.

Citation

Ericson, C. (2005). Realtime Collision Detection. San Francisco, CA: Elsevier.