Random notes

Note 1. I’m pretty sure WP’s blog stats don’t tell me when someone visits the front page, only when they visit a certain article. How odd.

Note 2. A great part about trying to work on an overly ambitious thing like a game means you get lots of ways to distract yourself by working on another part of the code. In this particular case, I don’t really feel too much like working directly on the program but still want to feel productive, so when that happens I usually make a “bubble” of a feature–that is, something that can be self-contained and implemented outside of the actual Graff folder, and moved in later. Map generation, text, cfg parsing, and a few other things were first implemented that way previously, and that bit of obfuscation will have begun that way as well.

In this case, I’ve worked out a suitable way for getting dialogue done. Currently it runs through the terminal (print statements and so on), but I have a framework that works. It’s not that complicated to describe so I won’t go too far into detail, but I have a file whose structure is like this:

<NPC text>1 2 3

and repeat for each statement/response. is for NPC text, [] is for player response text, and numbers point to the lines in which the response can be found in the file. Then, one can simply open(file), and say X = file.readlines(), and then (with some Str.split() and slicing), one can extract a certain line of text with just a call of Str[line #].

The problems are, first, the file becomes cumbersome after enough dialogue, but I’m not expecting to make a Planescape: Torment-sized set of dialogue so that shouldn’t be an issue. Second, editing is always cumbersome: if, say I want to add in a response I need to go over every number in the file and change them accordingly, or add the response at the end of the file, at which point things just get rather messy. I can hopefully mitigate this by just limiting the amount of dialogue; next release will include a sample NPC to talk to (hopefully) that might show the extent of the talking going on in this game. Third, memory could theoretically become an issue later on, again if the dialogue gets too big.

Note 3. Hot weather with no air conditioning = Hard to think. Eugh.

Note 4: I’ll upload the dialogue tree example when I release 0.0.8–or maybe before that if I call it release 0.1.0 depending on how much I get done by then.


One Response to “Random notes”

  1. And now for something different. « Project Graff Says:

    […] that could then be inserted into Graff as a whole at a later date–I’ve talked enough of dialogue systems, and I’ve got an idea I’m currently kicking around my head to work on some new […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: