Posted April 13, 2025 by Stephen Rockett
Overview of NPC System
The non-playable character (NPC) system in Patchwork Pastry includes a moderately complex set of constraints designed to enhance the realism of the characters. The primary purpose of the NPCs is to enable them to purchase items from the player in the bakery. However, they also walk around looking at things (the sea, farms, butterflies, musicians playing…) and occasionally purchase goods from the market. They also have individual characteristics, including when they are awake (and active in the scene), their relationship towards the player, and how much gold they can spend each day. This devlog covers this system in detail.
------------------------------------------------------------------------------------------
Creating the NPC - Individual Information
Each NPC has seven discrete constraints, which allows for unique interactions between the player and the NPCs:
Using part 1 of the constraints, the NPCs can each have unique target destinations when walking around the village grounds, for example:
------------------------------------------------------------------------------------------
Choosing Goods from the Bakery
When the player places one of their baked goods on display, a random NPC (who is active in the scene) enters the bakery and follows a procedure to pick the baked goods from the display:
Figure 1: Vigore looking tart display for selection
Figure 2: Vigore looking roux display for selection (after picking up the hardtack and a tart square)
------------------------------------------------------------------------------------------
Purchasing from the Bakery
Once the NPC selects 1-4 products from the display, they bring them to the counter and give the player the recommended gold coin amount for the product. From here, the player can accept the purchase, decline the purchase (by picking up the product), or change the price. A price increase leads to quicker earnings for the player, but NPCs may not like it - they are less likely to select as many products and may leave if you overcharge them by too much.
Figure 3: Vigore giving the player the recommended retail price of the product
Figure 4: The player giving Vigore a discount (which improves his relationship to the player)
That’s all for now! The next devlog is coming on 14th April 2025.
- Stephen Rockett