Let's Survive

game unity3d

Gameplay screenshot of Let's Survive, showing the player character fighting against multiple enemy characters.Gameplay screenshot of Let's Survive, showing the player character fighting against an enemy character.Gameplay screenshot of Let's Survive, showing the player character waiting for a cargo from an helicopter to drop nearby a smoke signal.
Gameplay screenshots of Let's Survive

About this game

Let’s Survive is a single-player Battle Royale video game for smartphones. Although this title features most elements of the popular genre, the core gameplay loop was simplified to fit the hybrid-casual target scope.

The objective remains the same, players must be the last ones standing to win. In order to defeat their opponents, they will have to explore the open world to find weapons to defend themselves. Weapons and health packs can spawn everywhere: inside buildings, under a tree, behind some rocks…

Players also need to be aware of the play area, as it will shrink over the course of the level and it will casue increasingly more damage to any character that is outside the limits.

PeerTube Short gameplay of "Let`s Survive"

Designing convincing enemies

In Let’s Survive enemies can perform the same actions as the player, as they are competing in equal terms. Because of that, I designed a base Character which has all the core mechanics (e.g. the ability to pick up weapons, the ability to move, a health system, etc) to which then I extended into both PlayerCharacter and EnemyCharacter.

The PlayerCharacter simply receives the inputs from the player and uses the Character mechanics accordingly. However, for the EnemyCharacter, I also needed to design an AI that would come up with the right inputs, mimicking what players do unconciously, by taking into account its surroundings, other characters nearby, and its own status.

Given the single-player nature of this title, it was very important that the enemy characters felt fun to play with. Earlier levels should feature “dumber” enemies, while later levels should have “intelligent” ones instead. The former to onboard inexpereienced players to the game, and the latter to keep advanced players engaged.

Drawing of the behaviour tree of the enemy characters
Early drawing of the behaviour tree of the enemy AI

For this reasons, I designed the AI of the enemies using Behaviour Trees, as they would allow me to scale, maintain and modify the logic quite easily. This was my first time implementing this system, and it shows, as the end result was a bit messier and not as maintainable as it should have.

Nonetheless, I managed to structutre the project in a way where the tree logic was separated from the data it uses, which is external and can be easily modified by designers, who have access to:

  • A level parameter enemyIntelligenceFactor that goes from 0 to 1 and defines how “dumb” or “intelligent” the enemies are.
  • A Scriptable Object that exposes variables, ranges and curves for the different aspects of the enemy (reflexes, eagerness, luck, mercyfulness, etc…).

Once an enemy spawns, its behaviour tree is fed with the results of evaluating the data in the scriptable object using the value of enemyIntelligenceFactor.

FOV vision cones

As development started, I realised how difficult debugging these behaviours would be without a visual representation of what the enemies were seeing, specially when engaging in combat. Because of that, I decided to implement Field Of View vision cones. The idea behind them is quite simple: Enemies will only be aware of other characters when they enter their vision cone.

Different vision cones, showing different styles and shapes.
Different vision cones, showing different styles and shapes.

I couldn’t find any asset online that fit the use case I needed to cover, so I created my own implementation using only Unity3D’s resources. This tool turned out to be quite useful for me, so I decided to separate it from this project and release it online as a resource for people to use. I wrote a blog post covering this on greater detail. You can find more information about it there:

Vision Cones for Unity3D

The more “intelligent” an enemy is, the longer and wider its vision cone becomes. This particular design decision allowed the team to implement one final mechanic to the gameplay: The ability to backstab unaware enemies in order to cause extra damage and surprise them.

In the picture below, you can see this in action in three different screenthsots: First, the player attacks an unaware enemy causing extra damage. Then, the surprised enemy spins around to face the player. Finally, the enemy gives chase after noticing the player.

DImage showing the backstabbing feature during development.
Image showing the backstabbing feature during development.
PeerTube Gameplay of "Let`s Survive"