Skip to content

Adding New Spell

Reinisch edited this page Nov 5, 2019 · 2 revisions

This is a step-by-step guide on how to add a new spell to the game.

All game settings are implemented with Scriptable Objects, this allows easy modifications at runtime even on server with connected players. The only downside is requirement to write custom editors with filters when there are way too many of similar settings i. e. 100000 spells.

Assets and scriptable objects can be created anywhere in the project by right clicking any folder or file in Project Window and selecting any asset in Create menu item. Menu paths for these objects are specified by attribute CreateAssetMenu on asset's class. For example to create SpellInfo select Create/GameData/Spells/SpellInfo in asset menu.

Creating Spell Info

  • Navigate to Assets/Settings/Balance/Spells and optionally create new folder for your spell
  • Create new Spell Info through asset context menu Create/GameData/Spells/SpellInfo
  • Create any new Spell Effect Info for Spell Info through asset menu Create/GameData/Spells/Effects/...
  • Add new Spell Effect Info asset to list Spell Info "Spell Effect Infos"
  • Rename Spell Info as "[Spell Name] Spell", for Frost Bolt: "Frost Bolt Spell"
  • Rename Spell Effect Info as "[Spell Name] Effect [Spell Effect]", for Frost Bolt damage: "Frost Bolt Effect Damage"
  • Configure Spell Info and Spell Effects properties
  • Select your Effect assets then drag and drop Spell Asset into last field and press add to parent

Spells should have at least one Spell Effect to work properly. There is currently no limit for effect amount.

That's it! New spell is created, it should automatically add itself to game balance containers, and self-assign new id. However this is only meta data, to be properly handled on client it requires Visual Effect Info, Sound Info and Tooltip Info, spell should also be added to Class Info to allow casting only for certain class.

Creating Visual Spell Info

  • Navigate to Assets/Settings/Visuals/Effect Visuals Spell
  • Create new Spell Effect Settings through asset context menu Create/GameData/Visuals/SpellEffectSettings
  • Instead of creating new, already existing assets can be duplicated by selecting and pressing Ctrl+D
  • Rename new asset as "Spell Effect Settings - [Spell Name]", for Frost Bolt: "Spell Effect Settings - Frost Bolt"
  • Configure Spell Effect Settings properties
  • Select Rendering Reference asset at Assets/Settings/References, right click in inspector and press Collect All in context menu

Creating Spell Sound Info

  • Navigate to Assets/Settings/Sound/Settings/Spell Sound Settings
  • Copy existing or create new Spell Sound Settings in menu Create/GameData/Sound/SpellSoundSettings
  • Configure properties then Select Sound Reference and press Collect in Inspector context menu
  • Spell Sound Entries are created like other settings by copy or asset menu

Creating Tooltip Info

  • Navigate to Assets/Settings/Localization/Tooltips/Spell
  • Copy existing or create new Spell Tooltip Info in menu Create/GameData/Tooltips/SpellTooltipInfo
  • Configure properties, new tooltip should automatically add itself to game settings
  • New Localized Strings for descriptions and names are created like other settings by copying or asset menu
  • Localized data may be modified in Resources/Languages/English
  • Select English prefab, right click on Component Localized Language add select Populate Missing Strings
  • After adding localization, select other languages and select in component context Populate Empty From English

Updating Class Info

  • Navigate to Assets/Settings/Balance/Classes/
  • Select any Class Info and add your new Spell to the list Class Spells

Update Photon Bolt Version

To avoid other players with different spells or other conflicting data from joining your game Photon Bolt Version can be incremented here.

Clone this wiki locally