New Flexible Spell, Effects, Status System Discussion

Any ideas or suggestions for improving the IB2 engine

New Flexible Spell, Effects, Status System Discussion

Postby slowdive » Sat Dec 26, 2015 3:59 am

Typing up my thoughts here as I think through the process for future coding reference:

So I think Karl's suggestion for handling component based spells/special abilities is the way to go for the future system change.

Carrier:A means to transfer effects (see below) on a target. Carriers can be melee attacks, spells, ranged attacks, used items... The carriers have different ranges, hit chances, eligible targets (pc, creature, in friendly, ally or all variants, single square, area of various shapes). When pressing the button associated with the carrier (attack, cast, use item) the target selection is started, following the rules for this carrier.

Effect: A component of a carrier. Simplest component is direct damage, like d8 for long sword (this type of simple effect will probably not need an effect object and can continue to use the properties in the Item class). An additonal component might be the application of a status to target (like bleeding or poisoned). It might be healing, it might be change position x,y of target, etc. Again, a carrier can carry many of these effects at the same time. Each effect allows for saving throw and resistance individually (or do not grant such rolls). These rolls prevent the application of the effect.

I will add many new properties to the Effect class and effects will be used for both instantaneous and duration type effects. Spells will basically reference one of these effects to handle any effect that doesn't need a custom script. So the Spell, Item, Combat Prop Square, creature attack, etc. will handle the selecting of targets and attack roll if needed and then they will reference an effect which will make DC checks and then apply damage, healing, buff, debuff, etc. Items will gain a new property called ApplyEffectList which will be a list of effects to apply upon a successful hit or use of an item to the targets selected. Creatures will gain a property called ApplyEffectList which will work the same as an item. Spells will gain a property called SpellEffectList with a list of effects to apply. Similar property will be added to combat props (don't exist just yet).

I was think for Effect class to add a UI element to the Effect editor for something like this (for damage types):
Attack: _d_+_ for every _ levels after level _ up to _ levels total
_ of these attacks for every _ levels after level _ up to _ attacks total

so a mage bolt spell would use: 1d4+1 for every 0 levels after level 0 up to 0 levels total
1 of these attacks for every 2 levels after level 1 up to 99 attacks total

and a fireball would use: 1d6+0 for every 1 levels after level 0 up to 10 levels total
1 of these attacks for every 0 levels after level 0 up to 1 attacks total

As far as the Player and Creature Status property, I think we will still use a simple enumeration of Alive (can do all types of actions), Dead (represents both dead and unconscious), Immobile (can't move but can do other actions), Held (can't move or do any actions). These basic enums are used for checks on determining what a Player and Creature can do (maybe add Ignored for stealth or invisible and Silenced or such). I guess these determinations could be gathered from a list of Statuses on the PC or creature as Karl suggested, that would probably make more sense.

Thoughts? Will be fun to code all of this, but in the end it should be a flexible system and easy/simple for all builders to use. Plus it should result in less and cleaner code in the long run which is always a plus :lol:
User avatar
slowdive
Site Admin
Site Admin
 
Posts: 2891
Joined: Wed Nov 21, 2012 11:58 pm

Re: New Flexible Spell, Effects, Status System Discussion

Postby youngneil1 » Sat Dec 26, 2015 10:37 am

Absolutely great! This will be such a great step at the core of the rule mechanics, kicks open all kinds of doors for customized campaigns :D !

Love every single detail you described there, especially great idea about how you define the damage based on level of user.

As you tackle this, what about usable traits as carriers? Likely a copy& paste the spell system (with a different label for the button), but allowing non-spell casters to do more than simple attacks? Fighters will play more strategically if they can dish out special moves every few rounds (shoot a bleeding arrow, try to stun with a special blow, push an opponent two squares away, sacrifice HP in order to buff themselves with attack boni in the next three rounds, etc.).

The cost for trait usage could be SP, too (might leave SP unlabeled or allow a user defined label, like Stamina Points). Or have a system of cool downs for trait usage, so a trait can only be reused after x-rounds or once, twice.. a battle. Would differentiate them then by more than label/name from spells.

