Reader small image

You're reading from  Learning Game AI Programming with Lua

Product typeBook
Published inNov 2014
Reading LevelBeginner
PublisherPackt
ISBN-139781783281336
Edition1st Edition
Languages
Right arrow
Author (1)
David Young
David Young
Right arrow

Constructing a soldier blackboard


Previously, we stored any data from evaluators and actions on the userData structure. We can now move all this data to our blackboard. The following is the list of attribute values we'll be storing within the blackboard:

Blackboard attributes

Description

alive

Whether the agent is considered alive or dead

ammo

The current amount of ammunition the soldier's rifle has left

maxAmmo

The clip size of the soldier's rifle

maxHealth

The starting health of the agent

enemy

The best enemy agent that can be attacked

bestFleePosition

The best strategic position to avoid enemy agents

Constructing a blackboard requires you to set the initial attribute values we previously stored on the soldierUserData table directly. At this point, we can create KnowledgeSource instance implementations for enemy selection and flee position calculations. To allow access of the blackboard to all our agent systems, we can store the blackboard itself on soldierUserData...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Game AI Programming with Lua
Published in: Nov 2014Publisher: PacktISBN-13: 9781783281336

Author (1)