Progress, NPC Doors


Here's a quick update. I've been blazing ahead full-tilt for the past couple of weeks, making excellent progress.

@p 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:

@p 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.

@p - Pro: Fairly lifelike, this is how we interact with doors.

@p - Pro: Same rules that player plays by, thereby bringing the player further into the world.

@p - Con: Requires managing the NPC control code, which is already fairly complex.

@p - Con: Requires adding additional code relating to pathfinding, to detect beforehand if we're about to go through a door.

@p 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.

@p - Pro: Better than having the NPC go through the door magically, like they do now.

@p - Pro: Requires no prediction, which is a help

@p - 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.

@p - 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.

@p - Con: Different rules than the player. The player will definitely notice that NPCs don't interact with doors in quite the same way.

@p - 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.

@p I chose Solution 2.

Solution

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.

@p 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!

2009-06-13


◀ Back