-
Notifications
You must be signed in to change notification settings - Fork 15
player monster spellcasting merge notes
copperwater edited this page Apr 8, 2023
·
1 revision
Once touted as the "Next Big Project" (before quest overhauls and Gehennom redesign got in the way). Now it's not certain if this will add enough to the game to be worth the effort.
This is a loose collection of notes rather than any sort of plan.
Since the only variants that currently merge player and monster spellcasting are FIQHack (whose codebase is too far diverged) and GruntHack (where the changes are a small part of a massive commit) this would have to take a fresh approach.
- Consider implementing monster Pw rather than relying on mspec_used. The advantage of this is that it would make other things like dragon breath symmetrical with the player. The disadvantage is that it would greatly complicate this project. At the moment, I'm inclined to keep monster spellcasting using mspec_used for now, with lower level spells giving them a shorter timeout.
- FIQHack monster spellcasting (casting spells from muse.c code is preferable to the vanilla/grunthack timing (either casting a random nondirectional spell for their turn or attacking with a random offensive spell)
- Note that vanilla muse usually has a "best option" it will favor; this may need to be dropped or refactored for cases where the monster has multiple good spell options (a possible refactor is collecting all "good" options in one bitmask and then randomly choosing among them)
- The Double Trouble spell is the only spell that the player can't cast. Not sure if it should be implemented as a spellbook that is unwritable, unwishable, and never generates, or as a special case for the Wizard AI.
- Spellcasting monsters are randomly assigned a list of spellbooks when created; they only very rarely carry one or two of these books. The lists of available spells will probably mostly be hardcoded (at first; try to vary as much as possible). Probably the best data structure for storing an arbitrary list of spellbooks is a new type of mextra structure (priests and minions will need a separate copy of it within their own structure).
- FIQHack does it with a uint64_t bitmask in struct monst, with FIQ saying an array of uint32_t might be better
- FIQHack algorithm for assigning spells: https://github.com/FredrIQ/fiqhack/blob/development/libnethack/src/makemon.c#L1421
- Note that this depends on monster spell skills, which would need to be added.
- FIQHack's "rarely carry books" algorithm is a 1/20 chance of a monster carrying the corresponding book for a spell it was generated with.
- Touch-range spells need to be implemented, probably relatively easily as a beam with a range of 1, but ideally if you select a direction where there isn't an adjacent monster, you get a message to that effect.
- Smite-range spells need to be implemented as well.
- #823: Nymphs are weak spellcasters and may generate with a few enchantment spells or have hardcoded ones like sleep and charm monster.
- Figure out which monster spells are worth converting to player spells, and which aren't.
- Cure self, haste self, confuse you: all of these have a counterpart already.
- Psi bolt: turn into level 1 attack spell (needs to be better than force bolt, somehow)
- Stun opponent: don't think so; monster stunning is so weak that this would be useless in player hands.
- Disappear obviously has a counterpart in Invisibility; but this gives me an idea to turn detect unseen into invisibility purge (maybe)
- Drain strength: wouldn't work on monsters, and wouldn't be particularly useful on them even if it did work. There's probably enough stuff in the game that drains strength anyway.
- Destroy armor: not amazingly useful against monsters since the player usually wants their loot, and a notorious player annoyance. Get rid of it.
- Curse items: Not particularly useful in the player's hands, BUT there are some interesting things you could do with it. Keep it in as a level 4-5 clerical spell. (Dunno why it was arcane in the first place).
- Aggravation: In the player's hands, assuming it aggravates everything against the player, pretty useless. I can see it being tweaked somehow so that the player can put a "discord" effect on another monster that makes other things attack it, but that goes outside the scope of this project. Remove it for now and keep that idea around for later. Note that GruntHack did give this one to the player.
- Summon nasties: Nope. Let's not let the player generate a crowd of tame high-level monsters. Summonstorming is a problem with the game as is, so remove this from monsters' hands (or put it exclusively into Rodney's hands as a special spell) and see how they do with regular create monster.
- Touch of death: Turn finger of death into this and make it level 6; the player can no longer shoot infinite death rays.
- Open wounds: decent enough as a low level clerical spell, 1-3
- Paralyze: place in the school of enchantment rather than clerical, but still let monster clerics have it; make sure it's not overpowered (should still be a touch range spell)
- #2047: Add a spell of paralysis, which basically copies the same monster spell. Melee range, better than sleep.
- Blind: actually more useful in the player's hands than most monsters; monsters don't tend to have unicorn horns. Should be melee range so that the camera remains better for blinding at range.
- Summon insects: may be worth keeping in just to see how ridiculous it is for players to get armies of ants. Smite-targeted mid-level clerical spell.
- Lightning: change to attack, level 5. Turn into an actual lightning ray on the monster side, rather than a bolt that strikes from above.
- Fire pillar: Level 6 clerical, despite being an attack. * FIQ suggests this is redundant with fireball and should be removed.
- Geyser: Level 7 clerical, despite being an attack. Maybe remove either this or fire pillar since two high-level cleric attack spells seems redundant.
- Figure out which player spells cleanly map to monsters, and which don't. Many will require AI enhancements.
- Trivial (easily implemented from existing code)
- Force bolt
- Magic missile
- Create monster
- Sleep
- Confuse monster (change the player spell to remove the glowy hands effect, it's just a one-shot touch range)
- Slow monster
- Haste self
- Invisibility
- Healing
- Extra healing
- Cure blindness (though if this one died as a player spell, not worth preserving as a monster spell)
- Not difficult to adapt existing code
- Drain life
- Remove curse
- Turn undead (trickier bit: adding in AI for resurrecting their friends)
- Light (trivial for effects; trickier bit is AI of when a monster wants to light their area)
- Teleport away (may need changes on the player side)
- Stone to flesh
- Tricky to adapt, but still feasible
- Fireball/cone of cold (requires monster fuzzy smite-targeting, i.e. will hit the area near the player even if they can't hit the player directly)
- Protection (does struct monst need to be augmented to keep track of its timeout?)
- Cause fear (player-side fear mechanics tricky to implement)
- Charm monster (only use case I could see here is for monsters recruiting peacefuls or swaying your pets)
- Jumping (monster jumping not implemented)
- Knock (would need AI that decides the best way to the player is through a locked door)
- Wizard lock (would need the reverse AI of that: a locked door will hold off the player)
- Monsters won't ever use these - keep in for players unchanged
- Detect monsters (could have them use this to learn where the player is a la FIQHack, but probably too much AI work)
- Detect food
- Clairvoyance
- Magic mapping
- Detect unseen (monsters know traps already, and finding invisible monsters is very marginal)
- Detect treasure (finding objects is very marginal)
- Levitation (unless FIQHack already as an AI algorithm for deciding when monsters want to cross a levitatable obstacle)
- Create familiar (not used much by players anyway; monsters get way more mileage out of standard create monster)
- Cure sickness (monsters don't get sick)
- Restore ability (monsters don't have ability scores)
- Dig (could be used as an escape, but I don't think it's very fun to have to chase an opponent down and down and down when they are not just limited by the charges in a wand)
- Polymorph (not as long as it can break armor, under current armor-breaking mechanics. Maybe it baleful polymorphs you into a tiny wimpy creature.)
- Cancellation (this isn't an evil variant like grunt or evilhack)
- Chopping block
- Finger of death (would get removed in favor of touch of death)
- Trivial (easily implemented from existing code)
xNetHack Roadmap
- Idea Priority Lists
- Bugs