1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Dragonia Spell System

Discussion in 'Civ4 - Dragonia II Mod' started by Darque, May 16, 2008.

  1. Darque

    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.
     
  2. Ploeperpengel

    Ploeperpengel academic precarity

    Joined:
    Feb 2, 2006
    Messages:
    4,748
    Location:
    Berlin
    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.
     
  3. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    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
     
  4. Ploeperpengel

    Ploeperpengel academic precarity

    Joined:
    Feb 2, 2006
    Messages:
    4,748
    Location:
    Berlin
    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.
     
  5. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    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!
     
  6. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    Hmm, I think I will have to add a PrereqOr

    Spells will be the same for all civs; but some leader traits will make spells more powerful.

    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)

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

    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.

    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.

    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.
     
  7. rocklikeafool

    rocklikeafool Warmaster

    Joined:
    Jan 9, 2008
    Messages:
    2,416
    Location:
    Wherever there's Tequila...
    Sounds pretty cool. Can't wait to try it out, man. Can we expect a patch w/ the spells added soon? :)
     
  8. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    The new spell system will be part of the Beta 2 release.
     
  9. Ploeperpengel

    Ploeperpengel academic precarity

    Joined:
    Feb 2, 2006
    Messages:
    4,748
    Location:
    Berlin
    two;)

    Sounds great.

    thank you very much!

    This, Sir, is awesome!

    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.
     
  10. rocklikeafool

    rocklikeafool Warmaster

    Joined:
    Jan 9, 2008
    Messages:
    2,416
    Location:
    Wherever there's Tequila...
    Ok, cool. So, we can expect it in less than a few months.
     
  11. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    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 :)
     
  12. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    Yes, many of the spells will apply a promotion; but I don't see one that requires the application of multiple promotions...
     
  13. rocklikeafool

    rocklikeafool Warmaster

    Joined:
    Jan 9, 2008
    Messages:
    2,416
    Location:
    Wherever there's Tequila...
    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.
     
  14. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    The PrerequisiteOr field already has been established as being needed. The question now is if we need to implement multiple TargetPromotion fields.
     
  15. rocklikeafool

    rocklikeafool Warmaster

    Joined:
    Jan 9, 2008
    Messages:
    2,416
    Location:
    Wherever there's Tequila...
    Oh, sorry. Guess I wasn't payin attention. Sorry. It was l8 at nite, man. :sleep:
     
  16. Psychic_Llamas

    Psychic_Llamas Wizard in the Making

    Joined:
    Nov 25, 2005
    Messages:
    6,366
    Location:
    Western Australia
    im thinking more the removal of multiple promotions ;)
     
  17. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    The only spell I can think of that would remove multiple promotions is Dispell Magic. And that would be a special case.
     
  18. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    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.
     
  19. rocklikeafool

    rocklikeafool Warmaster

    Joined:
    Jan 9, 2008
    Messages:
    2,416
    Location:
    Wherever there's Tequila...
    Hmm...ok. Sounds...um...slightly complicated. :|
     
  20. Darque

    Darque Chaotic Lord of Dragonia

    Joined:
    Oct 15, 2004
    Messages:
    1,147
    Location:
    Illinois
    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.
     

Share This Page