A few additional properties of carriers might therefore be: usable every x rounds, usable x times in battle, cost in HP (as well as already existing cost in SP) and mayhaps rounds needed for application (for e.g. spells that take three rounds to cast).

With the tight list of stati, the other possible long lasting effects (poisoned, bleeding, etc.) will be treated as effects on the creature/pc/square, but not as status change per se. That's fine! So stati are determining the amount of action and movement a character can take, easy to remember. Multiple stati at the same time indeed make sense for e.g. webbed characters that become unconscious. A heal would then remove unconscious (untechnical Dead), but not the Held or Immobile.

We will benefit so much from this work in the long run, really looking forward to it.
User avatar
youngneil1
Backer
Backer
 
Posts: 4541
Joined: Sat Dec 08, 2012 7:51 am

Re: New Flexible Spell, Effects, Status System Discussion

Postby slowdive » Sat Dec 26, 2015 2:52 pm

Effect Properties (ideas for new ones...will update with suggestions):
bool instantaneous = false; //this determines if the effect is either an instantaneous and permanent effect (damage, heal, etc.) or a duration effect which can be permanent (poison) or temporary (AC bonus, held)

//* = marks properties that only work on PCs, not Creatures
//The below modifiers will be cumulative over each round of the Effects duration if "usedForUpdateStats" = false
//if you want the effect to be cumulative such as damage per round due to poison, set usedForUpdateStats = false
//if you want the effect to NOT be cumulative such as AC bonus, set usedForUpdateStats = true

//DAMAGE (hp)
-damType //Normal,Acid,Cold,Electricity,Fire,Magic,Poison
//(for reference) Attack: AdB+C for every D levels after level E up to F levels total
-damNumOfDice //(A)how many dice to roll
-damDie //(B)type of die to roll such as 4 sided or 10 sided, etc.
-damAdder //(C)integer adder to total damage such as the "1" in 2d4+1
-damAttacksEveryNLevels //(D)
-damAttacksAfterLevelN //(E)
-damAttacksUpToNLevelsTotal //(F)
//(for reference) NumOfAttacks: A of these attacks for every B levels after level C up to D attacks total
-damNumberOfAttacks //(A)
-damNumberOfAttacksForEveryNLevels //(B)
-damNumberOfAttacksAfterLevelN //(C)
-damNumberOfAttacksUpToNAttacksTotal //(D)

//HEAL (hp)
-healType //Organic (living things), NonOrganic (robots, constructs)
//(for reference) HealActions: AdB+C for every D levels after level E up to F levels total
-healNumOfDice //(A)how many dice to roll
-healDie //(B)type of die to roll such as 4 sided or 10 sided, etc.
-healAdder //(C)integer adder to total damage such as the "1" in 2d4+1
-healActionsEveryNLevels //(D)
-healActionsAfterLevelN //(E)
-healActionsUpToNLevelsTotal //(F)
//(for reference) NumOfHealActions: A of these attacks for every B levels after level C up to D attacks total
-healNumberOfActions //(A)
-healNumberOfActionsForEveryNLevels //(B)
-healNumberOfActionsAfterLevelN //(C)
-healNumberOfActionsUpToNActionsTotal //(D)

-addStatusType //Alive, Dead, Held, Immobile, Invisible, Silenced, Poisoned, etc.
-modifyFortitude
-modifyWill
-modifyReflex
-*modifyStr
-*modifyDex
-*modifyInt
-*modifyCha
-*modifyCon
-*modifyWis
-*modifyLuk
-modifyAC
-modifyBAB //for Creatures modifies cr_att, for PCs modifies baseAttBonus
-modifyMoveDistance
-modifyHpMax
-modifySpMax
-modifySp
-modifyDamageTypeResistanceAcid
-modifyDamageTypeResistanceCold
-modifyDamageTypeResistanceNormal
-modifyDamageTypeResistanceElectricity
-modifyDamageTypeResistanceFire
-modifyDamageTypeResistanceMagic
-modifyDamageTypeResistancePoison
User avatar
slowdive
Site Admin
Site Admin
 
