2014-11-03

Stupid bugs

First, a little nanowrimo progress update. I am at 6387 words. I've been thinking about posting my wip as I go, but I'm not sure if it is worth it with what little I have so far. The story is my first attempt with survival horror (zombie apocalypse). It has some extra sprinkles of things like drama, supernatural phenomena, romance, mystery and a pinch of comedy.

As for my fate system, I finally squashed the bug I've been hunting down the past week. The issue started when I added the ability to give nouns in the world system a unique displayed name. I ran into a problem with needing to create unique names for things that didn't really need them. For example I had to give elevator buttons in the game a bunch of unique names like Floor 1 Button, Floor 2 Button, etc. when all I really needed was Elevator Button on all of them. Implementing that feature meant setting up a clean way to add it to the source code. After some thought, I ended up with a noun declaration like this:

:: Elevator Button|Floor 2 Button [noun(Floor 2)]

It feels pretty natural with the way links can have a displayed text value on the left that is different from the passage or whatever they point to on the right. Adding new features means writing unit tests first, but my downfall was not adding the right tests. I tested the feature with the importer but forgot to add tests in the world system. The end result is I spent a week adding all kinds of new tests trying to pinpoint what was going wrong in the importer. Debugging in Unity is a painful process, but I tried and failed to find the issue. Finally I went over a higher level step through of the system and found that the import process was fine. The issue was with the world system silently discarding nouns with similar displayed names during initialization. The lack of any warning or throwing an error about it really messed things up in finding the problem.

Anyway, with that fixed I can sleep a little easier. But I know what you're thinking, 'Why should I care?'. Well, I don't know, you're the one reading this. >_>

No comments:

Post a Comment