ORK 4 RPG Framework Logo
  • ORK 4 GUIDE
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 GUIDE
    • Documentation
    • Tutorials
    • API
  • Support
  • Forum
  • Get ORK

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • Quickstart Extended
  • Battle Tutorials
    • Active Time Battles
    • Phase Battles
    • Real TT 01 Real Time Battles & Tab Targeting
    • Real TT 02 Control Map, Use Ranges & Battle Area
    • Real TT 03 Camera Control, Battle AI & Reuse Time
    • Real TT 04 Damage Detection, Action Animation & Player HUD
    • Real TT 05 Switch Player & Final Adjustments
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Reuse Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Control Map for Keyboard (Shortcuts)
    • Control Map for Gamepad (Shortcuts)
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD
    • Menus 01 UI Box Setup
    • Menus 02 Template HUDs
    • Menus 03 Menu Setup
    • Menus 04 Main Menu
    • Menus 05 Inventory
    • Menus 06 Equipment
    • Menus 07 Ability
    • Menus 08 Group
    • Menus 09 Quest
    • Menus 10 Crafting
  • Module 01: Status System
    • Introduction to Modular Tutorials
    • M01.1: Status Values
      • Introduction to Status Values
      • Health
      • Mana
      • Barrier
      • Base Experience
      • Class Experience
      • Spendable Experience
      • Normal Stats
    • M01.2: Modifiers
      • Introduction to Modifiers
      • Element
      • Attack Type
      • Size
      • Race
    • M01.3: Status Effects
      • Introduction to Status Effects
      • Buffs
      • Debuffs
      • Poison
      • Regeneration
      • Blind
      • Stun
      • Sleep
      • Silence
      • Enchants
      • Charm
      • Doom
      • Reflect
  • Module 02: Actions
    • Introduction to Actions
    • M02.1: Formulas
      • Introduction to Formulas
      • Physical Damage Formula
      • Magical Damage Formula
      • Hit Chance
      • Critical Chance
    • M02.2: Abilities
      • Introduction to Abilities
      • Base Attack
      • Elemental Magic Spells
      • Steal Ability
      • Drain
      • Healing Spell
      • Cure
      • Buff Abilities
      • Debuff Abilities

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • Battle Tutorials

Phase Battles

0:00 / 11:00
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

In this tutorial we’ll set up a phase battle system.

Phase battles give each faction participating in a battle their own phase to select and perform actions in. Like turn based battles, phase battles can use actions per turn to manage how many actions a combatant can use. We’ll make use of that and allow combatants to use multiple actions.

We’ll set up:

  • phase change schematics
  • updating factions (using the schematics)
  • phase battle system
  • action costs
  • battle camera
  • battle menu update
  • default battle system

This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials, but can be used in any project. We’ll change the quickstart tutorial’s battle system to phase.

Player Phase Schematic #

We’ll start with setting up the phase change schematics – we’ll use one for the player and one for the enemy. You can use a start and end phase schematic to handle custom systems or announce which faction’s phase it is. The combatants that are part of a phase are used as Machine Object of the schematic.

The schematics will change the camera control target to focus on the combatants of the faction and show a dialogue to inform the player of who’s phase it is.

Open the schematic editor.

Camera Control Target #

Add Node > Input > Camera Control Target

This node changes the camera of the active camera control.

The default setup is already correct for us:

  • Target Type
    Select: Object
  • Object (Target Object)
    Select: Machine Object

Show Dialogue #

Add Node > UI > Dialogue > Show Dialogue

We’ll simply show Player in an auto close dialogue.

An auto close dialogue will autoamtically close after a defined time – we’ll allow the player to accept the dialogue to start the phase faster.

  • Dialogue Type
    Select: Auto Close
  • UI Box
    Select: Action Info
  • Block Accept Button
    Disable
  • Close After (s)
    Set to: 3
  • Wait
    Enable
  • Text (Message)
    Set to: Player Phase!

Wait #

Add Node > Base > Wait

We’ll wait for another second.

  • Time (s)
    Select: Value > Value
    Set the value to: 1

And that’s it – click on Save Schematic and save the schematic as PhaseStartPlayer.

Enemy Phase Schematic #

We’ll continue working on the schematic and save it as a new schematic using the Save Schematic As button.

Show Dialogue #

We simply need to change the text.

  • Text (Message)
    Set to: Enemy Phase!

And that’s it – click on Save Schematic As … and save the schematic as PhaseStartEnemy.

Updating Factions #

Phase change schematics are set up in the factions that should use them, so we’ll need to update the player and enemy factions.

Player Faction #

