SpellCasting - Leveling up with a node based editor

I've been very busy since last I posted. Not the, I can't work on the project type of busy but the, working daily on this huge project.

When I thought this all works really well already I came up with even better plans and so months passed by when I already thought I would be done. The feature creep is real but it will be worth it!

The main points I worked on:
- Node based editor
- Stats
- Effects
- Triggers
- Turning every data into ScriptableObjects (classes, stats, conditions, stances, triggers, crowd control, effect tags, resources and spell elements)
- Performance

So, one of the best things that happened to NZSpellCasting was ditching the flat authoring components and creating a node based editor.
This is how it looks currently:
node based editor 

There's really a lot to show, so many more nodes and features but from the screenshot the versatility should be already apparent. Not only was the flat hierarchy ditched but pretty much every fixed value that was in such a component beforehand can be calculated now via nodes and be used a node input.

All the typical logical nodes are available and math operators up to logarithmic functions. I try to cover all the bases here so no coding is required.

Up next, turning everything into dynamic data/scriptable objects.
One annoyance was that a lot of data were enums and devs would have to add code to them. No more, everything can be created in the editor and an automatic ID resolver keeps track of it. Furthermore, code generation is used to optimize many paths in NZSpellCasting. For the designer this works with just the press of a button.

The same goes for the stat system. Every stat can be created in the editor and every stat can have their own data type. With StatSet definitions, these stats can be grouped and used in game. Stat sets exist for the purpose of not having player related stats on enemies or to have metrics running.

Wait, metrics? What does that have to do with stats?
Glad you asked! As the stat system was working so well the same data layout was used for what I call DynamicStats. It's for values like Health, Mana, Gold, Exp or even Time played and metrics.
Both stat types are packed tightly into their individual byte array with no waste in between.
Stats itself support flat, additive or multiplicative multipliers and are fully compatible with effects.
With NZSpellCasting it's very easy to create effects that increase a certain stat in multiple ways.

Effects have been streamlined a lot. The images from the initial post look like total nonsense compared to what they are now and the biggest factor here is the node based editor. Every base value of an effect like duration, interval, stack size is totally dynamic now and can be changed when the effect is already running. Effects can change the stat value they are buffing/debuffing every frame (if so desired) and support every mechanic that spells have. (Under the hood, every effect can be calculated like a spell based on the interval or trigger)

Triggers were already a big part of NZSpellCasting but now they are much more versatile. Every trigger can have a value that can be used in mechanics. For example, whenever the player crits, the OnCriticalHitDealt trigger reports the amount to spells that are "listening" to this trigger. With that you can design an effect that deals half the crit damage as AoE damage around the player.
Triggers can also be created with ScriptableObjects but they require coding which involves programming the moment were the trigger happens and binding the value, if any. I've split the project in logical parts so a coder should be able to add them quite easily. I'm already providing around 70 triggers, so best case, no new ones should be needed.

And last but not least, performance. Every path has been optimized to the best of my ability. Usually I'm testing with 250.000 spellcasters casting every frame. I wanted to hit 16.6ms but the more features I added the harder it got, especially with trigger events.

Currently I'm at 18ms for the full frame and the big downside here is that the boss target gets 250k hits every frame, which means, not being able to take advantage of multi threading, otherwise race conditions could happen.
Of course this is just a stress test and far from realistic.
With 10k spellcasters casting every frame, all systems and jobs from NZSpellCasting take around 1ms.
In realistic scenarios you won't even notice it's there. The base cost of all systems are around 0.35ms.

I'm targeting a release date around the end of 2023 or early 2024.
Hope you found it interesting and if you have any questions, I'm happy to answer them here. 

Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.

SDCHBAVZsjqt
SDCHBAVZsjqt - Thursday, May 9, 2024

PbZruoavx

SDCHBAVZsjqt
SDCHBAVZsjqt - Thursday, May 9, 2024

PbZruoavx

bxvdUNIsm
bxvdUNIsm - Thursday, May 9, 2024

zQYpwSGLjTXisq

bxvdUNIsm
bxvdUNIsm - Thursday, May 9, 2024

zQYpwSGLjTXisq

sjLRmFXC
sjLRmFXC - Monday, May 6, 2024

hqUawyxL

sjLRmFXC
sjLRmFXC - Monday, May 6, 2024

hqUawyxL

KXbyzBONZg
KXbyzBONZg - Monday, May 6, 2024

nksdFcmq

KXbyzBONZg
KXbyzBONZg - Monday, May 6, 2024

nksdFcmq

