Engines NIFE Roadmap Shatterloop Game Projects
Deprecated Saepes Mundi Other Projects Blog

Shatterloop

Magic v1 Brainstorming

Posted July 9, 2022 by Xhin

This post will aggregate actual magical effects. The point of the Magic v0 post is getting the basic systems and fixtures in place, while the purpose of this post is building out the actual magical effects.

Page 1

  • Technical Mechanisms
  • Jewelry Obect Breakdown

    Last Update: 4/30/2024

  • There are 2 Replies


    Technical Mechanisms

    Magic

    The mechanism behind magic working is the fact that virtually every system in the game works on objects. These should be programmed to run through the magic hook to alter them before they get rendered -- this would drastically simplify the technical issues with this project and allow me to add magic over time rather than scrap the system and start over.

    I should therefore scrap the Buffs system in favor of these hooks and a NIFE-like Auras system that attaches breakable effects to entities and then the single hook parses them out, along with whatever other systems I want to splice in.

    The Auras system would then get UI support somewhere to list active effects, with the most important ones appearing in the stats screen or as icons or something.

    Auras

    This is a framework change that makes all effects easier to manage. It's based on the NIFE Auras system.

  • All effects get stored as auras{} data, tagged appropriately. They also affect props directly, though they indicate somewhere that it has been altered (with a reference back to the aura datapoint).

  • The effects also store an event that runs their inverse - so like an effect that raises base mount animal speed will have an event that lowers it by the same amount.

  • The buffs system, potions system, and magic system will make use of this system -- running the stored event when the effect expires or is manually removed.

  • This system would also make enchantments possible. Potions and magic should really be different versions of the same thing -- temp effects that are done in different ways. However enchantments would be permanent, with the disenchant effect running the stored aura function.

  • Stored aura functions should have failsafes in case the entity no longer exists.

  • This system doesn't actually require storage on the entities in question, it adjusts their values directly and the events are stored as events internally.

  • July 9, 2022
    Xhin
    Sky's the limit

    Jewelry Object breakdown

    Thus post will have a breakdown of the stats in a Jewelry object so I can better define and program it.

  • Spell -- Each Jewelry item can have exactly one spell, unlike Enchantments or Potions which can have a variety. Spells are either Global or Targeted -- global spells turn into Scrolls while targeted spells turn into Wands.

  • Spell property key -- Spells affect objects in the game, so you have to actually target one of those. In the UI this is probably part of the spell name rather than free-floating but I need this from a technical perspective.

  • Entity Category -- if a spell is targeted, this narrows down what it can actually affect. If it's an item, it uses the ifilter{} framework but the actual deployment is probably pretty simple and based on the spell effect rather than being more proven (though I like the idea of those spells also existing).

  • Magnitude 1-4 -- the actual value of the spell effect. There are four slots available here depending on what the spell actually does (probably only one or two will actually be used ever). Maybe I can rename or categorize these better when there's a more concrete spell list.

  • Duration -- most spells are transient but there can also be more permanent effects. I don't want to overlap with Potions or Enchantments too much but it does make sense that spells could work either way, tying into the auras{} system accordingly.

  • Cost / Finick -- cost is a variety of deleterious effects when the spell is cast,, while Finick are effects (probably chance-based) that affect the spell output. Magic is a bit finicky to work with early on so it's worth spending starshards to cut these down first. Crystallizer magic won't have these applied, but loot always will badly, with crafted jewelry being somewhere in the middle.

  • Mana -- Jewelry costs mana to use. As you upgrade it, this cost goes up but can be brought down with potion effects or magic upgrading that targets it.

    Jewelry Examples

    Magic affects every single system in the game, however I do need specific examples to flesh this system out. So here are some:

  • Random Terco R -- makes resource tiles in R range switch to a random terco rather than their existing one. Here R is the Magnitude.

  • Clone item T -- clones an item of the specified type. Cannot affect Jewelry (because of self-ramping) or Potions (because potions affect Jewelry, not the other way around). Also can't affect key items. Can definitely clone enchanted items, which gets interesting.

  • Shop Selection A -- adds more items that a shopkeeper will sell. This might be a targeted thing or more rarely is a more global effect with probably a balance with Duration permanence. A here is the actual amount buff.

  • Free Galloping -- targets a summoned Mount and makes their galloping free for whatever the duration is.

  • Lock Shortening A -- makes a lockpicking puzzle less complex by A. I have no idea how the targeting system would work here since that's its own separate menu system. See, this is why I need to work on magic early on.

  • July 9, 2022
    Xhin
    Sky's the limit

    Reply to: Magic v1 Brainstorming

    Username
    Password