Learn how to add grid battles in this short gameplay tutorial series.
This is the 10th part of the gameplay tutorial series focused on grid battles – you can find part 1 here. In this part we’ll look into real time battles.
Real Time Battles
In Real Time battles there are no turns or timebars – actions can be performed at all times. You can learn more about real time battles in this how-to.
Since we already used real time battles in the game tutorials, there’s not much we need to change. Navigate to Battle System > Real Time Battles and change the following settings.
Control Block Settings
We need to block the player’s controls for the whole battle – even though we’re fighting in real time, we want movement to only happen when using the grid move command.
- Block Player Control
Select Battle. - Block In Battle Menu
Enable this setting.
Like in the previous tutorials, we’ll allow camera controls to make use of the camera control target changes.
- Block Camera Control
Select None. - Block In Battle Menu
Disable this setting.
Move AI Settings
Like blocking the player controls, we don’t want the move AI to move combatants around.
- Allow Move AI
Disable this setting.
Optional: Default Start/End Events
You can either override the default events in the Battle component used for a real time battle (as we did in turn based battles), or just define the grid battle start/end events here.
- Start Event
Select gridBattleStart. - Victory Event
Select gridVictoryBattleEnd. - Escape Event
Select gridEscapeBattleEnd. - Defeat Event
Select simpleDefeat. - Leave Arena Event
Select gridEscapeBattleEnd.
Battle Gains Collection
- Collect Immediately
Disable this setting.
Grid Settings
- Turn End Orientation
Enable this setting.
That’s it for the grid battle setup – click on Save Settings to save the changes.
Considering Moving Combatants
Like active time battles, real time grid battles are different from grid battles using the turn based or phase battle system, since combatants could be moving on the grid while or after the player selects an action.
Currently, a moving combatant wont be assigned to the cells of the movement path. For this, we’ll need to add a new step to the grid move event – a Set Grid Cell Combatant step.
The step is best added in the loop handling the cell to cell movement, after changing the Change Position step to move the user to the new cell.
Set Grid Cell Combatant
Add > Battle > Grid > Set Grid Cell Combatant
This step is used to set the combatant of a grid cell – in our case, we’ll use the special Move case. If the cell is empty (i.e. not occupied by another combatant), the combatant will be set as the cell’s combatant, otherwise the combatant will be added as a guest on the cell. Using Move will also handle clearing the combatant from the previous cell.
Combatant Settings
- Object
Select Actor. - Actor
Select User.
Grid Cell Settings
- Set As
Select Move. - Use Nearest Cell
Disable this setting. - Object
Select Found Object. - Value Type (Object Key)
Select Value. - Value (Object Key)
Set to cell.
Dealing Damage
Currently we’re using Damage Dealers and Damage Zones to deal actual damage with physical attacks in our real time battles. Due to now fighting on a grid, that’s no longer the best option, as this setup was meant for the action-oriented hack’n’slash battles we set up in the game tutorials.
We’ll set physical attacks to also deal damage like we already do in the other battle systems – the following changes are made this way to still be able to fight the action-oriented real time battles aside from grid battles.
Damage Dealers
First, we’ll need to update the settings of the Damage Dealer components attached to the prefabs of the weapons. You can find the prefabs in Assets/Tutorial Resources/Prefabs/Weapons.
Update the FireSwordPrefab, LongSwordPrefab and ShortSwordPrefab prefabs by making the following changes.
Damage Settings
- Grid Battles
Select No.
Abilities
We also need to change which battle events are used for the physical attack abilities. Currently we’re using the attackNoCalculation battle event instead of the attack battle event.
Update the Attack and Mug Attack abilities by making the following changes.
Animation Settings
Change Battle Event 4 (i.e. the one using attackNoCalculation).
- Grid Battles
Select No.
Copy Battle Event 4 and change the new settings.
- Battle Event
Select attack. - Grid Battles
Select Yes.
And that’s it – don’t forget to save the changes by clicking on Save Settings.
Scene Setup
Setting up a real time grid battle in a scene works just like setting up a turn based battle. When using the ORK scene wizard, use Create Object > Real Time Battle instead of creating a turn based battle – or change the Battle Type of the Battle component to Real Time.
You can either set up a completely new battle and battle grid, or just change one of the existing battles we’ve set up earlier. Please note that real time battle areas don’t support grid battles.
This concludes the gameplay tutorial series on grid battles.