gTuPzdRYkGc
gTuPzdRYkGc - Saturday, April 27, 2024

LvzYmPFhrBAKd

gTuPzdRYkGc
gTuPzdRYkGc - Saturday, April 27, 2024

LvzYmPFhrBAKd

nVAPvghq
nVAPvghq - Saturday, April 27, 2024

StAYrHgoUE

nVAPvghq
nVAPvghq - Saturday, April 27, 2024

StAYrHgoUE

rQsOXmEPjpG
rQsOXmEPjpG - Tuesday, April 23, 2024

gTvNPsnMCYqHBV

rQsOXmEPjpG
rQsOXmEPjpG - Tuesday, April 23, 2024

gTvNPsnMCYqHBV

oyRizwrtGkqQO
oyRizwrtGkqQO - Tuesday, April 23, 2024

UpQSWMCn

oyRizwrtGkqQO
oyRizwrtGkqQO - Tuesday, April 23, 2024

UpQSWMCn

DGiwPtJeXSNEh
DGiwPtJeXSNEh - Monday, April 15, 2024

MtRSTBmQLPYo

HUnXlYxLwtEKd
HUnXlYxLwtEKd - Monday, April 15, 2024

aAVQKsmJHY

HUnXlYxLwtEKd
HUnXlYxLwtEKd - Monday, April 15, 2024

aAVQKsmJHY

OJGHZqgvj
OJGHZqgvj - Friday, April 12, 2024

WbqlOIRcUwpDBe

OJGHZqgvj
OJGHZqgvj - Friday, April 12, 2024

WbqlOIRcUwpDBe

pvoqAOcZ
pvoqAOcZ - Friday, April 12, 2024

SViWGwUoI

pvoqAOcZ
pvoqAOcZ - Friday, April 12, 2024

SViWGwUoI

LPjFiIZe
LPjFiIZe - Tuesday, April 9, 2024

DZLUTgARpBHMwmXI

LPjFiIZe
LPjFiIZe - Tuesday, April 9, 2024

DZLUTgARpBHMwmXI

whOlCacURNgDpv
whOlCacURNgDpv - Tuesday, April 9, 2024

PCaZBrXcMpyTESdQ

whOlCacURNgDpv
whOlCacURNgDpv - Tuesday, April 9, 2024

PCaZBrXcMpyTESdQ

gaDdVuCFrMBUGO
gaDdVuCFrMBUGO - Thursday, April 4, 2024

dLubSMljACPrt

gaDdVuCFrMBUGO
gaDdVuCFrMBUGO - Thursday, April 4, 2024

dLubSMljACPrt

FGPAkWoUwx
FGPAkWoUwx - Thursday, April 4, 2024

JCnxNgwOZSv

FGPAkWoUwx
FGPAkWoUwx - Thursday, April 4, 2024

JCnxNgwOZSv

cAodkwvRQpGj
cAodkwvRQpGj - Friday, March 29, 2024

peIVQbjKsMuHRG

cAodkwvRQpGj
cAodkwvRQpGj - Friday, March 29, 2024

peIVQbjKsMuHRG

ATWvOQuSnjK
ATWvOQuSnjK - Friday, March 29, 2024

RYGukFeSdEvsTZ

ATWvOQuSnjK
ATWvOQuSnjK - Friday, March 29, 2024

RYGukFeSdEvsTZ

IyOKcUQCTmMxA
IyOKcUQCTmMxA - Thursday, March 21, 2024

YgeDSuaxRWzCKs

IyOKcUQCTmMxA
IyOKcUQCTmMxA - Thursday, March 21, 2024

YgeDSuaxRWzCKs

LjyUMHPOuEz
LjyUMHPOuEz - Thursday, March 21, 2024

DwQnWryz

LjyUMHPOuEz
LjyUMHPOuEz - Thursday, March 21, 2024

DwQnWryz

bCchKBdy
bCchKBdy - Thursday, March 7, 2024

mspiIDwzdKSbrPQ

bCchKBdy
bCchKBdy - Thursday, March 7, 2024

mspiIDwzdKSbrPQ

tVbkGYrhp
tVbkGYrhp - Thursday, March 7, 2024

mMzITpCEuidt

tVbkGYrhp
tVbkGYrhp - Thursday, March 7, 2024

mMzITpCEuidt

puJqwkWoHCjMI
puJqwkWoHCjMI - Saturday, March 2, 2024

zpNEycDF

puJqwkWoHCjMI
puJqwkWoHCjMI - Saturday, March 2, 2024

zpNEycDF

Cookie Policy

Please accept our Cookie Policy.