Sunday, October 4, 2009

Dynamic Quest Generation

So, while I'm thinking about it, I'd like to talk about something called "Dynamic Quest Generation". Many people have heard of it. Many others have asked for it. I'm here to discuss why it is feesible, and why it is not.

So, as far as making a system to do this, I can say with 100% certainty that it not only is possible, but it could be programmed by an undergrad student at university. In fact, a group of students in the CS Department here did do just that. I did that at one point as well. The core of the system was these classes:

  1. Quest class - Represents a quest, its goals, its preconditions, postconditions, rewards, etc. Can also encompass multiple quests (quest chain, etc).
  2. Goal - Represents an abstract goal type for a character to achieve. Can encompass complex goals, such as doing multiple parts of a quest, etc.
  3. Precondition - Any precondition required for beginning the quest (level, certain item, etc).
  4. Postcondition - Any artifacts that occur in the world as a result of the quest (level, area change, changes in people, etc).
  5. Rewards - I made this separate of postconditions, in that rewards are what only interact with the completing characters. This includes things like experience gain, item gain, alignment shifts, etc.

Now, using these, it is possible to create a completely random and logical quest system. But does anyone see the main problem with this? If you look hard, we have everything to dynamically create quests, except for one thing: Dialogue, Narrative, etc.

So, you may think that is the easy part. But in truth, for a system like this, that is the hardest part to accomplish. For example, it is very easy to create something like this:

"Go kill ten flying monkeys. Then fetch my ruby slippers. Then come back to me. I'll give you ten gold and a shovel. Then help me bury Toto. I'll join you."

However, it is much, much more complicated to create something like this:

"Oh, I really need your help! The flying monkeys of the horrid wicked witch have gone too far. They killed my dog, Toto! Even worse, they ran off with my ruby slippers, and I am stranded here without them. Could you please go and kill all ten of those horrid monsters and bring back my slippers? I'll reward you with all the gold I have and the Tin Man's shovel. Please, I'm begging you!"

"Oh, thank you for returning them to me. I am ever so grateful. If you could be so kind, could you do me one last favor? I was going to, but I just don't have the heart to bury Toto."

See the difference?

So, in all of those, I bolded the actions required to complete certain stages of the quest. You need to kill the ten flying monkeys, fetch or bring back the ruby slippers, get the reward, and then bury Toto. The specific objectives I underlined, as with the number and name of the creature to kill, what you needed to fetch, and what you received as a reward. All of that content could be replaced very easily in both instances. However, the problem goes with randomly creating the second piece.

If every NPC had that exact same dialogue for this type of quest, it could get really old, really fast. So, I could expand it to being 2 dialogues, then 3, then maybe X per race, Y per gender, etc. The point is, no matter what numbers I choose, eventually the system will become stale. Hence, we really need to randomly create quest narrative to solve this problem, but also do it in a believable manner.

Hence, the idea of random quest generation is really solving 2 problems:

  1. The first is to solve the problem of building the quest.
  2. The second is to solve the problem of building the narrative.

The harder of the two is most definitely the latter. To solve that, you would need a narrative engine for creating your quests. Even more so, you would need it to be flexible and update-able with new quest types, new dialogue and item entries, etc. Lastly, everything in it would need to make sense, contextually, for the game. And even after all that is done, you would need to update the narrative options, as any system is bound to get stale after a while. Add on top of this multi-language support, etc, and you can see the issues with this.

S, that is my rant of random quest generation. I think the idea has great promise, but at the same time, as players and designers, we need to really note what is the meat of the problem. It is not in assembling a quest, but in making the quest believable.

Thursday, September 24, 2009

Neverwinter Nights Mod: The Scrolls of Taz'Azarak

So, I am officially announcing the name of the mod I am working on today. I have decided that I am going to create a mod based off a much more well defined adventure I created and played with two of my friends from high school that they thoroughly enjoyed.

The premise of the story is that the adventurer's must get back the legendary Scrolls of Taz'Azarak. These scrolls each possess an amazing amount of power, as each of them holds some of the lost wizard's abilities. The whole time, they are racing against some unknown foe who is also seeking out the scrolls, trying to gain them for himself. No one is sure what power the scrolls possess, but what history details is that the old arch-magician had gained power over shadow, being able to bend it and use it to his will. However, the power was costly, ultimately taking the wizard's life. In his last days, he wrote a warning to all, telling them that the power of the scrolls should never be used again.

And with that, I bid you farewell.

Thursday, September 3, 2009

Engine Updates, DirectX 9, and Mods

So, after doing a lot of research for several days, I have had to redesign several key aspects of the bindings I use for the ILEngine for DirectX 9. Much of this comes from memory and content management, done through DirectX 9, due to the inherit connection between content information (textures, etc) and device context, which is horribly efficient for speed and drawing, but a pain for keeping references tidy when allowing switches between fullscreen, windowed, and resizing. Hence, some work on the engine has come to a crawl until I find a creative way around this. So, until then, I may just stick to creating the application framework for DirectX 9, allow for full modification of the window, and then worry about the rest later.

So, as for the mod, I have been swaying back and forther whether to continue using Neverwinter Nights 2 and its toolset, or to use Neverwinter Nights and its toolset. This is mainly because, for Neverwinter Nights 2, there is not a lot of community content and tools available while for Neverwinter Nights, there is a huge amount of custom content and tools available for creating your own mods. Still trying to weigh this decision more thoroughly on the scripting applications as well.

Wednesday, August 19, 2009

Game Design Patterns / Rules

