Thursday, October 28, 2010

Software: Design Specification

So far, I've been talking fairly generically about a "technomage staff" without really going into what it's going to look like and what it will do. First I'll describe it from "in-universe," that is, what it's doing in the context of the costume, and then I'll go into what this means in terms of actual behavior.

Since the costume is a technomage, the premise is that I have reserves of magical power I can use to cast spells or whatever. However, I can only channel a certain amount of this at a time, so on my own I'd only be able to cast relatively weak spells. To get around this, I use a magic item to store up my magic, so I can release it all at once in a larger spell. The staff will be this item: I hold my hand over it, and this will charge the orb at the top with power. The longer I hold my hand over the staff, the more power I imbue into it, until it has so much power it begins to flash dangerously, warning of an impending overload. If I ignore the warning, it will overload and begin drawing magical power on its own, even without using me as a source.

In reality, of course, all of the above will be expressed through LEDs turning on and off. I currently have 15 LEDs, which will be controlled by seven separate output pins. Three of these LEDs are white and are used during the first phase of operation, when I'm imbuing power into the orb; the longer I hold my hand on the switch, the more of these that will light up (in particular, one will light up immediately, a second will light after one second, and a third will light after two seconds). The remaining LEDs are used during the flashing phase, which begins one second after the third white LED has turned on; they are 4 LEDs each of red, green, and yellow, and will flash while the three white LEDs remain lit. If I remain in the flashing phase for five seconds (this is in addition to the three seconds it took to reach the flashing phase), I enter the overcharge phase; the colored LEDs continue to flash, but the white LEDs also begin to flash.

Up until the overcharge phase, releasing the sphere will turn off all the LEDs and return the orb to the off state; however, once it reaches overcharge, releasing it does nothing, and I need to touch it again to turn off the sphere. I've also added an additional feature, where if I am touching the orb when I turn on power to the system, all of the LEDs will turn on and stay on until I release and re-touch the orb again. This lets me use the staff as a flashlight if I wish.

I still need to clean up and comment the source code implementing the above design, but when I have done so I will post it here.

No comments:

Post a Comment