Wednesday, October 24, 2007

Haunted Mansion Interior for Madame Sarita's Spirit Parlour

Well, I have the second of two vignettes pretty much modeled out and ready for non-programmer art to be dropped in for the Madame Sarita's Spirit Parlour video game for Halloween. It's looking pretty nice. If I have time, I'm going to go back into all the environments and add spiderwebs and debris, but I'll be happy with this if I don't have time.

Moreover, this vignette is now fully playable. You enter the foyer, and a chill wafts over you. Suddenly, two ghosts come screaming out of the dark corners at you!
Ghost attacking

Dispatching them with your abjuration cards, you proceed towards the staircase, where the spirits offer to let you choose your fate.
Choose your fate

As you tentatively select one of the fate cards, you hear a horrible scuttling from behind! Spinning around, you gasp in horror as a swarm of spiders come skittering out of an open doorway! Your valor casting had better be up to snuff!
Spiders attacking

Was the other fate card a better choice? I guess you'll never know. Such are the vagaries of fate. (Or perhaps this will prompt you to strike up some conversations with other visitors to see what their experience in the Spirit Parlour was like...)

Sunday, October 21, 2007

More Progress on Madame Sarita's Spirit Parlour

Today, the crew came over and we did a lot of work on the Spirit Parlour. We got more walls made and hung up in the garage, we got a good start on the window frame, we got the crown moulding put over the window box, and we got the "casting cards" finalized for the game. Moreover, we managed to get in a test of the interface, and it revealed some problems which I have fixed tonight. The game now has very fine configuration controls that allow much more crisp responses to the players' actions, far better than before. This thing is really coming together well. I can't wait to get it in front of some kids.

Spirit Parlour Game Controllers

The "casting cards" are:
Valour
The card shows a knight vanquishing a terrible foe. When the Mage player places his or her hand over it, it casts a spell that smites your foes with fire and steel.
Abjuration
The card depicts an undead specter cowering in fear from the light beaming forth from a man's hands. When selected, it casts a spell that banishes the spirits of the undead.
Sinister Knight and Dexter Knight
These paired cards show skeletal knights facing left and right. They are used to communicate your wishes to the spirits of the dead.

The cards themselves were drawn by local artist Bob Diven, and look spectacular close-up. They are in the style of old Tarot cards from the dark ages, but are completely original, since we didn't want to actually use the Tarot, in case someone objects. You can get an impression of them in the photo above. They sit in small boxes, back-lit by small utility lights. Also in the photo above, you can see the new configuration screen, showing the current configuration of the system. It now has readouts of the current settings, ways to adjust thresholds and sensitivities, and feedback icons so that all game systems can be tested within the configuration screen. (You can see the circular targeter, the palantir HUD, and icons for the four cards.)

Spirit Parlour game coming along nicely

Spirit Parlour game controllers
Tonight, I did my first complete test of the controllers for this year's Madame Sarita's Spirit Parlour, and it works. It works! Yes!

All three control types for the game are now prototyped and working smoothly:
  • The Palantir of Abyssinia, a crystal ball filled with water from the river Styx, sits on the right, where the "Mystic" player waves his or her hands over it to generate mana.
  • Four Casting Cards that once belonged to Marie Laveau sit on the left, so rife with power that they glow of their own accord. The "Mage" player need only pass a hand over them to access their magical energies.
  • The Skull of Rasputin grins horribly in the center, where the "Medium" player will lay hands upon it to draw the team into the dark nightmare of the spirit world.


Now, all I have to do is make the game which uses the controllers. Erm...

Thursday, October 18, 2007

Sneak Peek at Carnival of Souls 2007

Warning: Spoilers for Carnival of Souls 2007 ahead! Don't read this post if you want to preserve the magic.

As many of you may know, we've lost a lot of volunteers for 2007. Among the regulars and semi-regulars you won't see haunting our house this year include: Holly, Byron, Jen, Dana, my parents, Barb's parents, Jim, Janice, and Stephanie. We've also got some tentatives and some not-heard-froms. Thankfully, we've recruited many volunteers to pick up the slack, but it still meant we got a very late start this year.

But does that mean we won't have any spine-tingling surprises for our visitors this year? No way! The Carnival of Souls crew are innovating a new garage attraction this year which should be a lot of fun and require fewer workers to maintain.

This year, Madame Sarita's Spirit Parlour will challenge our visitors to do some ghost talking of their own. Sarita is looking for apprentice guardians, and she needs Mystics, Mediums, and Mages to help her defend against the forces of darkness.

