I have a game world with quite a bit of AI, which has some senseslike seeing, hearing, touching, smelling, etc.
However, I'm not sure how to put this information in a single place so the individual AI can go through it and make a decision.
For example, each sample (transmitter and receiver) currently returns a structure named a stimulus with information such as position, direction, stimulus type (vision, sound, smell, etc.), NPC type (human, animal, monster, etc.) and so on.
And right now, the Monster AI has only one hard-coded preference hierarchy – touching (eg Damaging Events)> Seeing> Sound> Smell. So when you fire a gun, it will try to follow that sound, but when it sees you, it switches to visual pursuit and forgets the noise.
However, this is not very robust. It is not very good for repeated damage events or hang gliding or stale stimuli against new stimuli. Ideally, I'd like to use some kind of utility evaluation to get more complex and dynamic behavior and fix out-of-the-box cases where the AI does not interact properly (ignoring stimuli that it should not).
I am not sure how to approach this implementation. Should I just have a bunch of all the stimuli the AI encounters and go through each tick? But how can I cut this list, because it gets very big very fast and possibly contains really old stimuli? (Currently, the AI has only one "target stimulus", and new stimuli go through this preference hierarchy before either discarding or replacing target stimuli).
(As a side note, this GDC talk about creating the living, breathing world of Hitman has provided some great information on how to handle knowledge, but I have not been able to figure out how to store it and through several knowledge fields of a iterate individual AI and so on).
(I'd also like to get advice on the knowledge / stimulus data structure myself – to be modular enough to store different types of information instead of having a bunch of unused fields.) Tell me, how a sound might just be type and Direction needed, but a visual stimulus may only need type and position, etc.)