In the time I'm not programming my game (that's most of the day), I'm theorizing different things. My AI system has been of great concern to me.
I've come up with a Memory Table system. As it stands now, every entity is a self contained unit. If I could make UDT arrays, then entity memory could be self contained. But, I can't, so I'll have to use parallel memory arrays.
On each program loop, I'll fill the changing values with new information, like distance, sight cone, line of sight, and collision information. Every entity will have to check against every other entity. Without a sound storage system, I could easily perform the same calculation several times to correctly implement the AI.
So I've got a two dimensional array for entities, entityMemory(100,100). Each element contains some of these type declarations...
entityMemory.xdistance
entityMemory.ydistance
entityMemory.xsightCone
entityMemory.ysightCone
entityMemory.xrelationship
entityMemory.yrelationship
I use x and y to distinguish between calling and called entity. Some correspond (will always be identical) and others will not. Basically, I update the table once, update the parallel value, then every entity can call those variables as much as they need to without further slowing down the game. They'll remember ownership, anger, happiness, various speech elements. Objects will have a memory table as well, relative to entities. If you take another entity's object, he'll see and and want it back. If you previously stole from an entity, he'll stay mad at you.
Each memory table will take up about 800k of memory, that's about 4 mb of memory dedicated strictly to AI. About 1/8 of it will have to be updated each loop, but only once.
The main advantage is that instead of having to call getDistance3D(obj1, obj2), getSightCone(entity1, obj2), getCollision(obj1, obj2) and getLOS(entity1, obj2) (etc) for each AI check, they all get called once and referenced as integer variables.
Now, I've never worked with AI before, but I'm very good with theoretical math and such. Maybe someone else has a simpler way. My goal - establish simple memories for entities relative to other entities and objects, and cut down on program overhead.