Friday 7 August 2009

AGS Conversion Progress

Yesterday was a welcome break from T4W (how long does it take for an acronym to be established?). I spent some time rewriting how XAGE converts AGS scripts. Previously it was a bit flaky in how it dealt with carriage returns and didn't always provide the most reliable results.

Each AGS script is now tokenised, splitting everything up into functions, statements, if, brackets etc. The tokenised script is then converted into XAGE scripts. This two stage process is a lot cleaner and easier to extend. Using OpenQuest as my AGS source, here's a cherrypicked example of where the conversion is currently at. Consider the following AGS code:

function character2_a() {
// script for Character 2 (Lifeform): Interact character

if (sInteractionVerb == sTalkTo)
{
hideGUI();
// have we already met the cleaner? If so, use a different greeting
if (GetGlobalInt(8) == 1)
{
player.Say("Greetings Carol");
cCleaner.Say("You again?");
}
else
{
player.Say("Speak lifeform!");
Wait(40);
player.Say("Is this translation matrix working?");
cCleaner.Say("You're that guy from accounts right?");
}
dCleaner.Start();
}
else if (sInteractionVerb == sSmell)
{
player.Say("This creature has an overwhelming pungent smell");
}
else if (sInteractionVerb == sMove)
{
player.Say("The lifeform is surprisingly sturdy, I don't believe I can use force");
}
else
{
triggerUnhandledEvent();
}
}

The above function now converts automatically to an XAGE script as follows:

Photobucket

The two provide the equivalent 1-1 functionality save for two things:
  1. XAGE doesn't know what 'sInteractionVerb' is (#defined in OpenQuest as Game.GlobalStrings[11]. Whereas XAGE would link each event with its own script, AGS (or AGS developers?) tend to bunch certain events to the same function, which seems unnecessarily complicated - perhaps a throwback to earlier AGS versions).
  2. The conversion process doesn't yet handle AGS functions calling each other (requires an XAGE object running a new XAGE script).
In the future I see a juggling act; trying to keep XAGE's design as clean as possible and yet trying to map as much AGS functionality as possible, some of it outdated and deprecated. It's gratifying nonetheless to watch the OpenQuest opening cutscene running in XAGE, albeit in a slightly clunky, stunted way.

Wednesday 5 August 2009

"The Fourth Wall"

Today I submitted my DreamBuildPlay competition entry, "The Fourth Wall". As the deadline loomed I've had to cut a lot of corners, and there's no chance it will win, but I'm reasonably pleased with how it has turned out.

It's a silly, short game (or rather, anti-game). Here's a trailer that has absolutely nothing to do with the game itself:



I'm waiting on a few library fixes but there should be a Silverlight demo soon. In a few weeks you should also be able to part with 80 Microsoft Points and enjoy it on your Xbox360.

XAGE's first commercial product. Huzzah.