Tuesday, April 22, 2014

Dev Log: Horror Text Adventure #47

I started a to-do list of functions and classes and things I've begun but haven't completed yet, so I don't forget them and then redo them and have extra code later.  I also added some long-term goals of the project (like multiplayer functionality which will be a while before that gets implemented), as well as other major mechanics that must be implemented but I haven't started yet (keys, puzzles, etc.)  I'm sure this to-do list will spiral out of control soon, as I keep coming up with more and more to accomplish, but it will feel good every time I get to delete something off it.

I also went back and reread the first few dev logs of this project, mostly to look at the notes and add any big-picture stuff to the to-do list that slipped my mind.  Well, going back and rereading it revitalized me a little bit.  I forgot lots of things!  This will certainly end up being far more complex than just the little basic things I've been working on so far, and that gets me excited to work deeper on it.  Getting little things like plurals to work properly is a mind-bending enough task on its own, but to get particularly big mechanics in like the multiplayer functionality and puzzles and stuff will be a deep challenge (and hopefully a fun one).

On Easter I did a bit of yard work, and it seems like my mind thinks about this project a lot when I'm raking.  Thinking over the old notes and what the scope (and for that matter, theme) of the game should be, I've come up with what I think is a great direction to go.  When you think about this as being an allegory of growing up, you wonder, apart from the other players you meet in school (common zones), what about adults?  Why are there no adults at all?  Well, what if the player is a latchkey kid?  A latchkey kid is a child who comes home from school to an empty house because both parents work.  So what if that's basically the commonality between all players?  Each player is a latchkey kid, and the puzzles of the game revolve around self-reliance and learning to occupy your time or figuring out the world on your own, because your parents aren't there to help.  Each player's situation is different, but there are enough commonalities that players can still give general "life tips", as it were--tips on playing the game.  Clues can come in the form of notes or answering machine messages from parents as to what to do to solve puzzles.

I think this is a really interesting way to go about things.  Hopefully I can subtly add this layer of story and symbolism into the game without getting to pushy about it.  In the meantime, of course, just getting basic mechanics to work is the first step.

Tuesday, April 15, 2014

Dev Log: Horror Text Adventure #46

I shrank the draw and erase commands by a fair bit by finally making the general findItem function.  It basically just looks through an item vector (the player's inventory, or the room's), and compares the name of the item with a pre-defined string.  That is sure to come in immensely useful in many other commands later.

Next, after seeing a Dwarf Fortress update where I got to see some of the code, I noticed Toady One had plural versions of the names of his plant life, etc., as well as adjective versions.  That struck me as pretty interesting, so I'm wondering now if that's the best way to handle problems with English, like words that don't follow plural rules.  So rather than creating some silly functions that pluralizes things and figures out the exceptions and all that, why not just add a variable to each item with a plural version?  Then as the player looks around the room, it's far easier to say "there are two beds here".  As it is, I've already created an item with an exception (the plural of "chalk" is "chalk", or "piece of chalk" becomes "pieces of chalk").  So I've added a plural variable to every item, and started to make a function that finds out how many instances of each item are in a room.  That's a bit more complicated than it seems at first glance.  I've gone through two iterations to figure out the best way to implement it, but I'm still having some trouble.

Next log...

Tuesday, April 8, 2014

Dominion: After Dark Part 9 - Suggested Sets

I came up with a few suggested sets from various Dominion expansions:

Using vanilla Dominion:
Night of the Living Dead: Cellar, Council Room, Militia, Laboratory, Village / Midwife, Seance, Wendigo, Werewolf, Zombie

This one's got quite a few attacks, but otherwise fairly well-rounded.

Using Dominion: Seaside:
Lonely Islands: Ambassador, Explorer, Island, Outpost, Salvager / Banshee, Hanging Tree, Hunchback, Knocker, Ripper

The tough part about this one is that nothing gives you additional actions!  Purchase carefully!

Using Dominion: Alchemy:
Curse-iosity: Alchemist, Apprentice, Familiar, Golem, Scrying Pool / Folklorist, Goblin, Graveyard, Midwife, Physician

You can tell the theme from the title on this one.

Using Dominion: Cornucopia:
Upstarts: Fairgrounds, Hamlet, Tournament, Young Witch (Bane Card: Fortune Teller) / Angry Mob, Blood Pact, Con Man, Hideaway, Voodoo Queen, Zombie

This one is pretty attack-heavy. I also like the idea of having the Witch's Bane be an attack itself.

Using Dominion: Dark Ages:
Graveyard Shift: Cultist, Death Cart, Graverobber, Junk Dealer, Rats / Campfire, Ghost Town, Goblin, Graveyard, Ripper

This one, like the theme of Dominion: Dark Ages, is heavy on trashing.

Test them out if you have the expansions, and let me know what you think!  I'll work on modifying these and coming up with more to have a few suggested sets with every combination.  Also, if you come up with any other fun suggestions, leave a comment and I'll test it out!

Tuesday, April 1, 2014

Dev Log: Horror Text Adventure #45

I previously had not taken into account the possibility of more than one of the same type of object in a room, so I've been working on making adjustments to the code so if there are two chalkboards, for instance, you can draw and erase on both of them.  Right now it only picks the first in the list, and once it's full, you can't draw anymore or choose the other chalkboard to draw on.

