Associative Data for Memory Retention in AI in Developer Help
|
|
Yeah, that's a fancy way to say I need to figure out an efficient way to store data for individual mobs to later recall and process. During the AI loop, I intend on having the AI take note of interesting events it happens to witness (Another mob just died as a result of interacting with that object, this food I just ate increased my stamina by a small amount, the individual who attacked me earlier is standing near my spawn point, etc.) Ideally the mob would later be able to search its "memory" after having observed something and determine its relevance and/or any course of action it should take.
I know this sounds like I'm being overly ambitious, and maybe I am, but I do plan on making it as simple as possible for myself. Each event itself will be simplified into five components; The thing or creature of interest, the action that was performed, the outcome, an evaluation result (dangerous, helpful, so on), and a numerical value representing how "important" the event is to the mob. So essentially I need a way to tie five pieces of information together (a mob/obj, three text variables, and an integer) into an easily referenced, searchable, and CPU efficient... um... thing.
See, that's where I get hung up... I don't know what "thing" I need for this /is/. "Database" came to mind, but that looks so hopelessly complex, and it sounds like it may be too CPU intensive to be worthwhile. Is there some sort of associative list I could create? Or maybe write to an external file and search through that somehow? I've never dealt with a lot of these things before, so I'm turning to you guys for some advice. Where should I start looking? Any recommendations on implementation?
Thanks in advance.
|
The things I can come up with off the top of my head are:
1) Create an atom for the selected mob, and store all variables on that atom, for later reference. This would be easy to record and access, and all necessary information could be kept. I'd try this way personally, to see how intense it is.
2) Store a list or string of particular events that have happened, and depending on the event, assign something to it later. However I think this wouldn't apply as you need a record of who, what, where and how.
3) Similiar to number 2, but in a list keep each string with all the necessary information, such as "friend trapped 5"(For who, what, and level of importance).
That's about all I can come up with atm...