Simulation of Autonomous Agents Using Terrain Reasoning
Simulation of Autonomous Agents Using Terrain Reasoning
Simulation of Autonomous Agents Using Terrain Reasoning
Vinı́cius J. Cassol, Fernando P. Marson, Mateus Vendramini, Marcelo Paravisi, and Soraia R. Musse
Graduate Programme in Computer Science - PUCRS Porto Alegre - RS - Brazil
contact email: vinicius.cassol@acad.pucrs.br
Alessandro L. Bicho Cláudio R. Jung
Center of Computational Sciences - FURG Institute of Informatics - UFRGS
Rio Grande - RS - Brazil Porto Alegre - RS - Brazil
1, if mt is walkable
0, if mt is non-walkable
ft =
varied, if mt is semi-walkable,
coming from TerrainTool specification.
Figure 5. Visualization of animated virtual humans moving
(5)
in the terrain.
Since the weights are computed for markers closer to
agent i than any other agent, the direction vector describing
the agent motion is computed similarly to [24], as shown in
Equation 6:
4 Results Presentation
N
X
d(i) = wk (mk − pi ). (6) This section presents some results obtained with our ap-
k=1 proach. To support the terrain generation process, we
present TerrainTool (see Section 3.1), which is able to spec-
The motion generation process, previously described,
ify different kinds of markers, called special markers in
was initially developed to represent human motion across
the generated terrain according what the user desires. In-
the terrain. Considering this, we show that our model can
deed, this feature allows for the user to specify semantic
be easily adapted to provide non-human motion, e.g. fish in
information about the environment. Therefore, it is pos-
a lake, since it is possible to represent a lake by the use of
sible to specify walkable, semi-walkable and non-walkable
non-walkable markers. To make it possible we can define
regions in the terrain, defining special markers in the space.
f t for each agent, so, it will distinguish regions according
Considering a natural environment, for example, it is pos-
to motion information. For example, to provide the charac-
sible to delimit a space representing a water region by the
ters motion in water places, we consider ft in the opposite
use of non-walkable markers. During the simulation phase,
way to what is defined in Equation 5. In this way, the mark-
the characters motion in this specific region is not allowed.
ers defined as non-walkable can be used in the characters
In Figure 6 the different markers defined to be used in the
motion, and the opposite with the walkable markers.
simulation environment are illustrated: In A we show the
The paths considered by the agents are dynamically markers definition in terrain through the TerrainTool where
generated as presented. The use of special markers creates 1 means semi-walkable regions and 2 means non-walkable
the terrain reasoning as an emergent feature. regions and in B we show the representation of markers and
Another possibility that can be used in the agents special markers in the simulation space.
movement is a path planning algorithm, e.g. A*. Such al- Considering the special markers, the agents move in
gorithm allows for the generation of a path with sub-goals, the space through different trajectories generated as a func-
which can be followed by the agents to achieve their main tion of our terrain reasoning model. Figure 7 shows a tra-
goal. In our method, we use the approach presented by jectory of a group of agents that needs to move from the
Millington [15]. The graph requested in the algorithm exe-
cution is defined on the terrain, considering its features and 1 http://irrlicht.sourceforge.net/
to be used in a path. Finally, we can observe in the graph, a
region without edges (2) because such region was defined
as a non-walkable place.
source (S) to target (T) point considering special markers Figure 8. The graph used in the A*. It is possible to observe
in the terrain (Fig 7 - A). It is possible to observe that the vertices (nodes) and edges used in the path planning
the agents do not make use of non-walkable markers in algorithm. In (1) we can see a region with semi-walkable
their motion (Fig 7 - C) and, on the other hand, the semi- places and the region without edges (2) means a space with
walkable markers are considered (Fig 7 - B, D) in the mo- non-walkable markers.
tion just in cases where it is not possible for agents to walk
across original markers (without special definition).
In the simulation environment, we can observe in Fig-
ure 9 the generated path for agents to achieve their goal.
In A, we show four generated paths that will be used by
groups of agents during the simulation phase. In B, C and
D, we present different moments of the simulation. Each
group is composed by 12 agents and initial and goal posi-
tions are determined as follows: for group 1, path is formed
from node 1 to node 4, while group 4 applies the opposite
way. Group 2 follows a path formed from node 2 to node
3, and group 3 applies the path from node 3 to 2.
[1] B ELHADJ , F., AND AUDIBERT, P. Modeling land- [12] L EWIS , J. P. Generalized stochastic subdivision.
scapes with ridges and rivers: bottom up approach. ACM Trans. Graph. 6, 3 (1987), 167–190.
[13] L INTERMANN , B., AND D EUSSEN , O. Interactive [25] RUNIONS , A., F UHRER , M., L ANE , B., F ED -
modeling of plants. IEEE Comput. Graph. Appl. 19, ERL , P., ROLLAND -L AGAN , A.-G., AND
1 (1999), 56–65. P RUSINKIEWICZ , P. Modeling and visualiza-
tion of leaf venation patterns. In SIGGRAPH ’05:
[14] M ILLER , G. S. P. The definition and rendering of
ACM SIGGRAPH 2005 Papers (New York, NY,
terrain maps. In SIGGRAPH ’86: Proceedings of the
USA, 2005), ACM, pp. 702–711.
13th annual conference on Computer graphics and
interactive techniques (New York, NY, USA, 1986), [26] S MELIK , R. M., DE K RAKER , K. J., G ROENEWE -
ACM, pp. 39–48. GEN , S. A., T UTENEL , T., AND B IDARRA , R. A sur-
vey of procedural methods for terrain modelling. In
[15] M ILLINGTON , I. Artificial Intelligence for Games
Proceedings of the CASA workshop on 3D advanced
(The Morgan Kaufmann Series in Interactive 3D
media in gaming and simulation (3AMIGAS) (Ams-
Technology). Morgan Kaufmann Publishers Inc., San
terdam, The Netherlands, 2009).
Francisco, CA, USA, 2006.
[16] M ÜLLER , P., W ONKA , P., H AEGLER , S., U LMER , [27] S UD , A., A NDERSEN , E., C URTIS , S., L IN , M.,
AND M ANOCHA , D. Real-time path planning for vir-
A., AND VAN G OOL , L. Procedural modeling of
buildings. In SIGGRAPH ’06: ACM SIGGRAPH tual agents in dynamic environments. In SIGGRAPH
2006 Papers (New York, NY, USA, 2006), ACM, ’08: ACM SIGGRAPH 2008 classes (New York, NY,
pp. 614–623. USA, 2008), ACM, pp. 1–9.
[17] M USGRAVE , F. K., KOLB , C. E., AND M ACE , R. S. [28] S UD , A., A NDERSEN , E., C URTIS , S., L IN , M. C.,
The synthesis and rendering of eroded fractal ter- AND M ANOCHA , D. Real-time path planning in dy-
rains. In SIGGRAPH ’89: Proceedings of the 16th namic virtual environments using multiagent naviga-
annual conference on Computer graphics and inter- tion graphs. IEEE Transactions on Visualization and
active techniques (New York, NY, USA, 1989), ACM, Computer Graphics 14, 3 (2008), 526–538.
pp. 41–50. [29] WANG , T. Integer hash function. Tech. rep., HP En-
[18] O NG , T. J., S AUNDERS , R., K EYSER , J., AND terprise Java Lab., 2000.
L EGGETT, J. J. Terrain generation using genetic al-
[30] W ONKA , P., W IMMER , M., S ILLION , F., AND R IB -
gorithms. In GECCO ’05: Proceedings of the 2005
ARSKY, W. Instant architecture. In SIGGRAPH ’03:
conference on Genetic and evolutionary computation
ACM SIGGRAPH 2003 Papers (New York, NY, USA,
(New York, NY, USA, 2005), ACM, pp. 1463–1470.
2003), ACM, pp. 669–677.
[19] PARISH , Y. I. H., AND M ÜLLER , P. Procedural mod-
eling of cities. In SIGGRAPH ’01: Proceedings of the
28th annual conference on Computer graphics and
interactive techniques (New York, NY, USA, 2001),
ACM, pp. 301–308.
[20] P ERLIN , K. An image synthesizer. SIGGRAPH Com-
put. Graph. 19, 3 (1985), 287–296.
[21] P RUSINKIEWICZ , P., AND H AMMEL , M. A fractal
model of mountains and rivers. In Graphics Interface
’93 (May 1993), pp. 174–180.
[22] P RUSINKIEWICZ , P., AND L INDENMAYER , A. The
algorithmic beauty of plants. Springer-Verlag New
York, Inc., New York, NY, USA, 1996.
[23] R EICH , B., KO , H., B ECKET, W., AND BADLER ,
N. I. Terrain reasoning for human locomotion. In
In Proceedings of Computer Animation ’94 (1994),
IEEE Computer Society Press, pp. 996–1005.
[24] RODRIGUES , R. A., L IMA B ICHO , A., PARAVISI ,
M., J UNG , C. R., M AGALHAES , L. P., AND M USSE ,
S. R. Tree paths: A new model for steering behav-
iors. In IVA ’09: Proceedings of the 9th International
Conference on Intelligent Virtual Agents (Berlin, Hei-
delberg, 2009), Springer-Verlag, pp. 358–371.