Developer Diary Week 2 - Design and Groundwork
- gtristanitristani
- Jun 1, 2023
- 4 min read
It has now been a week since I began implementation of the project, and time for an update on my progress and where I plan to go from here!
I started this week by addressing the specific building block jobs, hobbies, and personalities that I wanted to implement. I additionally got to work on determining the values that should be available for mood and state of an NPC. Personality is a major feature of my system, so I wanted to choose a variety that, while not being overwhelming to write for, is distinct enough to showcase the extent of the project. When choosing jobs and hobbies, I looked for corresponding animations to create a better visual representation for the user. For state, I considered what physical activities and animations I thought would be important to show the villagers going about their day to day lives. For mood, I chose a few basic moods that are distinct and clear to demonstrate through dialogue and allow utility of the system, without attempting to replicate the full range of human emotion.
The jobs I decided on are desk worker, fisher, gardener, and merchant. Hobbies are working out, gymnastics, jogging, dancing, swimming, piano, guitar, and gaming. Available states are idle, hobby, walking, talking, working, relaxing, unconscious, and asleep. Finally, I wrote up descriptions for the five personalities, shown below.
Cocky – This person’s kind of a jerk. Initially at least. If you get close enough, you might see a more concerned, sensitive side.
Sunny – This person’s got a huge heart! Easy to make friends with, and has a smile as radiant as the sun.
Active – This person’s always doing something! Has lots of hobbies, and loves sharing them with others.
Shy – This person’s a bit standoffish. They don’t talk as much as others and are rare to approach first. That doesn’t mean they don’t want friends though!
Aimless – This person is pretty laid back. They prefer to take things as they come rather than try to change things themselves. Some people think they’re lazy, but is that really true?
After finishing this design, I found twelve villager models in a similar, semi-realistic art style that worked well with the animations I had chosen. I got to work in Unreal afterwards, setting up the project and organizing a file structure to use for its duration.

The first script I created was a basic NPC class, where I outlined, categorized, and documented the variables that they will make use of. A snippet of my code for this to demonstrate the organization style is shown above. These variables included among them State and Mood, both of which I created enums to represent. The NPCs derive from the Character class in Unreal, so for the time being, I have implemented a simple behavior to follow after the player when they go out of range to ensure that their movement is working as intended. I also created a basic first-person player controller that allows WASD movement and camera control via the mouse.
Since I plan to implement a week and time-based schedule for NPCs, I created a weekday enum and a struct representing the hour and minute of a timestamp. To test it, I made a day/night cycle, run by a manager that adjusts the Sun’s (directional light’s) intensity while showing the time and weekday onscreen as UI elements. I additionally made a skeleton for the Job class, outlining the variables that it will need to operate.

The final element I worked on this week was the animation of the NPCs. I created an Animation Blueprint and associated state machine (shown above) to drive it based on their current physical state, allowing the system to show what they’re doing in the world when their full functionality is implemented.
The one thing I wanted to do this week but didn’t quite have the time to get to was continue looking into and implementing the Unreal animation system. Each model has a different skeleton, which appears to require a different animation set for each model with animations conformed to their specific skeleton. Even for the sake of this project where animation isn’t the main focus, the process of retargeting each of these animations to use every possible skeleton is time-consuming, and not something I anticipated going into this. Because of that, I will likely need to spend some time next week finishing the process.
Next week, I also plan to create a basic job, implement its functionality, and ensure that the villager adheres to it. Specifically, they should walk to their workstation before the start of their job, and then work until their job’s time is up. Additionally, their energy will degrade over time. After that, I plan to create the basic dialog system and dialog bank class, with this bank allowing a user to specify responses derived from job or personality attributes in sub banks relative to an NPCs mood, state, player affinity, and energy. Along with this, I will create a dialog box UI to display the NPC’s corresponding reaction. Finally, I plan to allow the player to click on an NPC to perform one of their three basic actions based on the UI button they click.




