Mount & Blade II: Bannerlord Developer Blog - Combat Particle Effects

This week's developer blog post for TaleWorlds Entertainment's sandbox RPG Mount & Blade II: Bannerlord is dedicated to the game's approach to particle effects, and in particular, their combat implementation. If you're someone who enjoys knowing how their games are made, you should check it out:

Greetings warriors of Calradia!

Mount & Blade games have always primarily focused on the core gameplay mechanics over the visual appeal of the game world. And while this is something which remains true for Bannerlord, we have worked extensively on improving the overall visual quality of the game with the aim of making the experience more immersive and enjoyable for players. In this week’s blog, we would like to talk about one of the improvements we are currently working on, which will help to bring battles to life and will give players a real sense of the gritty and brutal nature of warfare.

Particle effects are one of the core components of our battle visuals and a technique we have employed to help to add to the overall immersion in battles. A cloud of dust kicking up behind a cavalry charge or a splash of blood from a successfully landed blow really helps to make players feel that they are in the thick of the action.

Our combat particle effects fall into two separate categories: movement and attacks. In each instance, the particle type is determined by two factors. For movement, they are the speed at which a unit is moving and the terrain which they are moving across. Whereas, for attacks, the particle type is determined by the type of weapon used and the surface the weapon hits. For modularity and for the ability to easily make changes during development, we use a collision info .xml which defines the particle that is generated from the combination of actors and surfaces. Modders will be able to add new materials and collision particles, as well as change the values of already defined collisions.

To give an example of how this all works in the game, once an agent is hit by a cutting weapon, we spawn three different particles. First, a line-shaped particle is spawned in the direction of the cut. Secondly, a continuous emitter is attached to the hit position of the agent, which spawns blood particles for a short time as the weapon passes through the agent. Finally, the third particle is spawned as the weapon exits the agent. With these effects, players are given clear visual indicators for successful attacks.

In addition to this, particle instances can stick to environments and agents, leaving decals in their place. We also add mud decals to the legs of agents and mounts which are moving through muddy terrain. As with the particle effects, these splash effects can easily be added and used in the game by modders through the collision_info.xml

We use a large texture atlas for different splash effects on agents. With this, we can assign the index for an atlas position to a particle effect. Later on, we project the splash decals onto the agents with a dedicated shader. This way, we can render up to 32 decals on a single agent in an optimised way.

With these features, once the battle is over, it is easy to distinguish the troops which fought in the heat of the battle and survived.