Chief thing I've been working on most recently is fleshing out the castle. This has been great fun. I've fixed bugs, reworked and generally just added a humungous-chinese-vaseload of detail. Good fun!
Opening Doors for NPCs
One of the more interesting problems I tackled, something from my TO DO list, was to make NPCs open doors. There were two obvious solutions:
Solution 1. Make it part of the NPC control code. When an NPC is going to walk through a door, make him stop, open it, walk through, close it, and then continue.
- Pro: Fairly lifelike, this is how we interact with doors.
- Pro: Same rules that player plays by, thereby bringing the player further into the world.
- Con: Requires managing the NPC control code, which is already fairly complex.
- Con: Requires adding additional code relating to pathfinding, to detect beforehand if we're about to go through a door.
Solution 2. Make it so that the NPC has a sort of sensor, that when they are on top of a door, open it automatically, and once they pass through, close it.
- Pro: Better than having the NPC go through the door magically, like they do now.
- Pro: Requires no prediction, which is a help
- Pro: Can implement it as a simple "add on" to the NPC control code, doesn't have to modify existing code. I.e., it can function orthogonally to the rest of the NPC code, for the most part.
- Con: Not very lifelike, as the NPC will not stop either before the door or after. Gives more of an effect of an automatic door than of the NPC opening it themselves.
- Con: Different rules than the player. The player will definitely notice that NPCs don't interact with doors in quite the same way.
- Thought: Maybe that doesn't matter too much; there are other ways that NPCs don't really interact with the environment, e.g., they don't pick up and carry items, solve problems, or whatnot.
I chose Solution 2.
Funny, but Solution 2 has more pros, so I guess in some ways it's not too surprising that I chose it. I guess it's partly surprising because I have been fairly dedicated to taking the highest *quality* solution for the past little while, not always the cheapest. This is I guess because Texas is well-enough designed that I can afford to, and it's been enjoyable.
That's where we're at! I'm adding status effects for the player, as they have been on my TO DO list for a long time, and they are pretty high priority (they are a core gameplay mechanic, that so far is completely absent). Hoorah!