Engine Concepts
Contens
General information
SymOntoClay is an experimental open source game AI engine.
SymOntoClay will be an asset for Unity3d. It has not yet been implemented.
In SymOntoClay a game AI will be written using special SymOntoClay's domain-specific language (DSL). The DSL is needed for more convenient integration various interesting AI features into the syntax. It promises more speedy and convenient development game AI.
Common concepts
DSL level concepts are described here.
World
Contains general information for all objects of a game.
In the world it is possible to define facts and logical rules that will be known to all NPC of the game.
Also, the name "worldspace" can be applied to world, as analogy with the concept "workspace".
Not active. But it can define methods which are available to any NPC of a game.
There exists special syntax construction for the root code entity of world.
App
It's a root entity of a game object.
App can be active or not. It depends on using in Unity.
Active NPC has executing code and can react to the environment. Also It allows to define information about any object in a game. NPC knows only Its own personal information and general information defined in world. It helps us to prevent “cheating AI” on the engine level without writing any additional code on the DSL level.
Died NPC or thing don't have executing code and can't react to the environment. It only allows to define information about any object in a game.
Some of the information is updated automatically, depending on the state of an game object with which it is linked.
There exists special syntax construction for the root code entity of app.
Lib
Library contains code which is common for different Apps, Worlds other Libs.
There exists special syntax construction for the root code entity of lib.
On unity scene
Unity scene level concepts are described here.
World
As the concept World on DSL level the concept World of Unity scene level represents general information for all objects of a game.
The component World links world file with target DSL world to a GameObject on unity scene. I recommend to add the component to Terrain.
Humanoid NPC
Represents Humanoid NPC on unity scene.
The component Humanoid NPC links SymOntoClay DSL project file with target behavior to a NPC's GameObject on unity scene.
Thing
Represents Thing on unity scene.
It is a GameObject which has never been active.
Also NPC can not interact with Thing. The Thing can only be percepted and be obstacle in navigation.
The component Thing links SymOntoClay DSL project file to GameObject on unity scene. The linked file provides facts about the Thing to a Humanoid NPC. It allows the NPC to percept the thing.
Hand Thing
Represents Thing on unity scene which can be taken by NPC's hands.
Also the Hand Thing can be percepted.
It is a GameObject which has never been active. But Hand Thing can have own Host endpoints which can be added to NPC's Host endpoints. These Host endpoints will called as usual Host endpoints of NPC.
The component Hand Thing links SymOntoClay DSL project file to GameObject on unity scene. The linked file provides facts about the Thing to a Humanoid NPC. It allows the NPC to percept the thing and to interact if needs.
Host endpoint
It is endpoint of external C# method for SymOntoClay engine.
Host endpoint provides Unity-specific or game-specific implementation of behavior. It allows us interaction with Unity Game object, navigation, animations, visual effects or something else like this.
Methods implemented by Host endpoints are available to call by using system variable @@host.
In details writing a Host endpoint is described here.
Player
Represents a Player on unity scene.
The component Player links SymOntoClay DSL project file to GameObject on unity scene. The linked file provides facts about the Player to a Humanoid NPC. It allows the NPC to percept the player.
Implementation
SymOntoClay is implemented on C#.
SymOntoClay is planned as an AI asset for Unity3D. Now only implementation of engine core has been started. And this asset has not been created yet.
SymOntoClay's core is separated from code to support integration with Unity3D. It opens possibilities for integrating SymOntoClay with other platforms in the future.
Common architecture
SymOntoClay is created primarily for game development. The first implementation is created for Unity3D. But I hope we will able to use SymOntoClay in other cases.
SymOntoClay exists only for describing behaviour logic. And It can not replace complex game engine like Unity3D.
The main components of SymOntoClay for integrating with Unity3D:
Native platform
Native platform provides interaction with hardware, special required services and APIs. Also it menages life time of instance of SymOntoClay.
Now there exists only one available native platform - Unity3D. But I hope there will be many available platforms for SymOntoClay in the future. My dream is availability SymOntoClay for Unreal engine and robots.
Common bus
The common bus aggregates all entities in one cluster, provides interaction between them and caches of common components. It provides simultaneity of NPC's actions and saves resources of computer.
It may contain user's code on special language which describes common facts or another logic of the game or level.
One bus should be used for one game or one level of the game and It can menage many NPCs. Menaged NPCs can interact with the information as if It is described into the NPCs.
Common bus is specified for concrete platform.
Host
Firstly Host provides facts or another logic specified for this NPC on the game or level. So even inactive game entities have an own hosts to be perceived by active NPCs. Player also can perceive this information by special UI means.
Secondly Host provides interaction between Logical engine of active NPC and Common bus.
When NPC was died its host continues own existence as inactive game entity and can be perceived.
Host is specified for concrete platform.
Logical engine of active NPC
It provides behavior of active NPC. All process of NPC are executed here.
Logical engine of active NPC are independent of concrete platform.
User's code
It describes behavior of an active NPC and logical information of the NPC or game level by special programming language.
All files of the language are merged into SymOntoClay applications. These applications can be attached to Logical engine of active NPC, Host or Common bus.
Special languages are created quite often. Of course we need a good reason for creating a new programming language. And I think this language will be able to implement helpful features directly and will help to create more complex game logic faster.
One more purpose of SymOntoClay DSL is to separate game logic of NPS from other code. In this case we can get more concentration on behaviour of NPC and divide it from other game code.
Also logic of NPC will become portable and can be realized on different platforms.
The special language will contain helpful constructions for more faster creating target features of a game.
You can read more about SymOntoClay DSL here.