Posts: 2891
Joined: Wed Nov 21, 2012 11:58 pm

Re: New Flexible Spell, Effects, Status System Discussion

Postby youngneil1 » Sun Dec 27, 2015 9:22 am

Very comprehensive already, impressive work :) !

Suggestions for mire modifiable (buff/debuff, instaneous or with duration, cumulative or not);
1. Initiative
2. Stea(l)th state (a bool then)
3. Roll for specific traits (more difficult I guess)
4. Damage adder
5. Number of attacks
6. Damage type (e.g. add fire quality, like flaming)
7. Attack range
User avatar
youngneil1
Backer
Backer
 
Posts: 4541
Joined: Sat Dec 08, 2012 7:51 am

Re: New Flexible Spell, Effects, Status System Discussion

Postby youngneil1 » Fri Jan 15, 2016 3:46 pm

Cut from the daily blog cause it fits better here:

Being me, I thought about additional stuff (feel free to just ignore, more than happy with the upcoming system already):

1. So far, our carrier for spell is an active one (attack/cast spell/use item). Like the script hook sytem, mayhaps we could extend the spell system to passive carriers, too: 1) being hit, 2) on death 3) on start of turn and 4) on every step. In all four cases the spell (and its effects) will be directed at the position of the pc/cretaure that the effect is assigned, too. So, it either affects that pc/creature or an area whose center/start calculation point is at the position of the pc/creature. Would open up all kinds of neat stuff, from critters exploding on death to damaging auras that damage attackers (or everyone) surrounding the hit creature/pc. On every step might be used for spells restricting movement with e.g. damage per step or chance to stun for a round per step (trip effect). Besides the optiond described below (imbue with spell...) spells might be hooked to these four carriers in the toolset like scripts to script hooks right now.

2. How about a new spell type, kind of meta spell (talking about a spell that grants a spell): "Imbue with spell". This one will grant the target creature (in combat) a tempoarary additional spell on attack or the target pc's equipped main weapon a temporary addiitional spell on attack (in- or outside combat). Such spell type would e.g. allow for spells that bless weapons to do +1d4 of additional fire damage or spells that will cause creatures to damage themselves on every attack. When combined with idea 1 (passive carriers) this might branch into the follwing kind of spells: "Imbue with spell triggered on attack", "Imbue with spell triggered on being hit", "Imbue with spell triggered on death", "Imbue with spell triggered on start of every turn" and "Imbue with spell triggered on every step". The imbue types will likely require a restrictive handling when it comes to stacking (note: in this case we will like to prevent the same kind of spell from stacking, so far this was only relevant for effects).

Edit: Improved clarity by trying to use the terms "spell" and "effect" correctly, which is not as easy as it seems. "Carrier" would then be the means to trigger the spell (cast/attack/use item/being hit/on death and on every step). "Spell" is a bundle of "effects'" in this sense then. "Spell" will likely also define target area (area of affect, including just one square), some type of carriers will allow manual selection for the centre/starting point for area of effect, others will just target the pc/creature who brings the spell into life. Spell will also contain the ally/enemy/all friendly fire setting. "Effects" might then contain saving throw and resistance values and of course the damage/heal/buff/debuff/Imbue with spell type. And the stacking setting for effects. And the duration. Or mayhaps a part of these properties is defined on spell level and these are the same for all bundled effects? This get very tricky the deeper one digs, but setting it up right will in the end allow to do many of D&D spells level 1 to 9 with ease.

Edit2: When thinking more about it, effects with duration rigth now are like "Imbue with spell triggered on start of every turn": They are repeatedly applied each turn. Maybe such an understanding will make it possible to achieve more with less prebuild effects? Or not, not certain. Must collect thoughts:

