Skip to content

Manuals

hskim edited this page Jan 17, 2022 · 15 revisions

Sorting Layer

NineChronicles GameObjects are sorted based on the Sorting Layer.

NineChronicles sorting layer list

  • InGameBackground
  • InGameBackgroundVFX
  • Character
  • CharacterVFX
  • InGameForeground
  • InGameForegroundVFX
  • UI
  • VFX
  • SystemUI

UI

UI is managed by Canvas in Game.unity scene. UI uses two sorting layers, and there are detailed layers below them.

Sorting Layer - UI

Name Order
Hud 0
Widget 10
StaticLayer 20
Popup 30
Animation 40
Tooltip 50
TutorialMask 60
Screen 70

Sorting Layer - SystemUI

Name Order
System 0
Development 10

Widget

UI is managed with widget. A widget belongs to a layer with the same name as the WidgetType.

WidgetType Layer Name Sorting Layer
Hud Hud UI
Widget Widget UI
StaticLayer StaticLayer UI
Popup Popup UI
Animation Animation UI
Tooltip Tooltip UI
TutorialMask TutorialMask UI
Screen Screen UI
System System SystemUI
Development Development SystemUI

UI Prefab

UI prefabs have UI_ prefixed. Add 'type' to the suffix to the object that inherited Widget. (e.g : WidgetType - Popup -> UI_HelpPopup)

Damage formula

How to calculate damage in battle

Damage = (playerATK + equipmentATK + SkillPower - targetDef) * comboRatio * elementalRatio * CriticalRatio

+---------------------------------------------------------+
| Total Damage = Player ATK + Equipment ATK + Skill Power |
+----------------------------+----------------------------+
                             |
                             v
+---------------------------------------------------------+
|             Damage = Total Damage - Target DEF          |
+----------------------------+----------------------------+
                             |
                             v
+----------------------------------------------------------+
|         Damage *= Combo Ratio (ComboCount * 100%)        |
+----------------------------+-----------------------------+
                             |
                             v
+----------------------------------------------------------+
|             Damage *= Elemental Ratio (120%)             |
+----------------------------+-----------------------------+
                             |
                             v
+----------------------------------------------------------+
|             Damage *= Critical Ratio (150%)              |
+----------------------------+-----------------------------+
                             |
                             v
+----------------------------------------------------------+
|                       D a m a g e                        |
+----------------------------------------------------------+	

Related links

Skill

How the skills actually selected in Nine Chronicles

+---------------------+
|      Get skills     |
|   with 0 cooldown   |  ** default attack skill cooldown is always 0
|                     |  
+---------------------+
          |
          |
          V
/---------------------\       +---------------------+
|      Have only      |  Yes  |         Use         |
|   default attack    | ----> |   default attack    |
|        skill?       |       |        skill        |
\---------------------/       +---------------------+
          |
          | No
          V
+---------------------+
|    Sum chance of    |  e.g., Skill A - chance 50%
|      all skills     |        Skill B - chance 30%
| call it 'sumChance' |        Sum : 80% = 50%(Skill A) + 30%(Skill B)
+---------------------+
          |
          |
          V
/---------------------\       +---------------------+
| random > sumChance  |  Yes  |         Use         |
| random range:       | ----> |   default attack    |
| 0 ~ (sumChance - 1) |       |        skill        |
\---------------------/       +---------------------+
          |
          | No
          V
+---------------------+
|       Select        |  ** Use WeightedSelector to select skills.
|    skill based on   |     WeightedSelector decisions based on
|    weight(chance)   |     each choice's proportion of the total weight.
+---------------------+
          |
          | Yes
          V
+---------------------+
|         Use         |
|    selected skill   |
|        skill        |
+---------------------+
  • Cooldown gets value from SkillSheet
  • Power and Chance gets value from item
  • How to access buff data.
    1. Take the skill id and find the matching buffer id on the SkillBuffSheet
    2. Find the data in the BuffSheet with the buff id
  • Duration gets modify_type from BuffSheet

Tutorial

In the tutorial, the scenario is called recursively, and when the play id does not exist, stop is called. Tutorial trigger conditions are managed by TutorialController. Tutorial execution is managed in Tutorial.

Flow

 ┌────────┐
 │play()  │
 │id:1    │
 │nextId:2│
 └───┬────┘
 ┌───▼────┐
 │play()  │
 │id:2    │
 │nextId:3│
 └───┬────┘
 ┌───▼────┐
 │play()  │
 │id:4    │
 │nextId:?│
 └───┬────┘
 ┌───▼────┐
 │Stop()  │
 └────────┘

Data

Prefabs

Clone this wiki locally