Well, as with my last post, this post focuses on patterns and rules for game design. Note, that all of this in many ways is common knowledge to any decent writer or programmer, but I wanted to write something about some internet browsing I did the other day.

So here is the first of the links:

Game Interaction Design Patterns Library

This link will take you to a small and quaint page describing the basics of what the page is for. It will describe what a pattern is, etc. It then has several links. This, in my opinion, is the meat of the this small site. Each of the links (the ones which are not outdated or broken mind you) will take you to a site that discusses patterns, namely "interaction patterns". Now, for the standard software engineer or designer, this may not have any bearing to you. So, here is what an interaction pattern is (referenced from Wikipedia:

"Interaction design patterns are a way to capture optimal solutions to common usability or accessibility problems in a specific context. They document interaction models that make it easier for users to understand an interface and accomplish their tasks."

So, what these patterns often provide are common UI solutions and HCI (Human Computer Interaction) solutions for dealing with and interacting with user input and feedback. There are many more links and better resources out there for you, just read the Wiki article or visit some of the referenced sites from the first site posted. With these, common UI tasks and design you may have been thinking of but didn't know if it would work well (both aesthetically and in usability terms) can be solved for you, leaving you just with the means of implementing that solution.

So, the second site I found and got a kick out of, which is also referenced from the first site, is this one:

Current Rules Master List

This site goes over a list of 400 rules (really only 112 currently) for game design. Now, you may wonder where this comes from, and it is in fact explained very well on the site. The idea was that if 400 unique rules could be created that described everything needed for game design, then game design could be "closed" under those rules. What closed means is it could be fully described, discussed, and elaborated on, as with what closed means in discrete mathematics.

While many of these are common sense based or the basis of basic creative writing and player interactions, they are a good reference for any game designer, as they do actually cover many interesting and varying rules that can be applied to various aspects of game design.

Tuesday, August 18, 2009

Why Not Common Programming Patterns?

So, I was reading an article today which piqued my interest, in some ways disturbingly:

http://m.computerworld.com.au/article/314817/nicta_wins_race_secure_l4

Now, the article sites a grand achievement for a micro-kernel, especially for one focused on security. That is not my problem. The line in the article that says this was a problem for me, however:

"For example, the microkernel is impervious to buffer overflows, a common form of software attack where hackers take control of programs by injecting malicious code."

Now, I know what you may be thinking: yeah, that's great. So what?

Well, I am in many ways appalled that this is still one of the major programming security problems to date, especially since it goes back since programming first started in many ways. So, I did some research to actually see how big a problem this still is.

Turns out, if you look up buffer overflow on Google, Bing, Yahoo, etc, you end up not only getting the Wikipedia definition and status of it, but you also get tons of security firms trying to sell you solutions and training to handle this problem. And the majority of these errors comes from a single aspect of the software: lack of proper boundary checking and the size of data being written to the buffer.

Now, having gone through multiple programming courses, with focuses on Java, C, C++, and many scripting languages, this is horribly surprising that in my recollection, we never once really touched on handling a simple situation such as making sure your buffer is bounded and checked correctly.

So, this got me to thinking: shouldn't there be, at least in pseudo-code somewhere, be some list of programming patterns or such for something like this? Maybe some actual class / object patterns for this, etc?

It turns out there are, but most of them are locked in some obscure text books or completely out of the way or unrelated websites. Such as, there are patterns for a Fixed Size Buffer for Real-time Systems (example here). However, like most of these tidbits of knowledge, they are either obscured to the specific domain in which they belong, making them inaccessible to many programmers and engineers, or they are just described and no actual psuedo-code or structure is given for ideas.

So, I ask my question, why not have some common programming patterns, that everyone can find, interpret, and use?

I personally may start amassing a few of my own I've used quite often and start noting them down here and there. It may be worth someones time, and eventually, it could be compiled for more people to use.

If anyone has any ideas on some good patterns that may match this, shoot me a comment or an email, and I'll make sure to note it. I really think this is something that could be helpful to not just new programmers, but to even older programmers who often have to re-invent the wheel or remember how to do something nifty and elegant, yet simple, that they did before.

Thursday, August 6, 2009

Neverwinter Nights 2 Mod - Lands of Neremier

So, I've finally gotten around to working on a mod I've been planning. I originally started the the mod concept when I bought Neverwinter Nights: Platinum Edition. However, it was a while afterward that I finished most of the design planning on my limited schedule, by which time Neverwinter Nights 2 was just around the corner. So, I waited to that I could try the new Electron Toolset. Once I got knee deep in classwork and working co-ops, this got pushed to a back burner project, which I finally started formally yesterday.

So, I've begun working on the areas for the first few areas of the mod, doing some pretty extensive design work on the first areas of the mod where the players start. I will try to post some screenshots of the current areas when I get some time and may make a section of my portfolio on my site dedicated to my Neverwinter Nights 2 mod.

Sunday, August 2, 2009

New Opportinities - Working on Gaming Articles

So, in the past few weeks, I've been working on a new job I've gotten, which is for a website called FreeMMOGamer. For the site, I've been hired to work on review articles, opinion articles, and anything that comes to mind (with approval of course). Hopefully, in the next few months, I'll have several new articles published here, which will give some of my opinions on current and upcoming MMOs.

For my articles, I'm also thinking of adding a little bit of a developer perspective, to give the articles some new flare and perspective, which will be unique.

We'll see how this goes.

About Me

Software engineer, game developer, writer, and student. My work revolves around games, algorithms, real-time development, and creative works.