In my thinking, all effects were going to have a 'target' field. Untargeted effects (like, say, Enlightenment) would have that field empty, and the code would just default to starting from the grid from which the effect originated (the 'who' in the current project() code). From what I understand of inheritance and so on, it looks like your framework would function in much the same way, dealing with a target if there is one while progressing seamlessly without.
I got a bit confused about your exchange with d_m on data and code, because I missed the implications for how much would or wouldn't be in the edit files. But if it helps I could send you the edit file syntax I'd done for the effects rewrite I was planning for v4 (if I can find them - it was a few months ago now).
The short version of this is that you need to make your program exactly as abstracted as it needs to be, and no more. If it's insufficiently abstracted, then making minor changes becomes painful (imagine if every monster were defined in the code, with no monster.txt). However, if it's excessively abstracted, then making minor changes becomes painful again (because the abstraction introduces its own layers of complexity) and the engine becomes impossible to work with because it has to deal with all those abstractions.
I'd rename Permanent to Intrinsic, so that "Permanent" then refers to "Intrinsic or Indefinite", but otherwise I'm with you here. This is a good way to handle racial traits (both for monsters and player races).
Anyway, a few more scattered thoughts from further back:
- I don't think it's wise to consider spells as OnUse effects. It would be helpful to allow them to be cast without any items if the designer so wanted it (psionics, for example). So they are sort-of "OnAction" effects instead.
- I don't think it's wise to consider spells as OnUse effects. It would be helpful to allow them to be cast without any items if the designer so wanted it (psionics, for example). So they are sort-of "OnAction" effects instead.
- one of the target types you didn't include is monster race - for banishment-type effects.
- please include an OnExpiry trigger, so that effects can be triggered by the expiry of other effects (see EF_SHROOM_SPRINTING, which currently has special-case code)
- and of course OnHit for classic procs (and OnMiss for fumble effects).
- please include an OnExpiry trigger, so that effects can be triggered by the expiry of other effects (see EF_SHROOM_SPRINTING, which currently has special-case code)
- and of course OnHit for classic procs (and OnMiss for fumble effects).
- don't forget to think about saving throws. I really struggled with this - if you store the save rules in the effect, they have to be the same for all targets. Perhaps your inheritance stuff can help with this - allowing certain targets to override the default saving throw with an easier or harder one.
- the "modifier amount" shouldn't be a simple signed integer - or at least, if it needs to be, there needs to be another field which holds a random value formula for the calculation of random amounts (e.g. the current variable high resists). There's also a whole can of worms about which factors get to influence the amount (caster skill, target level, etc. etc.) - as with saving throws, the inheritance system should make this easier.
- the "modifier amount" shouldn't be a simple signed integer - or at least, if it needs to be, there needs to be another field which holds a random value formula for the calculation of random amounts (e.g. the current variable high resists). There's also a whole can of worms about which factors get to influence the amount (caster skill, target level, etc. etc.) - as with saving throws, the inheritance system should make this easier.
- I hope you're including detection/mapping among the things that this framework will deal with: each grid should know whether it's currently in LOS, previously been in LOS, fully detected or fuzzy-detected (as well as its light level and possibly other states) - then you can handle all of telepathy, mapping, enlightenment, lighting etc. etc. by creating effects which alter the states of grids. (The players *actual* LOS isn't an effect, but can be called after all effects have been processed for the turn, as a final update.)
- don't forget to include a way of specifying the various PROJECT_ attributes, e.g. whether an effect terminates at a first or subsequent target, or jumps over them etc.
Sorry this is a bit scatty - like d_m I am really excited by how far you've taken Pyrel in such a short time, and think it has huge potential to be the foundation for a new variant explosion of Python 'bands. Hope this is all constructive and helpful.
Leave a comment: