Diary Of A Madman #3

In those rare occasions I go out to the streets, people ask me about the status of Asylum. Shady characters in dirty coats most of the time, lurking in the shadows and speaking in whispers. They could be a product of my imagination (after all I can never see their faces, provided they have one) but I always respond them for the sake of politeness. I mean, imaginary people deserve respect too. But I’m going to assume that you’re real and want to know about the status of… What was I was talking about?

Right, Asylum. As you can imagine, it’s been a very busy period for us, and there’s so much to tell that I wouldn’t know where to begin. Perhaps the most important news is that the game has gone semipublic and people had a chance to actually play it. In other words, it exists. More specifically, we featured an early build in a local fair and visitors were able to walk without restrictions around a sizable portion of the first floor of the Hanwell Institute. The reactions were very positive and, even though the mood is kind of lost when you’re in a big room with dozens of people and loud noise, they were all clearly impressed. The game was shown on two big HDTVs and graphics still looked sharp and detailed, so I’m not lying when I say that Asylum really, really is high-definition.

Here, I have a blurry and completely useless picture to prove it:

Asylum @ MICA

Anyway, back to the inner workings, last time I spoke about the video system that was finished, enabling us to populate Hanwell with dozens of lively videos. Since then we have completed the first floor, which is the biggest one and therefore a very important milestone for us. All the doors are now animated as well and, if you’re familiar with Scratches, you’ll know that represents a great deal of work. It’s almost fifty videos of doors opening in the first floor alone, along with beautiful animations of the ocean waving through some windows, faulty lights, moving trees, water in a fountain and inmates inside the cells of a truly sinister corridor. And we’re not even done yet. When put into perspective, the sheer amount of work makes me want to cry.

How do we manage with all this? Well, in the first place, loads of coffee and illegal drugs. It also helps, as I hinted before, that the scripting language of the engine is deceptively simple. I’ve already told you a bit about the process of creating nodes. Now, here’s a quick glimpse of the process to create what we call a “spot”. It’s not a “hotspot” because it may not be interactive:

door = Spot.new(WEST, {64, 424})

This means we create a spot object named “door” on the west face of the cubemap and we give it a set of coordinates, in this case just the origin. The vectors of coordinates can be of any length and shape, so it’s completely freeform (the engine itself makes sure it’s a closed region). And before you ask, we’re working on a tool to easily draw regions directly on the cubemap. But let’s stick to the basics for now. So, why do we give it a single pair of coordinates? Because of this:

door:attach(VIDEO, “vid_door_corridorb_hospital.ogv”)

We attach (and that really is the meaning of this action) a video file to the “door” object. The engine calculates the size of the video and resizes our previously created spot accordingly (with two coordinates, it was a single point). This saves us a bit of work as we only need to worry about placing the video properly. For now we support Theora for videos which is open source, lightweight and very fast. It has proven to be a powerful format (with a sucky API though). Overall, this is a very straightforward process to include videos in our nodes. But wait! Games need audio too… So:

door:attach(AUDIO, “sfx_door_large_open.ogg”)

Which I think speaks for itself. Suppose we want to make that spot interactive as well:

door:attach(CUSTOM, from_corridorb_to_hospital)

This links a custom action to this spot, effectively making it clickable. Now the only task left is to add this spot to one of our nodes. The entire chunk of code would look like this:

door = Spot.new(WEST, {64, 424})

door:attach(VIDEO, “vid_door_corridorb_hospital.ogv”)

door:attach(AUDIO, “sfx_door_large_open.ogg”)

door:attach(CUSTOM, from_corridorb_to_hospital)

corridorb1:addspot(door) — Our previously created node

Easy peasy. And the contents of that custom action (in reality a Lua function) could be as simple as this:

function from_corridorb_to_hospital()

door:play() — This plays both the video and audio attached

switch(hospital1)

end

