The Formations of Wolcen
Our partners Wolcen Studios wanted Wolcen: Lords of Mayhem to bring modern ARPG gameplay mechanics to a classic dungeon-crawl setting. In this article we’ll take an in-depth look at a particular Kythera AI feature that helped bridge the gap from classic RTS and RPG gameplay to a new ARPG experience: Formations. In a genre often noted for its hectic, mash-the-buttons-and-hope-for-the-best gameplay, Kythera AI's Formations helped bring meaningful structure and realism to dynamic mass combat scenes with dozens of characters.
Formations Across Game Genres
Formations have long been used for control of armies in real-time strategy games like the Age of Empires and Starcraft series, adding tactical depth to in-the-moment offensive and defensive decision making. Players can often choose from a variety of formation types – band together to shield weaker units, spread out to protect against area-effect damage, or aggressively position a solid strike force. In strategy games, formations can involve managing hundreds of units within dynamic environments, where the navmesh continually adjusts as structures are constructed and demolished
Age of Empires 2
At the other end of the scale, RPGs such as Baldur's Gate only require players to choose a formation for their party of a half-dozen or so adventurers. From a game development perspective, formations in RPGs are less complex than their strategy game counterparts due to smaller party sizes, static navmeshes (in older titles) and slower combat.
Though less complex than formations in strategy games, these are arguably more crucial tactical decisions – a lost army unit can be retrained, but in an RPG your characters are unique and their deaths are final.
Baldur’s Gate
In both genres, the formations navigate the environment and avoid obstacles either by bypassing large terrain as a single group or allowing the formation to break and flow around smaller objects. However, they have limitations, often stemming from technical and interface constraints, which can lead to some unintuitive or downright unrealistic results.
While these limitations are perhaps a necessary concession to player control in a game like Age of Empires - in an ARPG the units are made of individual agents, each controlled independently. A higher level of individual control is expected in this genre, making the limitations and undesirable results much more apparent.
This gave us an opportunity. What could be achieved if we developed a full AI-first formations toolset?
Bringing Formations to ARPGs
The late game of many modern ARPGs is an omelette of colorful effects, with dozens of similar units on the screen at once – visually impressive, but with often unrewarding and repetitive gameplay. With this in mind, we built our Formations feature for Wolcen with the aim of creating interesting tactical encounters without compromising on the fast-paced action of the genre.
We took inspiration from other genres, added technical improvements for AI-driven battle tactics and fast dynamic gameplay and created Kythera AI's powerful Ground Formations feature - the first of it's kind for use in this genre.
The Form of Formations
'The Formation' is a virtual entity that responds to its environment while not having a direct physical presence. It can accommodate not only external obstacles and threats, but also internal changes as members of the formation were removed, added or replaced.
Much of the magic happens in the conceptual space between the formation seen as a single entity, and its members seen as individual agents. The formation keeps its own blackboard of information, allowing it to make high-level decisions without a performance cost per individual; the individuals use their own AI to maintain their positions within the formation, a much cheaper computation. A signaling system allows the formation to communicate with its own members or other entities. If the formation wants more followers, a filtering system allows it to find and evaluate potential ‘formationable’ characters nearby.
An early proof of concept
The Challenges
Movement presented a challenge for our developers. A formation refers to the Kythera AI NavMesh to find the areas that its members can go. However, navigation meshes are usually built for a given agent size and a formation has shifting or dynamic size, resulting in formation members falling off the mesh.
The team created a solution using Kythera AI's advanced pathfinding algorithm and some creative development.
The traditional pathfinding algorithm did not intrinsically account for the formation’s variable width, meaning one section of the formation might find themselves blocked or bottlenecked when following the calculated path. Our experienced team were able to adjust our pathfinding algorithm so that it took the whole formation into account. This allows a formation to intelligently and dynamically change shape as it traverses an area of mesh too narrow for its current structure.
To add to its dynamism, the formation can drop members as necessary. These members can then revert back to their own individual AI, continuing to be a realistically functioning agent, before rejoining the group and converting to the AI of the formation once more.
The feature is completely accessible from Kythera AI's Behavior Trees (BTs). To achieve this, specific BT nodes needed to be created. These nodes linked to the behaviors for agents to lead, follow, join or leave formations, for the formation to merge or split, or garner information about the proximity of other formations. These nodes make the behavior of formations easy to plot and edit, giving designers full control.
The result is a powerful feature and valuable tool in the belt of any AI developer. Kythera AI's Formations feature is capable of:
- Fully dynamic behavior, acting instantly in response to other agents or changes to the environment, as are all the features of Kythera AI
- Fast pathfinding - the formation pathfinds as a single entity, reducing the cost of individual navigation
- Adaptive navigation - restructuring if necessary to find the best route through complex terrain
- Smooth, realistic turning - naturally swiveling around corners with the outer edge moving faster than the inner, giving heightened realism perfect for simulating armies
- Sophisticated shape changing - Individual units can seamlessly merge together to form formations and multiple formations can combine into larger formations, smoothly flowing together without jolting or shuffling back and forth
- Group and individual actions - Units in the formation can act as a group, all firing in unison, or individual units can act independently, defending or attacking solo
- Performant, scalable AI - From bands of skirmishers to invading armies, you can have dozens of formations on the screen at once
- Intuitive, developer-friendly integration - Formations can be configured and extended through code and Kythera Behavior Trees, and they work in tandem with all of Kythera AI's other advanced features. So your studio can start using formations in your game instantly.
Add Formations to your game
We love working closely with studios to meet the needs of cutting-edge games, and we’re looking forward to an opportunity to replicate our success with Wolcen alongside other teams.
To find out how easily you can add formations to your game and build innovative AI-driven gameplay, talk to us and to book an evaluation.