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

Updating agent behaviors


Now that we have a number of different senses, team-based communications, and knowledge about the environment, we can update our agent's blackboard selections to account for the additional information.

Enemy selection

With additional visibility information, we can update our enemy selection to take into account only agents that aren't teammates as well as ones that have been visible within the last second. As teammates send out enemy sightings and essentially share their visibility about the environment, the response time for our agents to pursue a newly spotted enemy is rather quick.

Tip

Currently, our agents share immediate knowledge with each other. With only a small amount of work, you can delay knowledge propagation or even preference agents in order to select enemies they've seen firsthand.

Creating a new function for choosing the best enemy will now only process known visible agents that are stored on the blackboard.

SoldierKnowledge.lua:

function SoldierKnowledge_ChooseBestVisibleEnemy...
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)