Carrier: A means to trigger a spell, like events. These can be: attack /cast spell/ use item/ being hit / on death / on start of turn /on every step. The centre target of the spell is determined differently, depending on the carrier: Attack uses the attacked cretaure/pc. Cast spell und use item allow a choice via clicking a square in range. The other - passive ones - use the currently acting creature/pc as centre point.

Spell: A bundle of effects with shared area of effect. A spell has an area of effect, including just one square. Also, some spells will only apply for friendly creatures, others only to enemies, others to all. A few spells later might have a cast duration in turns (causing the caster to skip turns until the spell is completed, interruption of the casting process could be possible). Some spells will also have a cost in SP or maybe HP, too, (blood magic) that are consumed before the casting process starts. A spell can optionally (choice of author) allow a saving throw to prevent the application of all its contained effects (this is in addition to each effect's optionally allowed saving throw). A spell calso have an optional duration, in that case overriding and replacing the duration of the effects. Furthermore, a spell can optionally be tied to the life of its caster - when the caster dies, the spell's remaining duration is reduced to zero and all its effects are terminated.

Effect:
A change of properties of the affected target. E.g. damage or healing, buff or debuff, mayhaps a change of x,y position or of AI (from enemy to friendly via charm).
isTemporary: Comes in the temporary variant, i.e. the effect is reversed after the effect duration, has expired or the permanent/instaneous variant (lingers on after effect duration is over).
Duration: Has a duration, which measures its repeated application in combat turns (apply at start of round, mayhaps that intervall shifts to 5 minutes on main map or is just applied per step/click of realTime Timer?).
isCumulative: Can or cannot cumulatively stack with itself (a -2 to hit debuff for 10 rounds typically does not grow to -4,-6,-8 over the rounds, but remains flat -2 for ten rounds, poison on the hand will add up its damage).
isStackingWithEffectOfSameName: Can or cannot stack with other effect of the very same name (like two Bull's strength spells which apply an effect with effect name "strength buff 1" wont stack, a girdle of giant strength migth satck on, using the name "strength buff 2").
effectName: Has an effect name for clear identification, like for cehckign steakcign above or for e.g. dispellign via dispel spell. Mayhaps some items grant immunity against efffects with certain names.

So much for this round of musings, will transfer it now into the appropriate forum section...
User avatar
youngneil1
Backer
Backer
 
Posts: 4541
Joined: Sat Dec 08, 2012 7:51 am

Re: New Flexible Spell, Effects, Status System Discussion

Postby Dorateen » Tue Oct 11, 2016 3:24 pm

Not sure if this is a good place for a request, but something I'd like to see is a script for an exlusive Raise Dead.

Right now, we have a force rest and raise dead that restores all hp and spell points, combined.

Also, is there a pass time script? Ideally, resting would automatically advance the world time something like 8 hours. But if we have a separate pass time script, builders can just add that along with rest events or other places it would be appropriate.
User avatar
Dorateen
Backer
Backer
 
Posts: 895
Joined: Mon Nov 26, 2012 2:08 pm

Re: New Flexible Spell, Effects, Status System Discussion

Postby youngneil1 » Wed Oct 12, 2016 8:18 am

Good ideas there. For the passing of time, I think that the existing osSetWorldTime.cs should do the trick (not re-tested):
//osSetWorldTime.cs - Sets the world time to any value (fast forward or rewind the clock)
//parm1 = (string) operator for adjusting the WorldTime (=, +, -)
//parm2 = (int) value to use with the operator (can be a variable, rand(minInt-maxInt), or just type in a number)
//parm3 = (bool) round down result to a multiple of 6 (true or false) default value is false so if left blank, will use false
//parm4 = none
//WorldTime can not be less than zero (a check will be made)
//Examples:
// to add 240 to the Worldtime (+,240,true).
// to add something between 100 and 150 [+,rand(10-15),true]
// to set the WorldTime to 2311 (=,2311,false)


I will add the exclusive raise dead script to the task list for IB2.
User avatar
youngneil1
Backer
Backer
 
Posts: 4541
Joined: Sat Dec 08, 2012 7:51 am


Return to Engine Ideas and Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest