In order to make the game world livelier, the inhabitants of Gleaner Heights have to be on the move every day. Maybe they will leave home and go to the town square in the morning, then enjoy a meal at the Diner, then visit a friend, and so on, until nightfall approaches and they return home to rest. We've seen this in games before. The older Harvest Moon games did it. Modern AAA open-world RPGs do it. And now I'm doing it. Unsurprisingly, this section of game design is rife with challenges as well.
A few characters from our main cast. Sorry for the messy upscaling. |
I'll remind you that I am using Game Maker: Studio to develop the game so some technical jargon will refer to this specific application, but the gist of the article isn't confined by it, as always. Any software development tool supporting data structures can be used to implement the ideas discussed below.[*]People who write in programming languages utilizing classes and pointers are probably laughing so hard right now after having skimmed through this article that I can probably hear them from here. But this is Game Maker we're talking about, and we'll have to make do with whatever hand we've been dealt.
So...we have a bunch of villagers (over thirty, actually). And we want to set up a daily schedule for each and every one or them, bearing in mind the following guidelines:
- Townsfolk (or Non-Player Characters or NPCs) should have different schedules during certain days of the week. Also, their daily routines differ each season of the year.
- Each NPC must have a clearly defined schedule, that is a list specifying where they should be at any given time. This means that if the mayor leaves home at 8:00 in the morning and he needs 10 game minutes to go to the general store, if at 8:05 you exit a building and you spawn at the town map near the general store, you should see the mayor exactly halfway there. Also, NPC schedules should be declared in a brief, yet human-readable way. Writing tons of borderline nonsensical -to your future self reading them- parameters for over 30 NPCs can cease to be fun very, very quickly.
- NPCs must pause their route briefly when the player character is very close to them, in order to lend some attention to the player. Maybe we want to chat or give them an item. Of course we can do all that when an NPC is on the move, but chasing them around to do so isn't the smoothest option. In any case, they stop for a set amount of time, beyond which they resume their route.
- NPC schedule infrastructure must be set up in such a way, that it will be possible for the game to alter a given day's schedule under special circumstances. For example, if it's snowing an NPC will stay home, if it's a festival day an NPC must be at the town square etc.