< Previous
Next >

: I spent the evening writing a magic system for the new game. I started out with the sample Enchanter-style magic system that comes with Inform and that I used in Guess the Verb!, but now there's almost none of it left. It has almost the same interface, but the implementation is completely different.

The main change I had to make was to add support for NPCs who could learn and cast spells, the same as the player. The default system had two big things standing in the way of this:

  1. Every spell had an object containing the number of times the player had memorized it. I moved this into the object representing a spellcaster's memory.
  2. When you memorized a spell it would change the spell's location in the object tree, making it a child of your memory object. The location of the spell in its spellbook was a mere reference to the spell object. Now it's the other way around; spells are always located in the object tree underneath the spellbooks or whatever containing them, and people who memorize spells get references to the spell objects in their memories.

I really like text adventures with spellcasting systems, and this one's going to be great; lots of spells, lots of fun magic toys, lots of incredibly evil puzzles. Mwahaha!


[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.