Friday, February 23, 2007

Baby lisp


So the rpg has come on a little bit. I really ought to come up with a name at some point. For now, it stays RPG Zero.

New since the last update:
  • Tried to refine the look of the thing. I'm going primary colours, sharp contrasts, simple forms, abstract surfaces and everything easy to put together quickly. Also leaning a lot on vertex colouring for the low frequency shifts.
  • Our protagonist can now be hit by badguys, and keeps track of his health.
  • First blush at a HUD, and UI framework to back it up.
  • A chest! What's an RPG without a treasure chest, eh?
  • Refactored the player control to remove some annoying kinks, like sliding while idling.
  • Wrote a *secret* story outline!
I mentioned last time that the scripting language in this thing was a bit... odd. Well, here's a look at what a typical dev session is like.


Seem oddly familiar? It's not really lisp, but it does share some characteristics with it. Chiefly: code is data. I can pass it around, chop and change it, store it and call it later. The scripting language is interpreted, which means it inherently has the ability to inject novel code into the currently running session. Godsend that, when working on a game. No compile waits, you're right there, in the game, where you can see what you're doing immediately.

It's called Stutter.

It's implemented as a runtime interpreter that is plugged into a reflection based dispatcher. I have a class that contains all the intrinsic functions. I then have a few intrinsics for dealing with .Net types directly, cnew (new a C# object), cset and cget (set/get properties or fields) and call (invoke a C# function). These are for... well cheating. My character entity for instance, is a C# based PhysicalObject, that gets initialised and bandied about by Stutter, but lives in the Game.Components update loop.

Why not real lisp? Well, I couldn't find a handy implementation, and I've still a lot to learn about building and implementing the support for an embedded language, so it seemed like the right time to learn. And the right time to experiment. I've taken the things I like about lisp, and screwed around with the formula to give me the things I've always wanted for games. Will it work? Will it be fast enough? Will it be expressive enough? Who knows? That's the whole point of trying.

I did mention this whole thing is one big bout of self indulgence, didn't I?

P.S. Today's vid is higher res than the last one, so you might want to click on over to the bigger Google Video player to see it. Today's music is Billy Bragg and Natalie Merchant doing Way Over Yonder in the Minor Key. Totally love that tune.

3 comments:

Karl Fredberg said...

This RPG of yours is coming along very nicely. I like the clayish style you got going.
Do you do all your art work as well?
Can you explain what techniques you used to make the animations work in XNA?
Will we ever see a code sample of this?

Keep up the good work, your blog is the must interesting XNA blog at the moment.

Gamey Little Hacker said...

Thanks Karl. Yeah, it's all my art as well. In my professional alter-ego, I'm an artist by trade, so I come well equipped for it.

Animations... heh heh. Well that's a bit of a sore spot. Truth is I haven't written anything for animation yet. I saw that there were a bunch of community projects already on the burner but not quite there, and I've only just done the whole animation thing at work *again*, and I and I haven't had a chance to get into any content pipeline stuff, and I really wanted to get somewhere quickly, and so I got a little bit lazy and...

It's just mesh animation. As in, there's a mesh. Per frame. It's so old school, it hurts. But it was quick and dirty and got me to working on the parts I care about quickly. I may replace it with proper skeletal animation, I may just write an optimised content processor for it. I dunno yet. It's currently a contributor to the claymation look, so it may stay.

As for code samples... I may release the whole thing when I'm done anyway. As long as it doesn't become even more embarrassing along the way. I have a career to think about!

Ultrahead said...

"Keep up the good work ..."

Bump!