ENG
July 9, 2023

Born to die.

In the development of mobile games, developers often choose the path of least resistance. As a result, the quality of detail suffers greatly. However, sometimes they manage to make excellent timely decisions by incorporating them into the architecture or by learning from others. We will now discuss such small things that can be implemented at the start of a project and later exploited effectively.

First and foremost, this approach is suitable for top-down shooters or idle games where the main character battles hordes of mobs and encounters numerous encounters.

Let's focus on the ordinary mobs that players obliterate by the thousands on their path. When to trigger animations with effects for them and what each stage is used for.

There are mainly two models of enemy mob spawning.

  1. Patrolling mobs: They already exist in encounters, wandering around until they encounter our hero, upon which they attack upon first contact.
  2. Spawning mobs: The second type appears when our hero enters an encounter (combat room) or during battle.

Implementing patrolling mobs is simpler because their appearance does not need to be elaborately designed. They are more commonly encountered in games. They differ from spawning mobs in having a patrolling animation, while the latter have a spawning animation. If developers are cutting corners, they may use only one spawning model, such as patrols, but they can also implement both. High-quality games incorporate the entire arsenal of mob appearances, complicating the mob spawns with climbing walls, emerging from burrows, and so on.

What does the lifecycle of an ordinary mob look like?

Being born, attacking, and dying a heroic death? At first glance, it may seem easy to create such a mob, even with a design document from game designers. But is it really that simple? Of course not, and any good cannon fodder must live a glorious albeit short life. What happens when a mob appears in the game? What should the art director and technical artists understand?

Patrolling mobs

A mob can be attacked at all stages unless gameplay prohibits it (e.g., abilities, invulnerability, etc.).

  1. Spawn - it occurs outside the screen, and for this event, no effects or animations are necessary. It simply appears in the moment and begins its life. Since the player doesn't see it, there's no need to develop or elaborate on it.
  2. Patrolling - the movement of the mob along a predefined or generated trajectory. It is a basic animation. It involves a set of animations for movement. The mob walks along the trajectory, turns. If there is a budget, additional interesting behaviors can be added to reveal its character and unique features. This can further enhance its personality and characteristics, but typically, it is only done if necessary or feasible.
  3. Enemy detection (e.g., our hero). The mob was minding its own business when it suddenly detects the enemy. An animation of aggression ensues, where the mob may roar loudly, wave its arms, beat its chest, or unsheathe its sword. The animation should be short and noticeable. It's better to have multiple variations to avoid visual monotony. Often, a UI element like an exclamation mark or snarling teeth is added to accompany the animation. The animation triggers when the enemy enters the detection radius, alerting the player that they have been detected. This animation is not always aggressive, and an immediate attack doesn't always follow. In simpler projects, this state may be ignored due to developers' lack of knowledge or intentional avoidance to save time and resources. Or in highly dynamic games, where the player is inundated with waves of mobs, there may not be enough time to notice that someone has become aggressive.
  4. Attack anticipation or combat idle - it is a subtle animation used to delay the attack after detection. It can be described as "a bull pawing the ground a few times" before charging at the enemy. The mob starts to whip itself up for greater fury, panting, performing a frenzied dance, or carving bloody tattoos on itself. During this stage, summoners may call their minions. There can also be more mundane animations where the mob simply turns towards the enemy, wakes up, descends or mounts a horse.

    An excellent metaphor would be: the alarm goes off - that's the detection, you need to get out of bed and compose yourself - that's the anticipation of an attack, and each mob has its own timing before rushing into battle.

    The timing of this animation must be closely monitored as it has a significant impact on the game's dynamics. A mechanism for adjusting the timing is also necessary. It can be combined with detection, but it's better to separate it as a distinct animation.

    Unlike in simpler projects, complex projects may overlook this animation and attempt to patch in the necessary delay in attacks after detection. Imagine the hero entering a room and all the mobs instantly rushing into battle without any preparation. It looks quite crude and is justified only in high-paced games where the player doesn't have time to calculate what's happening and needs to destroy hordes based on their skills.
  5. Attack - This is the basic animation where the mob delivers strikes to the victim. It's good to have multiple variations as it significantly diversifies gameplay. However, developers often economize on the quantity of attack animations.
  6. Reaction to damage - I would consider this a basic animation as it shows the player that the mob is taking damage. When combined with effects, it forms a significant reward for the player's efforts in defeating the mobs. It's an important animation, albeit not very noticeable. Critical hits can have more prominent animations to make the player feel the impact of their actions. Developers don't always create animations for this state as it often needs to be blended with attack and movement animations, leading to conflicting situations. However, they often incorporate effects on mobs to indicate damage, such as flashing red or white in the mob's shader.
  7. Death - This is the culmination of the mob's existence. Ideally, it should have the most spectacular animation, serving as a reward to the player for their efforts. Animation accompanied by effects is a must. Since the death animation is basic, it is usually implemented by everyone, but the level of spectacle may be compromised due to concerns about resource usage.
  8. Ashes - After the mob dies and the death animation plays, various things can happen. Sometimes the body disappears immediately after the death animation, while other times it remains lying in a dismembered pose. There can be different variations for this stage. Usually, only effects are added rather than creating a specific animation for this stage.
