27 August 2008

Waylaid

One of my friends proposed a project to help us play Pen and Paper (pnp) Role Playing Games (RPG) online with so we can play with some college buddies. This application will be a good learning experience if I ever want to do multiplayer for World Quest.

I will have more one the details later, but think of it as a chatroom plus art collaboration tool. For my first iteration I do not want to make it overly complicated or tie it to any specific game system, though it will be D&D 3.5 for our first jaunt.

20 August 2008

Dialogue 2: Electric Boogaloo

After much consideration I have decided the best course of action is to create a domain specific language to represent conversations. The main reasoning behind this is I need control structures, and to do that in XML is too much of a kludge.

Choosing this path adds a whole new complexity to this project, so I want to choose as simple of a language as possible. It will be designed for use in this game, and thus may lack a lot of language features, as well as possibly not being Turing complete. In addition, it will have built in types conducive to creating dialogues and other game scripting features.

At this point my main contender is the infamous Lisp. While it may be unfamiliar to many, I believe it will help keep the complexity of the World Quest code base down. We shall see.

This will be my first time creating an interpreter for anything resembling a language, and my first time outside of school in parsing a language. That means this may take a long time, with many possible rewrites. To help keep this blog moving I plan to work on the combat/spell/effects system next.

07 August 2008

Dialogue

In a Computer RPG there are two main forms of Player-NPC interaction: combat and dialogue. Today the focus will be on dialogue. Dialogue is basically a one way graph (can't go back unless looped around) with path choice restrictions (race, guild) and possibly changing one or both parties in the interaction (removal or granting of items/xp/skills). Overall some rather complex things can happen over the course of a dialogue and the challenge is to create a systems that can be represented not only in code, but in a way that can be created and maintained without modifying base class files.
The idea I have is to create a graph of Dialogue objects with a distinct head and each one with a list of possible responses. Sort of like this:
NPS: "I have something interesting to say."
Option 1: "No you don't" -> goto dialogue 3
Option 2: "Yes you do." -> goto dialogue 4
Option 3 (only if Race=Goblin or has item sword): "I am Eror" -> goto dialogue 42
Option 4 (only if not Race=Goblin): "Goblins drule!" -> end
Then if the player chooses 3 dialogue 42 is displayed and any actions contained within are executed (remove sword).
The problem is complexity and representation. The two paths I see are XML or Scripting Language, each with their own advantages and disadvantages. XML is standard and easy to implement, but can get convoluted when you want to represent complex dialogue graphs. With Scripting Languages complexity is easier, but you have to make your own interpreter and language definition/sub-definition to craft an Application-Specific Language to drive your dialogue. Currently I am leaning toward the XML, but I may re-evaluate my stance after a first cut implementation.
Look forward to my next post 'Dialogue 2: Electric Boogaloo: The Game: The Movie'.