ERATO Proceedings Istanbul 2006.pdf - Odeon
ERATO Proceedings Istanbul 2006.pdf - Odeon
ERATO Proceedings Istanbul 2006.pdf - Odeon
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3.3 Scripting<br />
To control the simulation events, our software architecture is responsible for mainteance, consistent<br />
simulation and interactive scenario states controlled by python scripts at run-time. Our system relies<br />
on microthreads for spreading the workflow and script execution over several frames. This offers the<br />
ability to describe complete sequences of events as Python scripts. The following listing is an extract<br />
of a script sequence which affects behaviors of digital actors dynamically.<br />
import time<br />
#music has started: people listen<br />
for i in range(len(agents)):<br />
agentName = agents[i]<br />
simulationService.setCurrentState(agentName ,"State_ListenMStart")<br />
while time.time()-val < 45:<br />
#wait for the completion of the music score.<br />
vhdYIELD<br />
#concert finished: applause<br />
for i in range(len(agents)):<br />
agentName = agents[i]<br />
simulationService.setCurrentState(agentName ,"State_PositiveStart")<br />
while time.time()-val < 57:<br />
vhdYIELD<br />
#back to idle<br />
for i in range(len(agents)):<br />
agentName = agents[i]<br />
simulationService.setCurrentState(agentName ,"State_IdleStart")<br />
In effect, virtual characters are associated to animation banks which define sets of animations<br />
connected to human emotions such as being positive, negative, laughing, cryin. Theses emotions are<br />
represented as distinct states within an HFSM system where states are defined using Lua metatables<br />
[Ierusalimschy2005].