Mystics will use the crystal ball to generate the mana required to fuel magic spells. Mediums will use their "third eye" to project their vision into the spirit world. And Mages will cast the spells to put down that which should never be called up.

Here's a shot of the new spirit parlour construction:
home haunt construction
You can see the window box we're building. That will house a 4' wide rear-projection screen where the adventure is displayed. An Apple laptop will control the action. You can see the crystal ball which one player will use as a game controller. The "Mystic" player will wave his or her hands over the crystal ball to generate magic power. The skull on the table is a tentative stand-in for the Ouija Board cradle which the "Medium" player will use to control progress in the spirit world.

Here's a shot of the gameplay:
home haunt game
Now, if we can only get it done before Halloween...

Quickly view HTTP headers

Found this little gem today. Web-Sniffer.net allows you to enter a URL and it will display the HTTP request and response header.

Friday, October 05, 2007

Thanks, AT&T

I just got this text message from AT&T: "As of 10/7/07, text messages sent to 505 area code will not reach you and sender will not be notified. Advise contacts of your new 575 area code."

Ah, such great service.

So, all you friends of mine who are subscribed to my blog: update your numbers for us in your address books to area code 575, please. Our other service providers are giving us a grace period of a year, so while you should update all your numbers for me, text messaging is apparently more urgent, since apparently, AT&T can't be bothered to forward you or notify you that I'm not going to get the text message you just sent.

Creating Accessible Flash Content

WebAIM has posted an article on making Flash content accessible. Widely it is asserted that Flash is accessible, but the reality is that it's not unless you make a Herculean effort to make it so. Thus, a how-to guide is good to have.

In addition, it has a good overview of general accessibility issues for any web content, not just Flash content:
  • Hearing disabilities
    • Provide synchronized captions for any audio that conveys content
  • Photo epilepsy
    • Remove strobing content that flashes between 2 and 55 times per second
  • Motor disabilities
    • Ensure the Flash content is keyboard accessible
    • Do not require fine motor skills
  • Cognitive disabilities
    • Give users control over time sensitive content
    • Provide easy to use controls and navigation schemes
    • Be consistent
    • Use the clearest, simplest language appropriate to the content
  • Low vision
    • Provide plenty of contrast
    • Allow the Flash content to scale to a larger size
  • Blindness
    • Ensure screen reader accessibility or provide an accessible alternative
    • Ensure keyboard accessibility
    • Do not interfere with screen reader audio or keyboard commands
    • Provide textual equivalents for all non-text elements that convey content or provide a function.
This list of accessibility items is always a good thing to look at when you are faced with a site that you need to update or design. Keeps you in check when you (or someone else) is looking to get funky with AJAX, general Javascript, or Flash on the web.

Tuesday, October 02, 2007

Flash "memory leak" in Director

For our current project, I've been trying to nail down what appeared to be a memory leak in Director with respect to Flash members. It's not technically a "leak," per se, but the end result is the same: memory gets allocated that cannot be de-allocated. After some investigation, here's what is going on.

I was using Flash members to store bitmap graphics for a project which required cartoony characters. These character graphics were 256x512 pixels in size, so I could either use 16k to store a Flash member that contained all the frames for the animation, or I could use 512k per frame of animation to store the bitmaps. No brainer, right?

Well, there's a problem. Apparently, if you use "the posterFrame" property of a Flash member, Director's engine will become unable to unload it. My guess is that this is because it is flagged as "changed" in the same way that a bitmap cast member cannot be unloaded after you change its image using its image property. I suppose this makes sense, because the posterFrame set would be lost if the member was unloaded.

So, basically, we have a situation where, if we store graphics in a Flash member and extract them via the posterFrame property, you can never unload them.

What to do? As with most things in Director, there is a workaround. Since the Flash member can never be unloaded when you set its posterframe, the trick is to not set its posterframe, but instead set the posterframe of a duplicate. Make a copy of the Flash member, yank the posterframes from that, and then erase it. The original Flash member can remain unloaded in this case, and the member which cannot be unloaded is instead erased. Here's the code:

on getFlashImage theMember, thePosterFrame

-- We can accept either a literal member reference, a string, or a number.
if (theMember.ilk = #member) then m = theMember
else m = member(theMember)

-- Duplicate the member, and set its posterframe
theTempMember = member(m.duplicate(), m.castlibnum)
theTempMember.posterframe = thePosterFrame

-- Grab the image
i = theTempMember.image.duplicate()

-- Erase the temporary member
theTempMember.erase()

-- Unload the original member
m.unload()

-- Return the image
return i

end getFlashImage