In order to achieve my goal of creating spell assets entirely with data, I am going to need an array of powerful generic effects that can cover the design space with just numerical tweaks. The first thing I did this sprint was sit down and refine the spells in my design document into their component game effects, and come up with the set of generic effects I would need to cover the whole design space.
For Targeting spells, I decided would need options for:
A cool realization I made while planning out the code I needed to write was that line targeting was just a special case of cone targeting, with an arc width of zero. But an even cooler realization I made was that I shouldn't force designers to remember that whenever they wanted to use a line targeting scheme. No matter how "cool" something is mathematically, I'd be better off if I prioritized clarity in the interface above all. Here is how these three look in use:
I sat down and gave spell effects the same treatment as targeters, and realized there's only a few types of things that the spells I designed actually do:
Let's take the damage dealing effect as an example:
UCLASS(EditInlineNew, BlueprintType, Blueprintable)
class HEXHEXHEX_API USpellEffectDef : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
TSubclassOf<ASpellEffectBase> EffectType;
};
UCLASS()
class HEXHEXHEX_API UDamageEffectDef : public USpellEffectDef
{
GENERATED_BODY()
public:
UPROPERTY(Instanced, BlueprintReadWrite, EditDefaultsOnly)
UDamageBlob* Damage;
};
This header exposes a Damage Blob object, which a designer can configure to apply a damage instance to every actor in the spell's target list. Here's how it looks in the editor:
One of the really nice things this allows me to do is string together different effects by specifying the spell's effects as an array of SpellEffectDefs. I can add a DamageEffectDef and a DebuffEffectDef to a spell to make it deal damage and apply a debuff, with no scripting required!
With as much as I got done on the spell data asset system this sprint, there's still more work needed in this area to make it something I'd be super happy handing off to a designer: