Living World Productions
Video Game Blog

April 07, 2019

As I work on other things, I've been pondering-tinkering mentally with how I am going to manage "Quests" / "Stories" within the game. I tried researching the topic online of course, but the long list of pretty dammed vague answers had little to no technical explanations.

So...I ponder more on my own than listen to things that lead me down paths that are not helpful. In a total "thought time" of perhaps six minutes...I think I came up with a pretty good idea.

This is going to get a little technical, so for those who don't know coding, it will be like "Huh?..."

Okay. First off...I have to make a system that is; a) generic, and b) flexible. Stories and Quests, when you want to make one are variable in every aspect. Plus, if I were to make an editor for Users to make their own Quests later, there's no telling how long they would want to make it. Not to mention trying to get it to tie into the game's World Map.

To give some technical terms to this... Quests have a series of Events that have to be fulfilled to consider them complete. These are basically either "True" or "False" situations. I could have a Linked-List of Boolean values (which hold the True/False status). This is kinda inefficient considering individually they take up more memory space than they're worth.

My choice is to have a Linked-List of Integers (a.k.a. numbers). They take up the same memory size as Boolean value. Booleans, as I said can only hold a True or False "status"...but Integers, through manipulating the individual bits of the memory location, I can set to either 1 or 0 (a.k.a., turn it on or off). Get it? On or Off is the same as True or False. The thing is, with access to the whole memory location on a 32-bit system, I have 32, True or False statuses... This could be expanded up to newer systems that are 64-bit. You get it...

For those who don't know...a Linked-List is a system in programming where I can make a list of something on the fly, add elements to it, remove elements, etc. So as a User adds situations, rooms, etc to their adventure the editor I will make will detect how many of these there are, divide by 32 and then create a list of Integers that will have a manager that will turn the bits on and off accordingly as the User plays the scenario.

One big issue is to make sure that when a Use creates a new scenario that the system doesn't over-write previous scenarios. So, taking a lesson from Database Management, unique Keys have to be assigned to ensure each new scenario is different from the others.

So, I will create a data structure known as a "Class", which will hold a decimal numeric value as the "Key". This will also be the file name to load from the hard drive. Then there will be a 'pointer' to either a map location or NPC (Non-player character) who has the starting point for the scenario. This is actually two pointers...one for a Map Location, and one for an Avatar. Depending upon the desired choice, both would be available for assignment. Hell, they can be combined in usage by saying "The Avatar, at the x- y- location". Perhaps I should also add a pointer to an "Item"...which could be a scroll giving an introduction to the adventure. They it would be, "At x- y-, you will find the Avatar, holding a scroll that triggers the start of the adventure".

Then a linked list of data nodes (which are another class I made), would hold a Linked-List of Rectangles to see if the User has walked within its dimensions on the particular map, sets the True/False to true. This could lead to all kinds of things happening...like: step on a brick, set off the trap, step into a room, make the monsters angry (and you won't like them when they're angry!). Users eliminate the monsters and take another item, perhaps a key to unlock a door further into the scenario.

Each one of these nodes of course need to have a variable to hold the text that will be displayed for various reasons. Monster dying: "Oh lord! Help me! I'm dying! I'm dying!...gasps last breath...".

Yes, this sounds like a lot of work. It's actually rather simple to code. But, this brings up something else that I've been pondering. Detail, Sprites, Sounds, etc.

I'm allocating nine months to this project. For me to do it by myself I have to weight how much work will go into each component of the development.

For instance, I was able to download free .wav files for sound effects. It's simple to fire these off to coincide with actions or events. So those will get included.

Graphics on the other hand will take a lot more time just by themselves - to animate the Avatars for each action they can do would take way more than nine months. I could download free sprites from other sites, but their style of art rarely match well enough to be worth using. So I am just going to go with portraits of characters and monsters. Perhaps the full image of a character floating around as a Paperdoll - which is pretty much one-dimensional. At least it wouldn't hold back the project too much if I do it this way.

Okay, enough talking for today...back to coding