Understanding the Enviroment: AgentKeeper3d.application.xml

Understanding the Enviroment: AgentKeeper3d.application.xml

Postby Flipflop » 07 Feb 2013, 16:51

This Thread should explain the main file that loads assets inside the game, connect them to spaceobjects and connect these spaceobjects to components.... :)


In short: Its the file that handles the static initial setup of the enviroment. (That includes: worldmodel, model-logic and visualization) .

This is the only file you need to load assets (you put in the assetsfolder before) inside the Game. But the file is responsible for even more stuff then just that.

You should read our Documentation if you want to understand the Concepts in Detail: Enviroment UserGuide

But for now I just give you an short overview:

First you have to understand that the game-environment is seperated in three big parts:
  • The Worldmodel: That is the abstract representation of the SpaceObject inside a Space.
  • The Visualization: The Visualization (2d or 3d) of the Worldmodels SpaceObjects
  • The Components: Some SpaceObjects are controlled by Components. In our Case this are the Game AI, realized as SoftwareAgents in BDI-Pattern.

Functions of the Enviroment:
  • Declarative specification of the environment as application space
  • Model definition consisting mainly of space objects, tasks and environment processes in a 2d or 3d grid or continuous world
  • Agent-environment interaction via customizable percepts and actions
  • 3d visualization of the environment, its objects and agents, including possibilities for animation etc.
  • Customizable space execution with built-in support for continuous and round-based execution semantics
  • Highly extensible with a lot of ready-to-use components for frequent use cases

So maybe you have now even more Questions...I try to explain... :)

What is the Space?
The Space is the "virtual" room where everything is inside.
So all the SpaceObjects in our case for example. We use a Grid2D Space. Yes 2D! The Gamelogic is in 2D.
That means the GameSzene is organized is several GridSectors. The startmap.map for example is sized 40x40.
So there are Gridsectors from 0,0 to 40,40.

{l Code}: {l Select All Code}
<env:envspace name="mygc2dspace" type="gc2dspace"width="40" height="40">

What is a SpaceObject?
A SpaceObjectis the "virtual" thing inside a Space. We have lots of static Objects that are not controled by a Componend. Like all the MapSectors, for example Dirttiles, Rocks, Buildings etc.
And we have SpaceObjects controled by Components, for example the Creatures or Heroes. I you want you can remove some Component-Mappings and you will see the SpaceObject, for example a Goblin will not move anymore or do anything.
What is a Property?
You can set and load any type of Java-Class as property inside a spaceobject (or space). So the Position, Name, Id or even Speed or complex Javatypes like an ArrayList can be saved as property inside an SpaceObject (and also Space).

{l Code}: {l Select All Code}
<env:objecttype name="dungeonheart">
   <env:property name="status" class="String">"Nothing"</env:property>
   <env:property name="neighborhood" class="String"></env:property>

What is a Drawable3d?
A Drawable3d is a Container. It holds all the grafics that is used for one spaceobject-type for viszualization. I start making a Tutorial here for the 3d case: Drawable3d Tutorial Its not finished yet but it should explain the main Idea.

{l Code}: {l Select All Code}
<env:drawable3d objecttype="dungeonheartcenter" width="1" height="1" depth="1" isDynamic="true">
   <env:object3d width="0.2" height="0.2" depth="0.2" x="0" y="0" z="0" modelpath="models/buildings/dungeonheart/dungeonheart.j3o" >
      <env:materialfile part="plate" path="models/buildings/dungeonheart/dungeonheart_ground.j3m" />
      <env:materialfile part="units" path="models/buildings/dungeonheart/dungeonheart.j3m" />
     <env:materialfile part="stuff" path="models/buildings/dungeonheart/dungeonheart.j3m" />
   <env:object3d width="0.79998" height="1" depth="0.79998" x="0" y="0" z="0" modelpath="models/buildings/dungeonheart/border.j3o"/>

What is a Component?
A component can be everything that controles a SpaceObject inside the Worldmodel (Grid2d). So an Softwareagent like MircoAgent or BDIAgent.

{l Code}: {l Select All Code}
<componenttype name="Thief" filename="ai/heroes/thief/ThiefBDI.class" />
User avatar
Posts: 181
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Who is online

Users browsing this forum: No registered users and 1 guest