Open the ORK editor, navigate to Combatants > Factions and select the Player faction.

Phase Change Schematics #

  • Phase Start Schematic
    Select: PhaseStartPlayer

Enemy Faction #

Select the Enemy faction.

Phase Change Schematics #

  • Phase Start Schematic
    Select: PhaseStartEnemy

Phase Battle System #

Navigate to Battles > Battle System and select the Phase battle system.

A new ORK project already has a version of each battle system added – if you’ve removed yours at some point, simply add a new battle system and change it’s Battle System Type to Phase.

Base Settings #

We’ll allow camera controls in battle and use the battle start/end schematics we created in the quickstart 3D tutorials.

Control Block Settings #

  • Block Camera Control
    Select: None
  • Block in Battle Menu
    Disable

Battle Start/End Schematics #

  • Start Schematic
    Select: BattleStart
  • Victory Schematic
    Select: BattleEndVictory
  • Defeat Schematic
    Select: BattleEndDefeat

Phase Settings #

These settings handle the Phase battle system, the other settings are the same for all battle systems.

Battle Mode #

  • Use Active Command
    Enable
    Selected actions are performed immediately, similar to the Active mode in turn based battles.
  • Auto Start Turn
    Select: Phase Start
    All combatants that are part of the phase start their turn at the start of the phase, this has e.g. impact on status effects that use changes on turn start.
  • Auto End Turn
    Enable
    A combatant’s turn will automatically end under defined conditions.
    The default setup will check if the combatant can still use their base attack, any ability or item. The turn will also end if the remaining actions per turn (see below) reached 0.
    We’ll stick with this default setup.

Phase Order #

The phase order can be based on formulas or other values, but we’ll simply use phases based on the order in which the factions are defined in the editor, i.e. sorted by ID.

  • Sort By
    Select: ID

Combatant Order #

The player will be able to freely select in which order the combatants are used – but we’ll let the enemy combatants be ordered by their agility.

  • Calculate Order
    Enable
  • Order Calculation
    Select: Combatant > Status Value
  • Status Value
    Select: AGI

Other Options #

  • Selecting Control Map
    Enable
    This’ll use the control maps of the combatant who’s currently selecting actions.
    We enable this in case we later add control maps to the game.

Player Combatant Selection #

These settings handle if and how the player can select combatants in the player phase.

  • Use Combatant Choice
    Enable
  • Show Selection Box
    Enable
    The player can select the combatants in a UI box.
  • Allow Back
    Enable
    The player can back out of a selected combatant – the combatant can be selected again, as long as it can perform actions.
  • UI Box
    Select: Battle Menu
  • Add End Phase (End Phase Button)
    Enable
    The UI box will have a button to end the phase.
  • Text (End Phase Button)
    Set to: End Phase

Action Settings > Actions Settings #

Combatants can perform multiple actions per turn.

We’ll give combatants 2 action points, but not all actions will cost 1 point. Using items or the base attack will cost 1 point, but other abilities or special commands will cost 2.

  • Actions Per Turn
    Select: Value > Value
    Set the value to: 2

The Default Action Cost is used by all actions unless they define their own cost – we’ll use this to have everything cost 2 points.

  • End Turn
    Enable
    Using an action will end the turn.
  • Use Remaining
    Enable
    This’ll use all remaining action points – not really needed in our setup, but it doesn’t hurt to use it either.
  • Action Cost
    Select: Value > Value
    Set the value to: 2

Now, we’ll set up the exceptions that only cost 1 point.

  • Own Item Cost
    Enable
  • Action Cost
    Select: Value > Value
    Set the value to: 1

We’ll also have the none action (does nothing and ends the turn) only cost 1.

  • Own None Cost
    Enable
  • Action Cost
    Select: Value > Value
    Set the value to: 1

In case we later add more player group members and allow them to be changed in battle, we’ll also have changing members cost only 1 point.

  • Own Change Cost
    Enable
  • Action Cost
    Select: Value > Value
    Set the value to: 1

Now, all that’s left is to change the base attack to cost only 1 action point.

Updating Base Attack #

Navigate to Status > Abilities and select Attack.

Level Overrides > Phase Action Cost #

We’ll set the action cost in phase battles to 1.

  • Own Phase Action Cost
    Enable
  • Action Cost
    Select: Value > Value
    Set the value to: 1

Battle Camera #

ORK has an optional battle camera that can automatically show the battle’s action.

Since our setup allows camera controls during battles, we’ll use the battle camera to change the camera’s target to the combatant who’s turn it is.

Navigate to Controls > Battle Camera.

