ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • 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
    • Adding Active Time Battles
    • Adding Phase Battles
    • Hit & Miss
    • Critical Hits
    • Cast 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
    • 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

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
  • ORK 4 Unity Quickstart Tutorials (3D)

11 First Enemies & Battle AI

In this tutorial we’ll set up some simple battle AIs and two enemy combatants.

Before diving into the battle system, we set up two enemies for the player to fight – a wasp and a snake.

The enemies will attack with the base attack (Attack ability) and randomly with a Poison Attack – we’ll set up battle AIs to handle this.

Battle AIs #

AI controlled combatants use battle AIs to select their actions in battle.

A combatant’s default action in battle is using their base attack, when no battle AI is used or no useable action was found, they’ll use their base attack.

We’ll make a very simple setup where the enemies use a random ability that’s available to the combatant (for our wasp and snake it’s the Poison Attack) with a chance of 25, 50 or 75% – otherwise they’ll use their base attack.

Open the ORK editor and navigate to Battles > Battle AIs, we’ll change the Default battle AI and add more battle AIs.

0: Random Ability 25% #

Has a 25% chance to use a random ability (available to the combatant).

In case the chance fails, this battle AI ends, continuing with the next battle AI fo the combatant (or using the base attack if no other battle AI is available).

Battle AI Settings #

  • Name
    Set to: Random Ability 25%

Chance #

Add Node > Base > Chance

Does chance checks and performs a next node based on it.

The a default chance check is already set up for us (Range 0), so let’s change.

  • Minimum Range
    Select: Value > Value
    Set the value to: 0
  • Maximum Range
    Select: Value > Value
    Set the value to: 25

Ability #

Add Node > Action > Ability

Uses an ability of the combatant – we’ll use a random ability.

The node is connected to the 0 – 25 next slot of the Chance node.

  • Use Random Ability
    Enable
    This’ll use a random ability available to the combatant.
  • Use Highest Level
    Enable
    This’ll use the highest available (and usable) level that’s available to the combatant.
    We don’t really use abilities with multiple levels in this tutorial series, but it’s still a good practice.

1: Random Ability 50% #

Has a 50% chance to use a random ability (available to the combatant).

Copy the Random Ability 25% battle AI and change the following settings.

Battle AI Settings #

  • Name
    Set to: Random Ability 50%

Chance #

  • Maximum Range
    Set the value to: 50

2: Random Ability 75% #

Has a 75% chance to use a random ability (available to the combatant).

Copy the Random Ability 50% battle AI and change the following settings.

Battle AI Settings #

  • Name
    Set to: Random Ability 75%

Chance #

  • Maximum Range
    Set the value to: 75

Combatants General Settings #

Next, we’ll set up the default battle AI for all combatants – we’ll use the Random Ability 25% battle AI.

Navigate to Combatants > Combatants and select the General Settings.

AI Settings > Battle AI #

Click on Add Battle AI.

  • Battle AI
    Select: Random Ability 25%

Wasp #

Add a new combatant.

Content Information #

  • Name
    Set to: Wasp

Base Settings > Prefab Settings #

  • Prefab
    Select: Wasp

UI Settings > Portraits #

Click on Add Portrait Set and click on Add Portrait in the newly added Portrait Set 0.

  • Organizer Type
    Select: Portrait
  • Sprite
    Select: portrait_wasp

Status Settings #

Our enemies don’t use a status development, i.e. they’ll have fixed status values. We’ll also set a level for them.

  • Start Level
    Set to 2.

Status Value Settings > Status Values #

Click on Set Default to add all Normal type status values with a default start value.

I’ll just list the status values and their start value here – i.e. you need to change the Start Value setting for each of the Initial Status Value settings.

  • Max HP
    Set to: 16
  • Max MP
    Set to: 10
  • ATK
    Set to: 6
  • DEF
    Set to: 5
  • MATK
    Set to: 1
  • MDEF
    Set to: 5
  • AGI
    Set to: 15
  • DEX
    Set to: 13

Status Value Settings > Experience Reward #

We’ll define the EXP the player receives when defeating this enemy here.

