Dragonia Spell System

Darque

Chaotic Lord of Dragonia
Joined
Oct 15, 2004
Messages
1,147
Location
Illinois
As I am developing the spell system for Dragonia from scratch, I will use this thread to document it.

The Dragonia spell system will entirely coded to the SDK, with the spells themselves being defined in XML. This will make it easy to create new spells, and maintain a high level of performance. The XML file to be used to define the spells will be Civ4CommandInfos.xml (As was already initally used by Dragonia II Beta 1) Civ4CommandInfos.xml will contain the following fields:
Spoiler :
Type - The spell Key
Description - Link to the description text key
Help - Link to the help key
HotKey
bAltDown
bShiftDown
bCtrlDown
iHotKeyPriority
HotKeyAlt
bAltDownAlt
bShiftDownAlt
bCtrlDownAlt
iHotKeyPriorityAlt
iOrderPriority
Automate
bConfirmCommand
bVisible
bAll
Button - Button graphics file location
PromotionPrereq - Promotion prerequisite required to cast the spell
PromotionPrereqAnd - Second promotion prerequisite required to cast the spell
bTargetSelf - Indicates whether the spell targets only the caster
iTargetRange - The spell range. 0 = local plot, 1 = adjascent plot
iTargetMaxUnits - The maximum number of units that can be targetted. -1 = infinite
ConjureUnit - A Link to a unit that is conjured by the spell
TargetPromotion - A link to a promotion that is given to the target unit(s). If the spell conjured a unit, that unit will receive this promotion.
bRemovePromotion - If true, the target promotion will be removed from target unit(s) instead of added
iTargetDamageMin - Minimum amount of damage applied to target unit(s)
iTargetDamageMax - Maximum amount of damage applied to target unit(s)
EffectType - Link to visual effect to display on screen when spell is cast
CommandSound - Link to Audio 3D script to play when spell is cast


Currently I have comleted the conjuration of units, and the application/removal of promotions to the caster.
Next, I am working on targetting a tile.
 
Target spells would be awesome. Will the AI be able to understand it?
furthermore there should definitly be a second field for effect and sound(one for the caster and one for the target)
Do you plan to import some of the tags from FFH as well? Especially the prereqpromotionOR tags allow a great flexibility.
 
Yes, I plan on updating the AI to be able to use the spells.

TargetEffect is a good idea. I'll add that in. As for the PrereqPromotionOr, if I see a spell that needs it (I don't see the need at the moment) then I will add it.

What other tags do you feel would be useful for Dragonia's System?
BTW...the planned spell list is at Arcane Spells and Divine Spells
 
from the looks of the spelllist it seems you would need at least two more prereqOR promotions?
Like for Melf's meteors:
Evocation/Alteration/Earth

It doesn't seem you plan diversifying the spells for different civs? PrereqORs combined with PrereqAnd promotions gives great flexibility about that, it's what I use in the WH mod. but it's true that's just my concern:p

How do you implement the level, will this be tied to the unitlevel? Or a nine promotionsystem?

Edit: in any case please do me the favor of commenting your spellsystem well! If you make those bloody targetsystem work with the AI I couldn't resist stealing it:D

Edit2: I'm particularly concerned about magic missles. They might be difficult to implement with nice fitting effects unless you find a way to move such an effect from the caster to the targettile during the castingaction and give also a proper rotation to the nif(maybe a temporary create unit - like FHH fireball - move unit, delete unit respectively attack with unit explode after combat might do the job but I'm not sure if that can be done, currently in FFH what makes the spllunitconcept kind of crappy is that the player has to move and attack with them. If that action is performed by the game after he selected a tile it would be fine). Two effecttags alone just will be good for spelleffects like Pillar of Fire and similar stuff.

Edit3: What about damagetypes? - fire, lightning, acid etc.
 
what about multiple add/remove promotion tags? i find that in WH when ive wanted to make some spells i havent had enough slots in the remove promotion tags.

if you manage to get these targetting spells to work (and be used by the AI), you will be my hero!
 
from the looks of the spelllist it seems you would need at least two more prereqOR promotions?
Like for Melf's meteors:
Evocation/Alteration/Earth
Hmm, I think I will have to add a PrereqOr

It doesn't seem you plan diversifying the spells for different civs? PrereqORs combined with PrereqAnd promotions gives great flexibility about that, it's what I use in the WH mod. but it's true that's just my concern
Spells will be the same for all civs; but some leader traits will make spells more powerful.

