For a 3d, Medieval style, rpg game, how could I have npcs remember little things the…
- User
For a 3d, Medieval style, rpg game, how could I have npcs remember little things the player does like accidentally running into a wall, or tripping on something?
- Assistant
To have NPCs remember little things like accidental collisions or tripping, you can implement an "event memory" system. Here are the steps you can follow:
-
Define a class or structure for "MemoryEvent" which will store information about various types of events, such as the type of event (e.g., running into a wall or tripping), the time it occurred, and any relevant details, like the specific object the player collided with or the cause of the tripping.
-
Create an "EventMemory" system for each NPC. This can be an array or list to store "MemoryEvent" objects. You can limit this to a certain number of stored memories to prevent memory overload and simulate the natural forgetting process of an NPC.
-