Click on Add Experience Reward.

  • Status Value
    Select: EXP
  • Reward Value
    Select: Value > Value
    Set the value to: 3

Attacks & Abilities > Ability Development #

We’ll add the Poison Attack to the combatant’s abilities.

Click on Add Ability.

  • Learn At Level
    Set to:; 1
    This is the level at which the ability will become available.
  • Ability
    Select: Poison Attack

Animations & Movement > Animations #

We’ll use different movement animations, since our wasp is flying.

Click on Add Animations.

  • Animations
    Select: Flying Movement

That’s it for our first enemy!

Snake #

The snake is similar to the wasp, just a bit stronger, using the ability more often and using different movement animations.

Copy the Wasp combatant and change the following settings.

Content Information #

  • Name
    Set to: Snake

Base Settings > Prefab Settings #

  • Prefab
    Select: Snake

UI Settings > Portraits #

  • Sprite
    Select: portrait_snake

Status Settings #

  • Start Level
    Set to 3.

Status Value Settings > Status Values #

I’ll just list the status values and their start value here – i.e. you need to change the Start Value setting for each of the Initial Status Value settings.

  • Max HP
    Set to: 35
  • Max MP
    Set to: 10
  • ATK
    Set to: 8
  • DEF
    Set to: 6
  • MATK
    Set to: 1
  • MDEF
    Set to: 8
  • AGI
    Set to: 8
  • DEX
    Set to: 12

Status Value Settings > Experience Reward #

  • Reward Value
    Set the value to: 4

Battle Settings > Battle AI #

We’ll override the default battle AI to use the 50% chance for using an ability.

  • Replace Default
    Enable this setting.
    This’ll replace the default battle AI of the general settings.
    Otherwise, the battle AI of the combatant will be used first, followed by the default battle AI (if no action was found or the battle AI is used in queue mode).

Click on Add Battle AI.

  • Battle AI
    Select Random Ability 50%.

Animations & Movement > Animations > Animation 0 #

  • Animations
    Select: Simple Movement

Combatant Groups #

Combatant groups can be used by battles, combatant spawners, etc. to create predefined groups.

We’ll set up a group with our two enemies – the group will have 2 of them, but each is randomly selected, so the group could be 2 wasps or 2 snakes, or 1 wasp and 1 snake.

Navigate to Combatants > Combatant Groups, we’ll change the Default group.

Base Settings #

  • Name
    Set to: Forest x2

Combatants > Combatant 0 #

This is the first combatant of the group.

  • Use Random Combatant
    Enable
    This’ll let us add multiple combatants for this group position, using 1 randomly.

Change the combatant of the already added Random Combatant 0.

  • Combatant
    Select: Wasp

Copy the random combatant and change the following setting.

  • Combatant
    Select: Snake

Combatants > Combatant 1 #

We’ll just copy Combatant 0, since we want to use the same setup for the 2nd combatant of the group.

No changes needed to the setup.

Save Changes #

And that’s it for now!

Save the changes using the Save Settings button at the bottom of the editor.

 

Next, we’ll set up our battle system.

Table of Contents
  • Battle AIs
    • 0: Random Ability 25%
      • Battle AI Settings
      • Chance
      • Ability
    • 1: Random Ability 50%
      • Battle AI Settings
      • Chance
    • 2: Random Ability 75%
      • Battle AI Settings
      • Chance
  • Combatants General Settings
    • AI Settings > Battle AI
  • Wasp
    • Content Information
    • Base Settings > Prefab Settings
    • UI Settings > Portraits
    • Status Settings
      • Status Value Settings > Status Values
      • Status Value Settings > Experience Reward
    • Attacks & Abilities > Ability Development
    • Animations & Movement > Animations
  • Snake
    • Content Information
    • Base Settings > Prefab Settings
    • UI Settings > Portraits
    • Status Settings
      • Status Value Settings > Status Values
      • Status Value Settings > Experience Reward
    • Battle Settings > Battle AI
    • Animations & Movement > Animations > Animation 0
  • Combatant Groups
    • Base Settings
    • Combatants > Combatant 0
    • Combatants > Combatant 1
  • Save Changes
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
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!