Demonstration of the timeline for the lifecycle of a patrolling mob. The colored blocks without arrows represent fixed-duration animations that do not loop. The blocks with arrows can loop or combine multiple fixed-duration cycles (e.g., attack). The hit reaction, for example, can occur at any time on top of any animation if the mob takes damage.

Spawning mobs:

The main difference with this mob is that its appearance is directly visible on the player's screen. During this action, some mobs may even be invulnerable, and the player can only observe their emergence. If this is done clumsily, it can negatively impact the overall impression of the gameplay.

  1. Enemy detection is important, as there needs to be a reason for the enemy to be identified. It could be triggered by the hero entering a room or activating a trigger, such as the hero entering a certain radius. At this moment, specific areas where mobs should appear can start to illuminate with effects and UI elements (as designed by the Art Director or their substitute). The system is ready to initiate the mob spawn. Summoners can trigger the same mechanism for their minions, starting to cast spells in "attack anticipation" mode.

    Sometimes, developers choose not to reveal the spawn locations for gameplay reasons.
  2. Spawn - at this stage, anything can happen, but developers usually opt for simple implementations like monsters emerging from the ground or descending from above. Generally, mobs cannot be attacked during this time (unless it is necessary, in which case the spawn animation occurs in the next stage). If the budget allows, additional animations can be developed, such as mobs climbing walls, emerging from crevices or barrels, which can be visually impressive but costly. Besides animations, these scenarios require additional mechanics.
  3. Attack anticipation or combat idle - it is still the delay between detection and the actual attack. It is crucial for this type of mobs, as it allows for implementing the spawning of mobs that can be destroyed during this time. For example, a creature emerges from the floor, and you smack it in the face before it fully emerges. Wonderful! The key point is that the mob cannot attack while in this state, but it can receive damage (relevant for both patrolling and other types of mobs).

    If it's necessary for the mob to attack immediately upon spawning, this stage is minimized in terms of timing in the logic.

    This stage can also be used to visualize "enemy detection" by creating a corresponding short animation, but it depends on the storyline and the character of the mob. For example, after the spawn animation plays, a skeleton emerges from the floor. Then, the anticipation stage begins with an animation of detection where the skeleton growls and raises its hands. Following that, there is the movement animation, and the skeleton charges into battle.

Following the example described above: Movement - Attack - Reaction to damage - Death - Ashes.

Demonstration of the timeline for the lifecycle of a spawning mob.

These are the logical stages that mobs have, at least for typical mobile games. Developers can certainly make the system more complex to achieve unique combinations of mechanics, especially for boss encounters. They may also merge certain stages depending on the project's architecture. However, the overall structure remains similar. It is also possible to simplify it by reducing animation variations, combining some stages, or removing certain stages. The game can still be playable after these changes, catering to a less demanding audience. Developers can also create their own unique structure, and it can work effectively. However, the information provided here may be useful to you and help save some time in preparing for your project's launch.

https://t.me/ArtsFactory
#solutions #cases #experience