| KAI |
|
The artificial intelligence subsystem of KEngine receives the name of KAI. It is part of the especialized KTheater components but its importance makes them to be considered a separate component. "Given enough time, all discusions about AI becomes abstract and quasi teorical. This is because IA is not as direct as an algorith or a data structure. AI is a fluid concept that must be tailored especifically for each case." But then, if AI is especific to each game, how do KEngine manage to get a AI component? The answer is simple, KAI is not a solution but a base support for AI implementations. KAI is based on a egocentric approach, which means that every object is considered a potential thinking object. KAI exposes an artificial brain object (KBrain) which implements basic conections with KEntity objects, this conections are analogous to synaptic conections on real lifeforms. A base KBrain object is programmed to do NOTHING except just stand there and walk from a point to other if commanded but nothing else. If a programmer wants a more specialized brain he/she must subclass the basic brain. Any entity on the scene (check the KTheater components) may have a brain. The KScene object detects which objects have a brain attached and allows them some processor time while moving the scene. The artificial brains will use more or less processor time depending of the value of its smartness atribute. When time is given to an entity it may execute any analisys for its nearby objects and act accordingly. As you can see. This is an open solution, and in fact is that open that some of the source code of KAI is completely open. KAI is a high level component, so it is expected to keep fully compatible with any future version of KEngine. |