Ultima Game Developer: NPC Schedules
Beginning with Ultima V, all characters in the game followed schedules. As the complexity of the games increased, the complexity of the schedules do likewise. During Ultima VII and Serpent Isle, a blacksmith characters might go to bed at night, eat breakfast in the morning, go to work and craft items using items around them, go to a tavern for lunch, return to work, leave at the end of the day and go home for dinner. A farmer could path around their farm, gathering eggs from chickens, milking cows, and threshing grain, taking breaks as appropriate.
When designing an Ultima-style game, NPC schedules can add realism and believability to your world. In a living world, a shopkeeper does not stand at their counter, day and night. Innkeepers go to sleep and must be awoken if a late traveller arrives. Farmers would scarcely trust a stranger stalking about their barn at night. These kinds of things can be done using schedules.
Implementing schedules is a combination of AI, pathfinding, and scripting. Creating a guard who paths between guard houses during the day is a simple script, following a predefined path between certain game hours. Once off duty, that guard would leave his armor and halberd in a secure storeroom and go to dinner, or back to the barracks. It may take dozens of individual scripts, some unique to a single NPC and some broad enough to be used on an entire group, along with realistic crowd creation and handling, to bring your living world together.
Creating an Ultima game does not *require* schedules. Ultima IV did not feature them, and was considered one of the best CRPGs ever created. On the other hand, Ultima IX did away with them as well, and was considered remarkably less favorably. When using a day/night cycle, it is ideal that, at a minimum, a NPC schedule moves them from their business to their home. Failure to do so dramatically reduces the believability of your world.
The extent of schedules is directly related to how complex and believable your world is. Let’s take a look at three example games:
In Game A, the tavern owner has no schedule. He stands at his bar, unmoving, until the player approaches him and engages him in conversation. While simplistic, he is functional.
In Game B, the same tavern owner has a basic schedule. The game begins at sunrise, and the NPC spawns in his home. He paths from there to his shop, where he stands behind the bar for four hours, allowing players to converse with him. At noon, he paths to the small table behind the common room, where he has a meal. During this time, he will respond with a script that asks players to come back later. After an hour, he returns to the bar. In the evening, he leave the tavern, locking it behind him, and makes his way up to his home, and falls asleep at dusk. He wakes up at dawn and repeats the same schedule.
While Game B is much more realistic, similar to Ultima V, VI and VII, it is possible to greatly increase the complexity of the NPC, if desired. Game C has the same script as before, with the following additions. If the tavern owner is not engaged in conversation (for at least a couple of minutes), he will begin performing one of several actions: cleaning the bar, pathing out and cleaning tables, conversing with a serving wench, taking drinks and food to patrons, etc. After hours, he herds everyone out of the bar, and will not leave unless all players and NPCs are out of sight (possibly allowing a stealthy character to remain). He takes the coin from the lockbox behind the bar and locks it in safe at his home each night. The time he falls asleep and awakens varies by 1-60 minutes each day. On Saturdays, he opens late, just before noon, after taking the coin for the week to the local bank. The tavern remains open until midnight on Saturdays. He leaves the bar locked on Sundays, sleeps in a bit, and travels down the path out-of-town that afternoon, where he sits next to his wife’s headstone in the town graveyard.
While that NPC in Game C is unique, it takes MUCH longer to design a specific NPC than it does to create general routines for a class of NPCs to perform. If all shopkeepers have the same schedule as Game B, each only needs a few unique identifiers (i.e., home, work, etc). You wouldn’t want them all to use the same schedule as Game C, as it is far too tailored to a specific character, and leads to very crowded cemeteries…
You might also combine certain schedules, however; Shopkeeper01 has the schedule from Game B, plus an idle schedule and weekend schedule that turns them into the character from Game C. Shopkeeper02 has the same Game B schedule, but only has an idle schedule unique to their shop; their shop is open every day, so they simply repeat the daily tasks. Shopkeeper03 may have the same Game B schedule, a unique idle schedule, and their weekend schedule is simply to wander the town and speak with other NPCs. This makes the game much more interesting, as learning a town’s schedule becomes interesting and unique.
When creating schedules, especially for NPCs that players will interact with, remember to have them readily available for the majority of their time. For example, in a 24-hour day, expect an NPC to be available for 14 hours of it (they work at 6am, take an hour lunch, and leave for home at 9pm, meaning they are available 6-12, 1-9). Generally, shopkeepers will rise an hour before sunrise, and their business is open until just after sunset. This makes it much easier to access them than if they work 8-5. Similarly, when a NPC is performing a task from their “idle” script, they should still be available to run their normal interactions.
Do you have any preferences, or pet peeves, when it comes to schedules from the Ultima games? How would you make them better?