My greatest weakness

1 July 2010

A classic job interview question is “what is your greatest weakness?”. I suppose mine is that once I get bored, that’s it. As soon as I’ve got comfortable in a job and think I’ve got it all figured out, as soon as I’ve stopped being stressed because I don’t know what’s going on, as soon as I’m part of the furniture, there’s only one place to go - the exit.

So, after three years for my current employer I’ve handed in my notice. I’ve certainly improved a lot as a software developer since I got there, but the pace of improvement has slowed a lot recently so it’s time to move on.

I’ve decided to seek out temporary contracts instead of permanent employment. That should keep the boredom levels down, give me a nice variety of different work - and let me spend time between contracts building up my software business Axe Software. Yes, you may not think that text adventure games are the future, but you’ll see. Eventually. Perhaps.

It will be a bit more hassle - regular job interviews, the administrative overhead of setting up a limited company, and reduced job security, but really, overall it’s a no-brainer. I wish I’d thought of it sooner!

So, I have two questions - anyone need an awesome C# developer starting in August for, say, six months? And does anybody know a good accountant?

Quest in other languages

1 March 2010

Quest 4.1 supports languages other than English by creating an LDF file.

I have now added a Quest Translations page to the website containing LDF files contributed by users. Currently we have translations of Quest into German and Spanish.

If you’ve created an LDF file for Quest, I’d love to hear about it! Please email me at [email protected] if you would like to submit an LDF file to the site.

Games in Spanish

I came across this page of Quest games in Spanish:ía:Aventuras_Quest

If you know of any other pages of foreign language games (or indeed any other websites to do with Quest), please let me know and I’ll add a link from this site.

The HTML interface in Quest 5.0

19 February 2010

Previous versions of Quest used a "rich text" control to display text. This is quite an old Windows control, which is fine for basic formatting but ultimately lacks flexibility. Quest 5.0 replaces this with an embedded web browser, which opens up a lot of new capabilities.

At a basic level, it makes it very easy to add something I have wanted to add to Quest for a long time - hyperlinks:

By default, objects and exits in a room description are hyperlinked, so the player can look at objects and move around the game by clicking the game text. I may add the option to display a short menu of verbs instead, so that the hyperlinks could potentially be used as a complete replacement for the object panes.

Of course, some game authors may not like this, just as some authors don't like Quest's default panes - but you will be able to turn these off. The links are put there as part of the room description code in Core.aslx, so you can override it, and there will be an option to turn it off.

Two-way interaction with JavaScript

The most exciting thing about using HTML for the interface is that you can completely customise it to look exactly as you want. You can specify your own HTML file for the interface by including an interface tag in your ASLX file. Within that HTML file you can call JavaScript just as in any standard webpage, and that JavaScript can interact with your ASLX file.

To call JavaScript from your game code, we can use a particular call to the request command. The request command's first parameter is the request type, and a request type of "RunScript" lets you call any JavaScript function defined in your game interface.

You can see an example of this in the YouTube example included with the Quest 5.0 samples. In the example we use the following code:

request (RunScript, "AddYouTube; ZXZWepU7zC8")

This calls the AddYouTube function defined in YouTube.js, and passes in the parameter "ZXZWepU7zC8" which is just the YouTube id of a particular video.

The AddYouTube function simply creates the relevant HTML to embed the video and adds it to document.body.innerHTML. The video then appears in the Quest window.

You can also go the other way, making a JavaScript function call a function in your ASLX file. This way, we might get rid of the hard-coded panes altogether and have a purely HTML and JavaScript solution which can be customised however you want. It also opens up the possibility of support for "point and click" games in the style of Monkey Island, because you could trigger game behaviour when the user clicks on something in the HTML interface such as part of an image.

To trigger a Quest function from JavaScript, you can call the ASLEvent function defined in WebFunctions.js. This is included in the standard HTML interface (PlayerDefault.htm, which is the default interface used by Core.aslx), and takes two parameters - the name of the function, and one parameter. You can call any Quest function that takes one string parameter.

Types in Quest 5.0

18 February 2010

"Types" let you share sets of properties between objects. They work in the same way as Quest 4.x, except slightly more efficiently in that instead of copying the properties to the object, the object just references the underlying the type if it doesn't have its own override for a property.

You can view all the properties of an object using the Debugger, which is accessed via the Tools menu. Properties from an inherited type are shown in grey.

Types are defined using a <type> element, and properties are defined in the same way as for an object. Objects and types can both inherit from other types using an <inherit> tag.

  <type name="food">
    <health type="int">0</health>
    <eat>It looks tasty, but you're not hungry right now.</eat>

  <type name="fruit">
    <inherit name="food"/>

Default behaviour

If the ASLX defines a type called "default", then it is applied to all objects - there is no need to specifically inherit from this type. Core.aslx uses this to define the default behaviour for objects:

  • The displayverbs and inventoryverbs properties are defaulted to give the standard buttons on the panes on the right-hand side of the Quest screen ("Look at", "Take" and "Speak to" for the objects list, and "Look at", "Use" and "Drop" for the inventory list)
  • All objects are droppable by default
  • The neutral gender and article ("it") are set
  • Default container properties are set - by default the object is not a container, cannot be opened or closed, etc. This is just for convenience really - if we didn't set these in the default type, then properties such as "isopen" would default to null instead of false, which would make the container logic messier. (An enhancement might be to add special logic so that in an expression "null=false" would be true, but I'm not sure how good an idea this would be - I'm open to feedback on this)

"Undo" support in Quest 5.0

17 February 2010

Over the years one of the most commonly requested features for Quest has been the ability for the player to be able to type "undo". This would have been difficult to add to previous versions of Quest, as the game state was stored in a number of different ways, but in Quest 5.0 the entire game state is stored within object properties. The location of objects is a property, global variables are properties, and so on. This makes it much easier to enable support for "undo", and from the start Quest 5.0 has been written with this feature in mind.

Every change to a property is internally logged, which makes it easy to go backwards and undo changes on a turn-by-turn basis.

Core.aslx defines the "undo" command, which simply calls the script command "undo". This gives the player unlimited access to the "undo" command, but you could override this in your own games to set certain conditions for undoing. Perhaps you would disable undo in certain locations by setting a certain property in the player's parent room, or maybe you would set a limit on the number of times the command can be called. Any of this is easily achievable by creating the appropriate script around the "undo" command.

Monitoring changes to properties

If you want some script to be triggered whenever the value of property "X" changes, you can add a "changedX" script property.

For example, when the player moves, the value of their "parent" property changes. This means you can call some script when this happens by setting a "changedparent" script property for the player. This is what Core.aslx uses to trigger the printing of the room description:

  <object name="player">
    <changedparent type="script">OnEnterRoom</changedparent>

This calls the "OnEnterRoom" function every time the player moves into a different room.

Another way this might be useful would be if you had a "health" property for the player - you could create a "changedhealth" script which would finish the game if the health value reached zero, and maybe also set a maximum value.

All Posts