Friendly NPCs - UQcsse3200/2024-studio-2 GitHub Wiki
The game includes a variety of Friendly Non-Playable Characters (NPCs) designed to enhance the immersive experience and contribute to the game's dynamic environment. These NPCs — such as Cow, Lion, Turtle, Snake, Eagle, Fish and Magpie — provide atmosphere, interact with players by giving helpful hints, may offer quests and provide items. NPCs do not have collision boxes, allowing them to move freely and interact naturally with the game world.
To simulate natural wild animal behavior, the animals in the game display various behaviors and transition between states based on the situation. These behaviors are implemented as tasks that can be assigned to the AITaskComponent. You can find more information on how to implement custom behaviors here. The behaviors are listed below in ascending order of priority (e.g., Interested takes precedence over Wandering).
Wandering is the most basic type of behaviour the friendly NPCs may exhibit, animals in a wandering state move around a certain position at their defined speed with no clear goal.
Pausing occurs when a player is within visible range of the entity, causing the NPC to move towards the player until they're in speaking range. When they are in speaking range of the player the entity will stop moving.
When an enemy is in the visible range of a FNPC, they will do their best to avoid the enemy by running away.
Once an enemy NPC has been beat by the player, it is transformed into a friendly NPC which will accompany the player throughout the game, helping them with combat and game progression. This means that extra FNPCs will be added throughout gameplay. Details on the enemy conversion can be found here: Enemy Conversion to Friendly Upon Defeat
Every friendly entity offers dialogue to the player, whether it's useful or not. This helps shape the characters' personalities and adds depth to their interactions, enhancing the overall dynamics of the game. When the dialogue box appears the retrospective NPC also speaks, playing a realistic noise. For more information about how the Dialogue Box works, refer to this link: Dialogue Box (NPC)
Each entity has unique characteristics like whether they provide general game hints, quest specific hints, drop items that can prove fruitful later etc. Their details can be found below:
NPC | Image | Documentation Link |
---|---|---|
Cow | Cow Documentation | |
Lion | Lion Documentation | |
Turtle | Turtle Documentation | |
Snake | Snake Documentation | |
Eagle | Eagle Documentation | |
Fish | Fish Documentation | |
Magpie | Magpie Documentation |
As the player defeats enemies, more friendly NPC's are at one's disposal as in the Enemy Conversion to Friendly Upon Defeat. An example of this is:
Enemy NPC | Friendly NPC | Documentation Link |
---|---|---|
Monkey Documentation |
The NPCs are designed with a pixel-art aesthetic that matches the game's visual style, making them visually cohesive with the rest of the world.
For specifics about how to develop and use FNPCs in game see Friendly NPC Programming Guide