July 27, 2015 at 7:17 pm #114
Magic! Yes I know it is really early to be talking about something like this, but the differences between magic systems for the various Ultimas (notably between U9 and U7/U7SI) left me with a bit of a conundrum about writing up a system that would be adaptable for various magic systems without a major duplicate of effort. I believe I have come up with a design that might accomplish this goal and it meets the criteria Browncoat came up with.
- Predefined reagent-based, spellcasting with mana usage
- Customizable circles of spells
- Predefined rune-based spellcasting with mana usage
- Predefined and customizable item-based spellcasting (use item to cast spell, “proc” spells, etc)
Component One: A Directory of Spells
This directory would simply be a list of functions with each function being a general spell effect (eg heal, cure, fireball). Each function would have multiple arguments to allow for a high degree of modularity to reduce or eliminate the time spent rewriting spell code for your magic system.
Here are some examples:
Heal(<Percentage or value flag>, <amount to heal>, <self/target flag>, <attribute>, <attribute factor>) – the attribute arguments refer to how much of an impact an attribute like intelligence or magic has on the amount healed
Cure(<parameter for who is cured>) – the parameter here defines who should be cure with 0=self, 1=target, 2=party, 3=all allies in area
Light(<duration (sec)>, <Radius>, <Light reduction factor>, <attribute>, <attribute factor>) – note that for this example, the attribute factor would impact duration only
Fireball(<base damage>, <area of effect radius>, <radiant damage factor>, <Tracking flag>, <range>, <velocity>, <attribute>, <attribute factor>) – attribute would impact base damage
Since these are functions, you can easy have more than one spell use the same function but with different parameters. For instance, you could have a spell for cure target and one for cure all.
Component 2: Spellbook object:
This spellbook is a pre-fab object with a series of parameter rich properties that allows for a highly customizable arrangement of spells and adjustment of their requirements. It can also be duplicated allowing for more than one magic system within a game. This object would need its own GUMP to be written and directed to this object’s script, but the properties have a number of available parameters for use by the GUMP’s code for high customization of the spellbook appearance. The following list contains details about the properties.
* Each property is effectively a spell circle with a customizable name (you won’t need to use the term Circle).
* Each property contains entries for each spell.
* Each entry has many fields:
** UI fields: icon, display text, custom UI field (readable by your GUMP code)
** spell function with arguments (the user would need to look up the spell function to know what each argument is)
** “spell learned” flag – this is a runtime flag that is true when spellbook contains the spell; by default each new entry has this flag as false; setting to true within the pre-fab will result in all instances of this spellbook having that spell learned
** “Don’t show until learned” flag – By default, each spell won’t show unless the learned flag is true. If false, all of the spells show, but won’t be usable until the spell is learned
** user level required
** class required
** attribute and value required
** mana cost
** field pairs for object cost (Object Name/Quantity) – can add any number of field pairs
** custom learn field (a field usable by your own learn spell script like the spell binding ritual)
Component 3: Simple Spell objects:
An empty scroll pre-fab is another component included in this system. It is very simple and contains only a few property fields. It is quite possible to adapt this pre-fab for certain Ultima 8 component spell components. For instance, Necromancy talismans and Theurgy foci are essentially infinite, single-spell scrolls with a different model that you either create via separate objects and scripts or obtain via conversation scripts (including the charging at the altar). Sorcery would be too complicated for this simple object.
* Spell function with arguments; it will still check for character attribute if one is given in the argument.
* Number of uses. The default value is one. There is a flag here for infinite uses as well.
* Character requirements for spell usage
* Plot variable requirementJuly 29, 2015 at 9:25 pm #119
I think developing basic spell effects (as it seems you’re describing) is a good groundwork. From that someone could make a spell book that was similar to the circles of magic in Britannia, the various magic types in Pagan, New Britannia, etc.
A first step (that I might be able to assist with) might be to go through all those target spells we may eventually want to be able to emulate for projects and compile a list of necessary effects.August 1, 2015 at 3:08 pm #131
That would be good, I’ve already got a list started:
Flags: Percent or Raw Value, Self/Target/Party/Allies in Area
Arguments: Amount to Heal, Attribute, Attribute Factor, Area effect radius (applicable for Party or Allies setting)
Flags: Self/Target/Party/Allies within radius
Arguments: Area effect radius (applicable for Party or Allies setting)
Flags: Attribute affects Duration, Attribute affects Radius
Arguments: Duration, Radius, Spherical Light Gradient (defines how sharply the light decreases), Attribute, Attribute Factor1, Attribute Factor2
Spell: Magic Missile
Arguments: Base Damage, Range, Attribute, Attribute Factor (affects damage)
Arguments: Base Damage, Area of Effect Radius, Radiant Damage Factor (affects damage gradient), Range, Attribute, Attribute Factor (affects base and area of effect damage)
- This reply was modified 2 years ago by Iceblade.
You must be logged in to reply to this topic.