Characters



This will be a long one once again, so here we go. Across the level, there are characters that the player can interact with and make friends with. Each one is a child actor of the parent actor BP_Character. This parent actor houses all of the code that makes the characters do their thing, while the child actors house their walking path and favorite gift (basically all the things that are instance editable). All of their dialogue lines are stored within a Character Data Table.
Starting in the parent actor, it immediately accesses the Character Data Table and stores the corresponding character’s dialogue in an S_Character Struct for easy access (so it doesn’t have to go through the Data Table every time it wants a line). Also immediately, the BP_CharacterManager creates a hidden dialogue box along the bottom for future reference. This is always there and appears only when needed.
It then starts the character on their walking path which is just a bunch of timelines that follow a spline component that has been modified within the level for each character. There is a bunch of stuff going on here such as instance editable walk speed, “hang out times” (which determines how long a character sits at a spline point), and rotations values at each spline point. The walk speed is used to figure out how long the timeline should play for by getting the distance between the character's current location and the next spline point, then dividing it by the walk speed. The play rate of the timeline is 1 divided by the number given above which causes the character to move at the given walk speed. Once the character reaches the spline point, they then rotate towards the rotation point set in the Rotation at Point array (as long as it isn’t 0). They wait at that point for the duration set in the Hang out Times array and then continue to the next point.
On top of all that, they can be talked to at any point by the player which means they have to stop and look at the player. When that happens, the timeline is stopped and a new timeline makes the character look at the player (and vice versa). They stay in this spot until the player clicks through their dialogue at which point the previous timeline reverses, and the movement timeline continues. That basically sums up all of the character movements.
Next is the dialogue and widget which is definitely not as complicated as the moving of the characters. When the player talks to a character, the BP_Character looks at the S_Character Struct for that character. It sets the name in the W_CharacterChat widget, the current friendship level (the red circles in the top right), and the dialogue that is being said. For the dialogue, it is chosen depending on certain things. If the player is meeting this character for the first time, the dialogue will be set as the “first meet line” of the character. If the player recently gave the character a gift, the dialogue will be set as a random line from the “gift lines” array of the character. If the player recently repaired the home of the character, it will be set as a random line from the “thank lines” array of the character. Or if none of the above is true, it will be set as a random line from the “general lines” array of the character. All of these can be true, but there is a priority in the order of first meet, gift given, and home repaired. Upon talking to the character a second time, the next one in the priority will be chosen.
That is everything regarding the characters that I made, other than the gift giving section which will definitely be put into another DevLog since this one is really long.
Above you can find some images of the characters, the chat box, and the character data table.
Here are links to where you can see the important BPs mentioned in this Dev Log.
Get GGD Resource Project
GGD Resource Project
A resource gathering project!
| Status | Prototype |
| Author | GavinGameDesign |
More posts
- Final Thoughts and Credits11 days ago
- Save System11 days ago
- Gifts11 days ago
- Repair Points11 days ago
- Sleeping11 days ago
- Storage System11 days ago
- Upgrade Shop and Upgrades11 days ago
- General Shop and Selling Resources11 days ago
- Breaking Resources and Player Inventory11 days ago
Leave a comment
Log in with itch.io to leave a comment.