Devlog Update 2.4: Magic system


Hi! I’m the junior developer for Sigil.

I was tasked with implementing the magic system.  I have little experience with developing using blueprints, and about the same working in Unreal Engine 4, so tag along on this journey of learning.

Since I learned how to code, I’ve been fascinated with implementing a magic system with runes and interchangeable spells (Similar to Noita, if you’ve ever played it). I started this project looking to implement something similar to enable divergent gameplay but quickly hit obstacles with my own understanding of Unreal Engine 4.

To keep progress towards tight deadlines, I rescoped just a little bit, and went with Skyrim-esque spells; a selection the player can cast, each with vaguely unique trade-offs between benefits and costs.

Most adventure-survival-based games have intuitive and aesthetic UIs, allowing the player to focus on the game and maintain their immersion.  To incorporate this, I started work on a radial menu system.  Due to some poor programming on my part, there were many issues and I scrapped progress to simplify designs and meet deadlines.


As it turns out, simplifying a design is almost always a good idea; the resulting UI is minimal, thematically appropriate, and intuitive.  In the refined design, the magic selection is handled the same way as the player’s hotbar -- though spells are selected with the number keys 1-3 as opposed to the mouse wheel.

Actually casting magic

Appropriated UI aside, it was time to move on to the casting aspect of our magic system.  Our design team proposed 3 fundamental spell types; a projectile, a circle, and a beam attack. Each casting type could be used for healing or damaging players or enemies.  Designing particle effects for the spells was simple; I passed it off to an artist and marvelled at the work produced.

Summoning magic is a fairly simple process, outlined below:

  1. Take the currently selected spell and pass it to the magic component on the player character
  2. If the player has enough mana to cast the spell, allow the spell to be cast and deduct mana
  3. Determine the spell’s casting type, and branch into projectile, circle, or beam summoning
    1. Projectile:
      1. Spawn the particle effect inside the camera, with a projectile motion component attached to it.
      2. Let it fly, and process OnCollission event data based on healing or damaging projectile
    2. Circle
      1. Find the player’s feet, and spawn the dynamic texture | particle system about 12cm above the ground
        1. This uses world normal, so things look funky on sloped terrain
      2. Let the circle appear, and then cast a radial damage effect with tags based on healing or damaging circle
    3. Beam
      1. Find the player’s hand socket, which is used for tools. If there’s a tool in the hand socket, gently remove it before casting the beam effect
      2. Send a sphere trace along the beam effect to see if the player hit anything, and process hit information based on damage or healing beam
  4. Once the spell has been cast, we enter a cooldown period. This period stops the player from spam healing themselves, or stacking projectiles to insta-kill enemies
  5. Once off cooldown, allow spells to be cast again

Playtesting, and why getting strangers to test is crucial

While playtesting internally, we discovered a few bugs; the damage of the spark-ball projectile was enough to kill any early game enemies instantly, and if you left the healing circle you couldn’t be healed by it again.

While playtesting with strangers, we discovered issues with UI selection not notifying having the correct spell selected, the magic bar not decreasing if spells were cast while the inventory was open, and healing allies working if they were even slightly out of sight -- you could heal around walls.

Thanks for the read, catch you next time on some magic system updates!

Get Sigil

Leave a comment

Log in with itch.io to leave a comment.