There is a huge variety of games that aim to achieve a whole range of experiences and enjoyment. The idea of combat in games is a simple, primal addition, but in adding combat to a game a new element of choice is added, and a chance to outwit (and outgun) your friends.
Combat is quite often a central aspect of gameplay for lots of different reasons, and isn’t always the run-and-gun style that it seems for non-gamers. It can be used to tell a story like in Last Of Us or it can present puzzles like in Legend Of Zelda or Shadow of the Colossus. Combat can also be delivered in lots of different ways as well. For example, Silent Hill’s creepy aesthetic and tense atmosphere or Call Of Duty’s action-packed warzones, or it can be made into a competitive team sport such as in Overwatch, CS:GO or Fortnite, each of which require a team to have excellent communication, teamwork and tactical skills.
Whatever the reason for including combat in your game, there are a few simple techniques that you can use to make your combat compelling and engaging, and to give your players something more in-depth than just point and shoot. Let’s get into it.
This tutorial will look at leveraging some of the skills you’ve learned from the previous basic tutorials, and add a premade game type into the mix to put your own stamp on a tried-and-tested game mechanic. It will look at:
- The “Capture The Flag” game type
- Adding destructible and indestructible terrain
- Level editing to create intense battles with guns and traps
Create Your Game
Under the CREATE A NEW GAME menu, find the Team CTF (Capture The Flag) game template. Select this template, and select the STARTER: TEAM CTF starter map. Notice that this time we will not be using the Empty Game. Give your game a name, choose a thumbnail image and enter the editor.
Welcome to Capture The Flag!
Before we make any changes, Preview the game to see how the base template works.
You will see that there are two flags, and two coloured zones. Players start in a “Lobby” as they wait for all Players to connect. When the Lobby time limit reaches 0, the game begins.
The object of the game is to capture the opposing team’s flag by running into it, and then bring it back to your team’s coloured zone. Each time you do this, your team will score one point. The team with the most points when the timer reaches 0 wins. If a Player dies, they will respawn at their team’s base.
The game is quite simple at the moment, let’s mix things up.
End the game preview and ensure you are in Basic Editor mode.
Moving The Bases
This section concerns moving the bases to a different location on the map. If you don’t want to move the bases, and are happy with where they are, you can skip this step, but it’s good practice to fully configure your own game.
A base is comprised of the following Entities:
- A coloured floor – This indicates to the player which base is which. The red and blue plastic floors are not destructible, so that the flag is always accessible.
- A flag – The flag is a Prop Entity. When a Player collides with the flag they “pick it up” and carry it on their back. To “capture the flag”, the Player with the flag must collide with their own team’s flag in their own base. When they have captured the flag, it is immediately returned to their opponent’s base, ready to be captured again.
- A locator – The locator in the base is where Players are respawned when they die.
To move a base will take three steps:
- Create a new floor area which will specify the new base area
- Move the flag and respawn locator to the new base
- Delete the old floor area
Let’s get started.
Look at the floor and open the Entity Editor. This will show you the Entity Editor for your terrain, and it gives you a good opportunity to see an overview of your map.
Open the Entity Editor for the Terrain regularly, to get an overview of how your level is shaping up. For now, exit the Entity Editor.
Open the Library and navigate to the Voxels tab. Highlight the Plastic Dull voxel and press A. You will see that you have a choice of colours of Voxel to add to your Hotbar. This game has been setup to use Red and Blue, so stick to these colours for now. Highlight either the Red or Blue Plastic Dull Voxel and add this Voxel to your Hotbar.
Select the Toggle Voxel Tool option to change the Voxel tool to a 1x1x1 block
Place a Voxel and create a new base somewhere else in the level by drawing a low platform. I have chosen to position the bases in each corner of the map. Do this for both the Red and Blue teams.
When you have finished, select an empty Hotbar slot. Look at the floor and select it to open the Terrain Entity Editor again. You should see you now have two bases on your map – the original two, and two new ones.
Now close the Entity Editor.
Now you need to move the flags onto your new bases.
Move towards a flag and, whilst looking at it, select it to open the Entity Editor.
You should see that the flag entity has a flagSpawnerScript attached to it. Each flag has a different team. By default, Team 1 is on the Blue floor, Team 2 is on the Red floor.
You have two options to move the flag. You can pick the one that suits your style of level making:
Option 1: Numerically Move The Flag
You can edit the position data in the Entity Editor for the flag. This method is better for level designers who like to be very precise.
To do this, ensure the Entity Editor for the flag is open and navigate to the “position” property box. These three numbers represent the coordinates of the flag, and specify its position in the world. Adjusting the first two boxes will move it’s position on the ground, whilst the third box changes it’s vertical position.
Use the position property boxes on each flag to move them to the corresponding team base. To do this, highlight one of the first two position property boxes and select it. You can use D-Pad Left/Right on the controller or type a number in on the keyboard to change the numbers and move the flag.
On controller, if you hold RB whilst pressing D-Pad Left/Right you can increment the numbers in multiples of 10, and move the flag faster.
When you’re happy with the flags position close the Entity Editor.
Option 2: Pickup The Flag
Alternatively, you can pickup the flag and move it to a different location. This method is better for freeform level designers.
Look at the flag with the Entity Editor closed, and it should be highlighted. Select the key that is bound to the Pick Up ‘Flag’ tooltip. Head over to your new base location, and place the flag.
Once you have moved the flags to new bases, the last Entity to move is the Locator, which is the spawn point for the Players on each of the teams. Use the same technique you used to move the flags to move this Locator.
Open the Entity Editor for each flag and make sure that Team 1 is on the Blue floor, Team 2 is on the Red floor. Close the Entity Editor.
The last step is remove the old bases. To do this, you can paint the team outline colour of the base with the Technical Grid Voxel.
Open the Library then navigate to the Voxels tab and add the Technical Grid Voxel to add it to your Hotbar. Close the Library.
Cycle through the Toggle Voxel Tools option until you see the Fill tool. Use the Fill tool on the previous base outlines.
To make a more compelling level it is a good idea to add some walls so that the opposing teams can’t just stand and shoot each other. You can use Voxels to create obstacles on your map, which players can use to hide behind, or which cut off certain routes to the opponents flag. This “cover” also creates opportunities for teams to outflank (and outwit) each other.
Choose a Voxel to be your walls. The walls are destructable by default, so select a Voxel that is usually considered destructable in shooting games. Cycle through the Toggle Voxel Tools to increase the size of the Voxel tool, and use large blocks to create a general shape to your level. You might find it easier if you double jump to enter flying / non-clip mode.
Try to compose a variety of spaces. Create some wide corridors and some narrow corridors, some small areas, and some bigger areas.
You can choose if you want to surround your level perimeter with a wall. If you choose not to have a wall then if your players fall off the side they will fall to their doom.
Remember you can get an overview of your level by opening the Entity Editor for the Terrain.
Creative Control: Combat Situations
Your level should offer rich opportunities for players to battle in a variety of ways You could choose between short, medium and long-range combat situations or a mixture of all three.
Creative Control: Level Design
There are lots of ways to design a level. You could use a pen and paper to sketch some ideas for your level, or build structures freeform in Crayta’s EDIT mode, and devise a level bit-by-bit. It’s your choice!
Think about how your level could be structured. Make sure to include points which might be suitable to spawn resources such as different guns.
Also consider whether there might be perilous areas of your level, traps that either team can take advantage of to gain the upper hand.
Once you have given your level a general shape, you can tweak some of the spaces by adding and removing smaller Voxels to give opportunities for more or less cover in certain areas. Experiment with different sizes of the Voxel tools.
Creative Control: Game Balance
Remember there are two teams on the field of battle at once, so try to keep in mind how to make sure that the game is fair for both sides. Try to give each time an equal number of good positions, and build in weaknesses to dominant areas of the map to encourage teamwork and tactical thinking.
Preview your game and then shoot any of the Voxels you placed then you will see they are destroyed. If you shoot either the Red or Blue team floors, you will notice that they are indestructible. This is a good thing, because otherwise a team could destroy their own floor and the flag would no longer be accessible, ruining the game.
You can turn off destructable voxels by looking at the floor anywhere and unchecking the “damageEnabled” property.
As you will be adding a mixture of destructable and indestructable cover you should leave damageEnabled checked.
Creative Control: Destructible Environments
Having destructible cover is great for forcing players to think on their feet, and adjust their tactics in the middle of a gunfight, but having indestructible areas can make map control more important to achieve victory.
You can create your own indestructible Voxels.
Press Y to open the Library and choose a Voxel that is unlikely to be damaged, for this tutorial we have used Metal Steel. Build some cover in your game using the Metal Steel Voxel.
Once you are happy with your indestructible cover, open the Entity Editor for the Terrain.
At the bottom of the Entity Editor is a button “Add to Entity”. You can use this button to add Scripts and UI Widgets to an Entity. Highlight Add to Entity and select it.
Select Add > Script > voxelHealthValueScript.
The voxelHealthValueScript allows you to tell Crayta how much damage different Voxels can take before they are eliminated.
Note: There is another script called the voxelHealthScript that sets the default behaviour of the voxels and is why the Technical Grid blocks will be removed when shot. Luckily we have already set this for this template, but you may want to include it in your own game.
This Script enables you to determine the health of a specific voxel (how much damage it can take before it is eliminated). Once you have added it to the Entity Editor select Metal (Steel) Voxel in the voxel dropdown, and set the health to 0.
Close the Entity Editor and preview the game and test that your Metal Steel is indestructible by shooting it.
Edit your level so that you have a mixture of destructible and indestructible cover and remember to play test it regularly so that you can see how your level editing changes the dynamic of the game. remember to add a new instance of voxelHealthValueScript and set the Voxel type and health to 0 on the Voxels you want to be indestructible.
Creative Control: Voxel Health
A voxel doesn’t have to be destroyed in one shot. Just like we decreased the Voxel Health to 0 to make it indestructible, you can increase the Voxel Health to take 2 bullets, or 10 bullets! The Automatic Rifle default damage is around 150, so a Voxel Health of 150 or less would take one shot (1 bullet x 150 damage = 150), 300 or less would take 2 shots (2 bullets x 150 damage = 300) and so on.
More Guns Please
You can find many different weapon packs by visiting the Store in the Library.
Open the Library and then open the Community tab. Find the Shotgun Package within the store, highlight Install and select it to install the Package.
Return to the Library by navigating back to the Library tab, and open the Templates.
You should see a new template has been added to your Templates, called Shotgun. Select the Shotgun Template from the Library and place it in your scene.
Open the Shotgun Entity Editor and find the pickupSpawnerScript Properties. Change the Properties to match the following:
Use on Collision – This option should be ticked.
Rotate Time – Set the seconds field (S) to 4.
Spawn Time Min – Set the seconds field (S) to 1 and set the minutes field (M) to 0.
Spawn Time Max – Set the seconds field (S) to 4 and set the minutes field (M) to 0.
Show on Init – This option should be ticked.
After making these changes, navigate to the top of this Entity Editor and make sure to select Copy To Template.
Preview the level to try the Shotgun. Walk over the gun to pick it up.
Return to the game editor.
You may disagree with some of the values of the Shotgun (does it cause too much damage? Is it too accurate?). You can fully customise each gun to behave differently by using the Entity Editor and changing the Properties on the gunScript. Remember to press Copy To Template after making any changes.
Creative Control: Risk and Reward
Based on your experience with the new guns, consider where might be a suitable place to put them in a level. You may decide that the base of each team has a library of weapons available, or that one team has only shotguns whilst the other have only handguns.
Alternatively, you could put less powerful guns in easy to reach places, and more powerful guns in dangerous places, such as the middle of a crossfire, or somewhere requiring serious parkour skills.
Adding this risk and reward can give the game more depth, as the teams will need to weigh up arsenal resources versus the risks to team members, and ultimately decide which will help them win the game.
What’s more exciting than two factions battling it out in intense combat? When that combat takes place in a hostile environment. Sometimes, it’s the situation that can turn the tides of battle, and teams can use natural dangers to their advantage, as distractions or as danger themselves.
Open the Library and to navigate to the Community. Find and install the Basic Combat Trap Package. Return to the Library and add the Laser Spikes Template to your Hotbar.
Place the Laser Spikes somewhere in the level. Remember, you can rotate the Entity to make laser walls also.
You can also try placing multiple Laser Spikes, and creating no-go areas or dangerous corridors that are asking for escalating gun battles. Players can shoot through the Laser Spikes, but can’t get past them, so they can offer some exciting advantages to clever Players.
Preview your game and test the traps. You should find that they cause your player damage.
Return to the EDIT mode.
Touching the Laser Spikes will cause players damage, and knock the player back. You can change the amount of damage and knockback that the traps have. In EDIT mode, open the Laser Spikes Entity Editor. The properties that can change the damage that the Laser Spikes cause can be found in the passiveDamageScript properties.
Using the Entity Editor, you can change the amount of damage caused to the player, how much it knocks the player back, and what Sound effect will play when a player collides with the trap.
Experiment with the properties of the Laser Spikes, and adjust them to suit your game. You can make a trap deadly, by increasing the localDamage to 1000! You can also change the Mesh Asset to suit your theme. Maybe your game features a highly lethal coffee table, or a not very dangerous banana which launches players across the map.
Congratulations on completing the last of the Basic tutorials. In this tutorial, you have discovered:
- Remixing your own version of a Capture The Flag game
- Designing a level for exciting and dynamic combat
- Adding destructible and indestructible terrain
- Adding guns to a level
- Adding traps to a level
You have started designing a level for combat, but there are endless opportunities for changing the environment in your game, and making a really exciting and challenging level with plenty of opportunities for strategy.
Using the level you have started, you could try and include some of the following ideas:
- Improve the theme of the game to start building a sense of story. Why are these teams fighting? Why do they need to capture the flag? Even the most combat focused shooting games have some kind of narrative.
- Try making your level have high areas and low areas, and experiment with three dimensional tactical advantages.
- Install the Super Smash ‘n’ Grab package, and place the flags in Bank Vaults, with their own key. Now Players will need to find the key, or blow open the doors before they can start to win points.
- Give your game level more variation by adding some of the premade Mesh Assets that fit your theme. You can also turn on physics on the Mesh Assets, which means that players can move them around and give themselves more cover or hiding spots.
Next up: Advanced Editor Mode
Congratulations on completing all of the Basic tutorials. Hopefully you feel inspired to experiment with some of the other game modes, and get creative with the tools at your disposal.
To really take things to the next level, you can try the Level Editor in Crayta with a keyboard and mouse. In the Advanced Level Editor you will have an opportunity to code within Crayta and use scripts to customise the interactions in your game.
There are a variety of guides which you can use as a reference point for using some of the Advanced tools in Crayta.
Familiarise yourself with the Advanced Level Editor in the Advanced Workflow Tutorial.
Learn some basic scripting in the step-by-step Code Tutorials.