How do you implement the level, will this be tied to the unitlevel? Or a nine promotionsystem?
For the first draft of the spell system, I will not implement the level, just to a multi-tiered promotion system (ie Evocation I, Evocation II) When the first draft of the spell system is completed, I'll return to it and have it be based on unit level per D&D rules.(You can not cast a 2nd level spell until the unit is level 4, with a new spell level being gained every 2 levels. Thus 9th level spells are available at level 18)

Edit: in any case please do me the favor of commenting your spellsystem well! If you make those bloody targetsystem work with the AI I couldn't resist stealing it
I'll try to comment my code as well as possible, and group all the spell casting functions together.

I'm particularly concerned about magic missles. They might be difficult to implement with nice fitting effects unless you find a way to move such an effect from the caster to the targettile during the castingaction and give also a proper rotation to the nif(maybe a temporary create unit - like FHH fireball - move unit, delete unit respectively attack with unit explode after combat might do the job but I'm not sure if that can be done, currently in FFH what makes the spllunitconcept kind of crappy is that the player has to move and attack with them. If that action is performed by the game after he selected a tile it would be fine). Two effecttags alone just will be good for spelleffects like Pillar of Fire and similar stuff.
For magic missiles...If I have my targetting system in place, I can spawn the missile unit on the caster's plot, and then move that unit to the targetted plot and let it do its kamakazee attack with explosion. :D All that will be needed is the targetting system, the rest is easy.

What about damagetypes? - fire, lightning, acid etc.
For damage types, I have asked Vehem to work on implementing that code. No idea on the status of it. Unfortunately for me, I still have not been able to figure out how the battle system works :( That prevents me from adding the damage types myself.

what about multiple add/remove promotion tags? i find that in WH when ive wanted to make some spells i havent had enough slots in the remove promotion tags.
I have not had a need yet for multiple add/remove promotion tags. If and when I find that I need them, I will add them.
 
Sounds pretty cool. Can't wait to try it out, man. Can we expect a patch w/ the spells added soon? :)
 
Hmm, I think I will have to add a PrereqOr
two;)

For the first draft of the spell system, I will not implement the level, just to a multi-tiered promotion system (ie Evocation I, Evocation II) When the first draft of the spell system is completed, I'll return to it and have it be based on unit level per D&D rules.(You can not cast a 2nd level spell until the unit is level 4, with a new spell level being gained every 2 levels. Thus 9th level spells are available at level 18)
Sounds great.

I'll try to comment my code as well as possible, and group all the spell casting functions together.
thank you very much!

For magic missiles...If I have my targetting system in place, I can spawn the missile unit on the caster's plot, and then move that unit to the targetted plot and let it do its kamakazee attack with explosion. :D All that will be needed is the targetting system, the rest is easy.
This, Sir, is awesome!

For damage types, I have asked Vehem to work on implementing that code. No idea on the status of it. Unfortunately for me, I still have not been able to figure out how the battle system works :( That prevents me from adding the damage types myself.
Yeah it might be better to understand it first(I don't understand anything of C++ but I still merge stuff sometimes else I would be able to mod anything:crazyeye:). I believe some modmodders are trying to improve it. It might be worthwhile to wait for that.
 
I have not had a need yet for multiple add/remove promotion tags. If and when I find that I need them, I will add them.

well from the looks of the spell list you could use a hellofalot of promotion granting spells, like invisibility, stone skin, cure poison etc. id expect some healing spells to remove several negative promotions from the target unit. but im not sure what you have planned so thats just my 2c :)
 
There might be some that could require an either/or. Like in WHFB for example, some spells require Dark Magic III or Grey Magic III. That might apply to some of the arcane spells in the same manner.
 
There might be some that could require an either/or. Like in WHFB for example, some spells require Dark Magic III or Grey Magic III. That might apply to some of the arcane spells in the same manner.
The PrerequisiteOr field already has been established as being needed. The question now is if we need to implement multiple TargetPromotion fields.
 
The PrerequisiteOr field already has been established as being needed. The question not is if we need to implement multiple TargetPromotion fields.

Oh, sorry. Guess I wasn't payin attention. Sorry. It was l8 at nite, man. :sleep:
 
DEVELOPMENT UPDATE:
After doing much searching through the code, I have come to the conclution that the targetting system will have to utilize some python scripts.
As such, if the spell range is greater than 0, I'll make a python callback to activate a plot chooser. After the player chooses a valid plot, a call will be made to the SDK to complete the processing of the spell.
 
Hmm...ok. Sounds...um...slightly complicated. :|
 
I would like to report that this night, I have had some success with my spell targetting system. I was able to cast a spell, display a pointer (have some minor bugs with it) and then complete the execution of the spell when the user clicks the mouse button. Next step is to refine the targetting system, and make sure all the bugs are taken care of.
 
Top Bottom