Do you like the approach? Are you excited? Are you still awake? We think this is an equally intuitive and powerful method, combining many aspects of coding into one single concept: the spot and stuff you can attach to it. We’ll go over a few more options in future episodes of this exciting diary.

What next? We’re preparing a big update to our website in which we will finally reveal the new name of the engine, along with the first gameplay video of Asylum and “official” batch of screenshots. I’m committed to keep a good pace of updates from now on… Yes, I can be that naive.

Tags:

13 Responses to “Diary Of A Madman #3”

  1. Aaron Lopez says:

    I like the approach. I am excited. At the same time, for a person like me, any sort of programming jargon scares me far greater than an ancient African god’s curse. Perhaps I should pretend it’s just another “beautiful” language like French or Spanish.

    And good luck keeping a good pace in updates. I tell that to myself everyday too. I once had a 150 day gap between one post and the other -_-.

    Must be the way we creative people work =P

  2. Agustín says:

    Well, there’s been some research on “natural speech” programming languages (see Inform 7, for example) but for recurring tasks such as creating nodes and adding media, they would be extremely ineffective. Think too verbose for nothing. So, we’re left with a minimal and concise instruction set — it really is for the best :)

    And yikes, a 150-day gap. I think they would hang me if I pull that one!

  3. Nuxly says:

    Great news :)
    Do you think you’ll be able to release Asylum by the end of 2011 as announced in the trailer?

  4. Agustín says:

    That’s a very good question… Indeed, a most excellent one!

  5. gnome says:

    Besides my obvious excitement Asylum, I’m now so very interested in the engine. Seems actually usable, even by gnomes like me.

  6. Nick says:

    Man, if this game won´t fright me, I will hit the roof! :D Every day i am getting more excited… :)

  7. Sean C says:

    That is a very neat and concise language, object oriented programming at its finest. Defining the “door” variable to be a certain node makes it a lot easier to keep track of what variable is what object within the game. The way you are associating certain files to a certain node with “attach” is awesome as well, the less commands that one needs to remember and the more user friendly, the more efficient he or she can be. However, I am curious as to where is it that you define where the .ogg and .ogv files are pulled from. Also do you use prototype headers for the language to know to jump to activate that function?

  8. Agustín says:

    Glad you like the approach, Sean! Yes, I tried to stick to an OO paradigm as much as possible. I believe the “attach” command will be a killer feature for many because you can do LOTS of things with it, and you only have to learn one syntax. The technique has proven to be very powerful for now with no apparent caveats.

    You can actually set any folder you want to be searched for files. Plus, you will be able to collect all the assets into a single file when you’re ready to deploy — we call it the “catalog”.

    No prototypes are needed but you have to make sure that the functions you’re referenced have been declared first. It’s not as annoying as it sounds though, we already have generic “templates” to create rooms, objects, interactions, etc.

  9. Sean C says:

    Very nice, as every copy of the game will need the “catalog” to produce the video and sounds when need be I can see how this would be very convenient. Thank you for entertaining my curiosity. Its really awesome that you take the time out of the busy schedule you and your team keep to talk to your fans not only about the game but the development of it as well. Helps to increase the appreciation for games beyond the playability.

  10. Sean C says:

    “Shady characters in dirty coats….” sounds like Night Gaunts from the Senscape forums to me. :-)

  11. Areala says:

    You know, the more I think about it, the more fun I think it would be to see Senscape products “ported” to Inform 7. “The Lurking Horror” creeped me out the first time I played it…with writing good enough to convey the atmosphere, I see no reason why a text adventure couldn’t be just as fun. :)

    Says the girl who couldn’t make a computer say “Hello World!” without two hours of tech support and a bottle of aspirin…

  12. Agustín says:

    You might be interested to hear that I once had plans to do a short IF prequel of Scratches. Of course, that takes time, and time is exactly what I don’t have :P

  13. Sean C says:

    It would be a very interesting concept to play as James Blackwood, acting out the events that transpired with his family. Being a fan of the Resident Evil series, I love my backstory. :-)