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).

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.

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.

Friday, March 14, 2014

Dominion: After Dark Part 8 - Balance & Fixes

I was never satisfied with Hideaway in Dominion: After Dark.  It was one of the last cards I created for the set and I felt like I rushed it, so I altered it a little, and then went back through and double-checked other cards while I was at it.  I made these fixes:

Just three cards fixed for now.  More to come I bet.  Click to enlarge.
Chaplain has removed the weird aspect where cards you trash must cost exactly $0.  I'm not sure why I did that initially.  At one point they had to cost more than $0, so you couldn't trash Curses or Coppers.  Then I guess I switched it to the other way, but that makes it more useless.  Now it acts more like Chapel from vanilla Dominion, where you can trash any cards, up to four of them, from your hand.  I am still unsure of the $4 price tag.  It might still be best to be $3, even though it now works better.

I took out the extra +$1 you get from Hanging Tree, so it is not guaranteed money anymore.  This way I think it's now worth the $3 I set it at.

I altered Hideaway so it is slightly more useful.  Originally, as a Reaction, you could only remove a Charm to block an Attack.  Now, if an Attack is played, you can still do that, or you can reveal Hideaway and gain a Charm (although the Attack is still carried out).

Tuesday, March 11, 2014

Dev Log: Horror Text Adventure #42

I went back through and deleted all the room subclasses.  I had thought originally that I was doing good object-oriented programming, but really it's much more of a mess than necessary.  Rooms, by themselves, really have no difference.  A bedroom and a hallway are only different in what objects will randomly be placed in them, and other minor universal differences--meaning nothing is ever specifically added to a room type for functionality.  Everything so far just takes a case statement or a boolean switch on instantiation.  I had it that way once but then I decided "hey, I ought to OOP this up."

Next I changed the school into purely an array, rather than having individual variables for every room.  I'll need to use the map for reference more, but I needed to do that anyway for a lot of rooms before this, so it doesn't matter too much.

Then, lots of code cleanup and bug fixing.  All minor things that caused no trouble, just lots of quick little things to fix.  I've also recoded a few variables into enums, but since AS3 doesn't support enums, it requires a lot of extra custom code.  But I think that's ok; after all, I do believe I said last time (or at least I'm saying it now) that readability is far more important than efficiency at this point.

Friday, March 7, 2014

Dominion: Industry #7

You can now download both the cards for printing and the rules.

Instructions for how to print out the cards are on the last page of the cards PDF.  Also here: print out pages 1-3 ten times each (or eleven times each if you want randomizers), and print pages 4-6 once each.

The errata for the cards are very little compared to Dominion: After Dark.  Most of Industry's cards are simple, so they don't require too much extra in explanation.  However, I did expand on Tariff in the errata--thanks to Clark Allsop for his comment on Part 3, for catching some unintended ways to play Tariff.

If you test out Dominion: Industry and discover any other odd behaviors with cards (or if you need more clarification, leave a comment and I will be sure to correct the errata (or the card itself if necessary).


Tuesday, March 4, 2014

Dev Log: Horror Text Adventure #41

Got rid of a ton of code and made things far simpler.  I took all the repeatable school things I could and shrunk them down to size with loops (connections and stuff).  There are a lot of other things that are specific that don't take well to loops, but hey, cutting out 43 lines of code and replacing it with a couple of for loops and if statements is awesome.  Well, I had to make a 2D array as well, but worth it.  In the long run, this is definitely the better way to do it.

I also cleaned up code a little more, by making things slightly longer but more readable.  In the background, directions are just numbers, so 0 is north, 1 is east, etc.  But every time I try to use those numbers, I have to sit there and think about which is which or look it up, so I altered functions where I could so I could just put in a string for readability.  The function is now longer (used to be like one line), but it is far easier to read.  In fact I've been fixing errors for a while because I forgot to start at zero in places, so things would get all mixed up.

But once that stuff got fixed, I was able to take a tour of the school.  Mostly empty, of course, but working.

I also added a statement when you walk into a new room it tells you what type of room you've just entered.  I can't believe that was missing.  At first I thought something was wrong in the school when you walked into a classroom or office, because no description was given, but that was just because they have no items in them yet.  It didn't help that hallways always have a painting in them (which they shouldn't), so their description wasn't blank.

Next comes making it so common areas don't randomize items on instantiation, while unique areas do.  Then I might be able to get to making items to fill in the rooms.