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

Blackboards


To easily access and store arbitrary knowledge that agents use, we can implement a well-known data structure called a blackboard. In essence, a blackboard is a centralized place that allows the reading and writing of any arbitrary data that our agent's systems can use. Sources of the blackboard's knowledge can be sent directly to the blackboard, or it can be provided by encapsulated knowledge sources added to the blackboard. For an in-depth overview of blackboard systems, see the paper Blackboard Systems by Daniel Corkill.

Creating a blackboard

Creating a blackboard is relatively simple, as the blackboard can be represented almost entirely by an associated array index by knowledge attribute names. One small caveat to simply storing attributes, though, is the use of knowledge sources that create read-only attributes within the blackboard:

Blackboard.lua:

Blackboard = {};

function Blackboard.new(userData)
    local blackboard = {};
    
    -- The Blackboard's data members.
    blackboard...
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)