To make that work, first came a little restructuring to recognize that there may be more than one object in the room of a given type.  So I switched a few single item variables into arrays to detect for erasable items, so more than one erasable item could be erased, instead of just the first.  Doing this was handy because it actually removed the type warnings I was getting when I compiled.  So that's one thing I never have to see again.

While I did that, I removed the for loop breaks so the loop doesn't stop when it finds the first possible item in the list, but keeps going to get all of them.

Next, I did the same with the draw command.  At this time, there is no change for what the player does, it's just set up for later when I fully implement it.

I also made it so the player can say "move north" or "go north" or whathaveyou, but can also just give a direction (just "north") and the player will move properly.  Actually, with the way the parser is currently set up, I probably don't even need to specify the words "move", etc.  But I'll keep them for now, in case something else at some point requires a direction as part of it's command (like "look up" or something might later give a description of what's above).

I also made a repeat command.  Now the player can type "/r" and their previous command will be carried out (as long as it's a verb command, so you can't just spam the chat with a long message a thousand times).

Lastly, an invalid command will be repeated in the error box so you don't have to look two places to see that you made an error and then search for what the error is.

Part 46...

Tuesday, March 25, 2014

Dev Log: Horror Text Adventure #44

You can now erase the chalkboard, assuming an eraser is nearby.  It's practically the same function as the draw command, in terms of searching for the items, like the eraser, the chalkboard, and what the player specifically said to erase (that last one will still ne implementation; for now you erase the whole chalkboard).  I wonder how many times I'll make very similar functions before I figure out a way to turn them all into one function.

Making an erase function is actually very involved; a lot more so than I'd have thought.  Actually erasing the chalkboard is just one line, but checking to make sure everything is in place to do so is the long drawn out process.

Now that a classroom might have a few objects in them (chalk, chalkboard, eraser), I also added the possibility of having a classroom during the random creation outside of the school common area.  I think I've lost the chance of random rooms having their types influenced by the surrounding rooms during creation, so I'll have to reimplement that.  I guess code goblins took it.

Next I finally restructured the parser a little so you can type in any case.  I had thought it would be a pain, so I had put it off, not knowing there is a toLocaleLowerCase function built in to AS3.  So much gets taken care of in this language, it's just lovely.

I also cleaned the draw command a little bit so now you only draw what comes after the word "draw".  Before it would take the entire string except for the word draw.  For instance, if you had said "I draw a flower", then the chalkboard would have "I a flower" on it, but now it only has "a flower" on it.

I fixed a silly bug where when you typed a chat command you would get the error message "no command recognized".  That happened from an earlier change in the way verbs work, but I hadn't noticed until now when I was checking to see how the case is affected in chat (it isn't; the chat records exactly what you type in the case you type it in, so you can shout).

Part 45...

Friday, March 21, 2014

Dev Log: Horror Text Adventure #43

I forgot to mention last time that I did fix things so common rooms don't have random items placed in them, but are custom-made.

Items can now both have things in them and on them, so a dresser might have some items in the drawers but also lying on top of it.

I then set about creating chalk, chalkboards, and the "draw" verb.  I wanted to make it so the player could draw whatever they wanted on a chalkboard as long as there was some chalk around.  However, my draw function threw some compile time errors in, and I had some fun learning about the difference between standard mode and strict mode compilation.  Strict mode is extremely useful, and I don't want to turn it off, but I get compile errors if I code properly (and just get warnings if I cheat).  I would hope that there might be some way to use strict mode with exceptions for some blocks of code during compile time, but I doubt it.  For now, I'm keeping strict mode on and making gunky code until I figure out something better.

Draw command shown
You can draw a lot of stuff!
But in any case, the player can draw on the chalkboard now, any number of times, provided there is some chalk in the room or in the player's hand to draw with.  The player can also then look at the chalkboard and see what drawings have been made.

Making things appear reasonable in English with proper punctuation was the hardest part.  I expect that probably will be tough overall.  I wonder if I should have a grammar function of some sort.  That'll be a ball.

Also, for some reason, there was no error message for the player when no command was recognized, so I added that.  It's the little things that matter.
While I was typing this log up, I decided also to set a cap on the number of drawings on a chalkboard before I forgot.  So for right now it's set to eleven, so the player can't be slammed with a list of a thousand images when they look at the chalkboard.  I definitely want to get the chalkboard erasable next.  Down the line it'll be neat to come up with a way to make it grungier and grungier until it requires a washing to be able to draw anything visible.  But for now, I'll just make the ability to erase the entire thing and that should work well enough.  Also, a little extra fun you can do with the space of eleven drawings:

Tic-tac-toe on a chalkboard
Except that the middle squares aren't "corners".  This game isn't free of human errors yet.
Next log...

Tuesday, March 18, 2014

Blog update

I may have secured a job that will be starting shortly, so this blog will likely slide down to once-a-week posting.  Not sure what day of the week, but I'll change the tagline at the top to whatever it ends up being (it currently says "Every Tuesday & Friday").

As far as what appears over the next few months: I'll definitely keep plugging away at the horror text adventure, to keep a long-term project chugging along.  I might revise an old project that's in alpha (like work on the Dominion expansions some more), or pick up the Doom mod that was put on hold a while ago.  Or maybe something new for a small short-term project.  It all depends on how I feel when I adjust to the job.  I might have no time for anything except the text adventure.

We'll see what happens.

Blindfolded girl
I don't know; I can't see the future.