Battle Camera #

  • Battle Camera Type
    Select: Allow Schematics
    This’ll allow schematics animating actions to also perform camera changes.
    You can also completely block schematics from changing the camera.

Look At Latest User #

This’ll look at the combatant who’s performing the latest action.

  • Enable
    Enable
  • Look At Type
    Select: Camera Control Target
    This’ll use the combatant as the target for the camera control.
    This only works if camera controls are allowed during battle.
  • Reset Current Target (Transition Settings)
    Enable

Look At Selecting User #

This’ll look at the combatant who’s currently selecting an action – this is for both player and non-player combatants.

If you only want this for player combatants, use the Look At Menu User settings instead.

  • Enable
    Enable
  • Look At Type
    Select: Camera Control Target
  • Reset Current Target (Transition Settings)
    Enable

Battle Menu Update #

We’ll also make a small adjustment to the battle menu – adding a back button to the base list of the battle menu.

This allows returning to the combatant selection.

Navigate to Menus > Battle Menus and select the Default battle menu.

Base Settings #

  • Back In Base
    Enable
    The back button is only added in Phase and Real Time battles.

Default Battle System #

And finally, to actually use the Phase battle system, we’ll change the default battle system.

Navigate back to Battles > Battle System and select General Settings.

Base Settings #

  • Default Battle System
    Select: Phase

Save Changes #

And that’s it for the phase battle system setup.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Testing #

Hit play and start a battle.

https://orkframework.com/wp-content/uploads/ork4_tutorials_gameplay__phase_battle_demo.mp4

Everything seems to be working as it should.

However, we can’t really see how much AP the player still has, or how much using something will cost – let’s change that.

Use Cost Display #

The use cost display settings handle how the costs of an action are displayed.

The default setup doesn’t include the action costs, so let’s add them.

Open the ORK editor and navigate to Texts > Use Cost Display.

Action Cost Text #

  • Default Content
    Set to: <name> <value>

The content information definition for action cost (i.e. the name) can be found right below the text, in case you want to change it. The default name is AP.

Save Changes #

That’s it for the cost display, don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Updating Player Battle HUD #

We want to dispaly the remaining actions per turn of a combatant in the player’s HUD.

Since we’re using Unity UI, the HUD is set up as a prefab. Locate your HUD prefab (should be named Player Battle HUD) and open it for editing.

HUD Text Content #

Select the Player Battle HUD > Text Content child object, we’ll add another text as a child object of the name.

Use the scene hierarchy’s context menu (ORK Framework > HUD > Content > HUD: Text Content) or the ORK toolbar (search for: HUD Text Content) to add a HUD text content.

Rect Transform #

We’ll adjust the bounds to have the same size as the parent text.

Select the stretch stretch anchor preset.

  • Left, Top, Right, Bottom
    Set all to: 0

HUD Text Content #

This component handles the text content that’s displayed – the standard setup already shows the combatant name, but let’s look into it anyway.

  • Content Type
    Select: Actions Per Turn
    This type is used to display the actions per turn of a combatant.
  • Default Content (Text)
    Set to: <valueremaining> AP

TextMeshPro – Text (UI) #

We’ll adjust the alignment of the text to keep it in the (vertical) center.

  • Alignment
    Select: Right and Middle

Save Changes #

And that’s it – save the changes you’ve made to the prefab.

Testing Again #

Hit play and start another battle.

Great, actions show their AP cost and the player HUD shows the remaining AP.

Table of Contents
  • Player Phase Schematic
    • Camera Control Target
    • Show Dialogue
    • Wait
  • Enemy Phase Schematic
    • Show Dialogue
  • Updating Factions
    • Player Faction
      • Phase Change Schematics
    • Enemy Faction
      • Phase Change Schematics
  • Phase Battle System
    • Base Settings
      • Control Block Settings
      • Battle Start/End Schematics
    • Phase Settings
      • Battle Mode
      • Phase Order
      • Combatant Order
      • Other Options
      • Player Combatant Selection
    • Action Settings > Actions Settings
  • Updating Base Attack
    • Level Overrides > Phase Action Cost
  • Battle Camera
    • Battle Camera
    • Look At Latest User
    • Look At Selecting User
  • Battle Menu Update
    • Base Settings
  • Default Battle System
    • Base Settings
  • Save Changes
  • Testing
  • Use Cost Display
    • Action Cost Text
    • Save Changes
  • Updating Player Battle HUD
    • HUD Text Content
      • Rect Transform
      • HUD Text Content
      • TextMeshPro - Text (UI)
    • Save Changes
  • Testing Again
Sitemap
  • Showcase
  • ORK 4 Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (75)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (158)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!