15.12.2012 Views

Bayesian Programming and Learning for Multi-Player Video Games ...

Bayesian Programming and Learning for Multi-Player Video Games ...

Bayesian Programming and Learning for Multi-Player Video Games ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

⎧⎪<br />

<strong>Bayesian</strong> program ⎨<br />

⎧⎪<br />

Description ⎨<br />

Specification (π)<br />

Identification (using δ)<br />

⎪⎩<br />

rein<strong>for</strong>cement learning or h<strong>and</strong> specified (or distribs. parameters optimization)<br />

Question<br />

⎪⎩<br />

⎧<br />

V ariables<br />

Dir1:n, Obj1:n, Dmg1:n, A1:n, E1:n, Occ1:n<br />

Decomposition<br />

⎪⎨<br />

P(Dir1:n, Obj1:n, Dmg1:n, A1:n, E1:n, Occ1:n) = �n �<br />

i=1 P(Diri)<br />

P(Obji|Diri)P(Dmgi|Diri)P(Ai|Diri)P(Ei|Diri)P(Occi|Diri) �<br />

F orms<br />

P(Diri) : prior on directions (crossing policy)<br />

⎪⎩<br />

P(XY Zi|Diri) : probability tables<br />

fightmoving/fleeing/scouting : P(Dir1:n|Obj1:n, Dmg1:n, A1:n, E1:n, Occ1:n)<br />

Figure 5.9: <strong>Bayesian</strong> program of flee(), fightMove() <strong>and</strong> the scouting behaviors.<br />

• Separation: avoid collisions, short range repulsion,<br />

• Alignment: align direction with neighbours,<br />

• Cohesion: steer towards average position of neighbours.<br />

Separation is dealt with by P(Ai|Diri) already. As we use interpolations of units at the time<br />

at which our unit will be arrived at the Diri under consideration, being attracted by Atti gives<br />

cohesion as well as some <strong>for</strong>m of alignment. It is not strictly the same as having the same<br />

direction <strong>and</strong> seems to fare better is complex terrain. We remind the reader that flocking was<br />

derived from birds flocks <strong>and</strong> fish schools behaviors: in both cases there is a lot of free/empty<br />

space.<br />

A �a vector is constructed as the weighted sum of neighbour 3 allied units. Then<br />

P(Atti|Diri)<strong>for</strong> all i directions is constructed as <strong>for</strong> the objective influence (P(Obji|Diri)) by<br />

taking the dot product �a · � di with a minimum threshold (we used 0.3, so that the flocking effect<br />

is as strong as objective attraction):<br />

P(atti|diri) = threshold + (1.0 − threshold) × max(0,�a · � di)<br />

The JD becomes JD × Π n i=1 P(Atti|Diri).<br />

In position<br />

The inposition mode corresponds to when some units are at the place they should be (no new<br />

objective to reach) <strong>and</strong> not fighting. This happens when some units arrived at their <strong>for</strong>mation<br />

end positions <strong>and</strong> they are waiting <strong>for</strong> other (allied) units of their group, or when units are sitting<br />

3 The devil is in the details, if one considers a too small neighbourhood, there is very rarely emergence of<br />

the flocking behavior, whereas if one considers a too large neighbourhood, units can get in directions which are<br />

stucking them with terrain. A pragmatic solution is to use a large neighbourhood with a decreasing weight (<strong>for</strong><br />

increasing distance) <strong>for</strong> each unit of the neighbourhood.<br />

83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!