international workshop on serious games development and applications
Post on 11-May-2015
794 Views
Preview:
DESCRIPTION
TRANSCRIPT
Designing a PathFinding Algorithm to Enable
Dynamic
ELIOS Lab
1
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
DynamicRTS Serious Games
M. Bardini, F. Bellotti , R. Berta, A. De Gloria
ELIOS LabDIBE – University of Genoa
RTS
Popular game categoryTake decisions and move objects on a territory�Continuous time-line
In typical RTS, roads and tracks in the background map are not considered by the application’s logic
2
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
application’s logic Just a different pattern, an ornamentNo benefits by passing through them
The past of RTS
Popular game series Age Of EmpireTM
and Total WarTM
In the Age of Empire series any unit follows the shortest path, even if it’s a simple worker or a soldier in patrolIn the Total War series roads are used only to enrich maps� In the world map, roads connect different cities
– In this case they are pre-calculated paths
3
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
And the future?
Recently, UbisoftTM proposed a new RTS for the WWII, R.U.S.ETM
Official news and videosbenefits for using roads�units will gain a speed up for the transfers, so controlling
roads will become vital
4
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
roads will become vital
Serious Game for Geo-Training
Work in Progress Serious GameTraining military workforces and civil protection personnel on specific target geographic areas
ChallengesLogic�Artificial opponent’s intelligence, levels, resources etc.
5
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
�Artificial opponent’s intelligence, levels, resources etc.
Processing of map images used as dynamic inputs.�Semantic interpretation and annotate of images usable
as a background corresponding to the logic of the application
– Identification of points for resource placement– Characterization of the territory– Definition of best paths to destination
The idea
A player moves objects on the mapThe system computes the best path & relevant time cost.� Considering the actual nature of the segments
– E.g. roads, fields, wood– standard image segmentation algorithms
RealPathAutomatic procedure for identifying best routes
6
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Automatic procedure for identifying best routes solely relying on the real-time processing of grayscale input images�With parallel computing implementation
Solution for designing levels of RTSsOther geo-referenced applications with paths in outdoor maps
Pathfinding
How to extract the nodes of a path-searchtree from a picture?Grid layouts
Polygonal/Tiles Movement, Edge Movement, Vertex Movement�Hybrid solutions
Waypoints as meaningful points in an
7
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Waypoints as meaningful points in an environment
Placed manually, like the connectionsVery efficient tree building
The RealPath algorithm
InputRaster image, satellite or aerial�Possibly ortophotos
– Accurate representation of the earth's surface– Adjusted for topographic relief, lens distortion, and
camera tilt
8
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
TargetAutomatic definition of waypoints
Automatic definition of waypoints
Pre-processingPixel value normalization�0-255 range
Square to enhance gradient
9
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Automatic definition of waypoints
A* search to destinationEvery pixel in the image as a possible nodeTraveling cost proportional to the gradient difference�Differentiate among large roads and small
winding roads
10
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
winding roads�Cost weighted with the terrain nature
– Terrain recognition
�A gradient threshold prevents off-road traveling and reduce the number of arcs
�The destination point may be off-road, the graph may result unconnected
– a loop gradually reduces the gradient threshold if the graph results to be unconnected
Automatic definition of waypoints
A simple animation
11
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Optimizations
A* algorithm scrolls all the nodes in the Open List to know whether a node was already created
Critical for a real-time responseOpen List implemented as a Hash Table
12
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Open List implemented as a Hash Table�Constant computational cost for each element,
independent of the search area�The Hash function relies on the position of the
pixel in the image
Optimizations
Our work has not considered optimizations for realizing a natural movement for the NPC
Important for 3D gamesLots of solutions already implemented in
13
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Lots of solutions already implemented in current videogamesThe RealPath’s output can be post-processed by a standard algorithm, to smooth the path and move it away from obstacles�Better results expected as computation points
are much more than in waypoint/grid algorithms
Pyramidal parallel implementation
Parallel algorithms to speed-up performance in current architecturesPyramidal algorithms, an established family of parallel algorithms for image processing
14
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
processingRobust feature extraction
Multilevel-resolutionA pyramid consists of a sequence of scaled and Gaussian-filtered images
Pyramidal parallel algorithms
Not a parallel version of A*RealPath designed to exploit parallel executions of A* processing distinct sets of data obtainable through lower-resolution analysis
15
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
resolution analysisCompute a very coarse first path
Define an initial set of points andRecursively refine the subpaths until converging to the final path in the original, high-resolution map.
Pyramidal parallel algorithms
A data structure (pyramid shape) is needed for
A first, coarse-grain analysis on a small-size imagesubsequent path refinements in ever more
16
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
subsequent path refinements in ever more detailed mapsAfter experiments, for a medium-size image (1-4 MB), 3- or 4-level Gaussian pyramids are sufficient
Pyramidal parallel algorithms
From the first path (top of the pyramid), a series of n points is chosen
Dividing a path into 30-40 segments usually gives optimal results�Strong dependence on the parallelism level of the
underlying computing architecture
17
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Every subsequent couple of such n points constitutes the start and arrival points of n-1 sub-paths
Every sub-path is independent of each other => separable working data sets => parallelizable computation
Pyramidal parallel algorithms
18
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
By joining the sub-paths in the original image, a sub-optimal path from the origin to the destination is obtained.
Pyramidal parallel algorithms
19
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
By joining the sub-paths in the original image, a sub-optimal path from the origin to the destination is obtained.
Pyramidal parallel algorithms
A simple animation
20
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Experiment
21
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
75 paths from 5 pictures (4 US, 1 Afg)
Results
Image Rate1- Suburban area. Large and well defined roads 73%2- Metropolis. Narrow and winding roads 67%3- Residential area. Winding, tree avenues (with noise due to
shadows)73%
4- Residential area. Narrower, but less winding roads 93%5- Central area in Kabul. Only dirt roads, difficult to distinguish 60%
22
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
5- Central area in Kabul. Only dirt roads, difficult to distinguishalso at naked eye
60%
Success criterion: path was the shortest and at least 95% on roadsIn all cases, start and arrival points were defined on roads
Case studies
Naturalistic ortophotos
23
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Rural paths
Case studies
Large and compressed orthophoto
24
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Symbolic grey-scale image
Time performance
Standard PC platformCPU: Intel Dual Core E6600 2.4 GhzRam: 2 GB, 800 Mhz8 MB cacheOperative System: Windows 7Language: C++, single thread, single task program
25
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Language: C++, single thread, single task program
Mode Time
With hashtable 1 ms
Without hashtable 3,6 ms
Real-Time behaviour
1.4x Memory footprint increase
Subpath length & performance
26
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Target applications
RealPath to be incorporated into game level editors of RTS games
With RealPath a designer (even an end-user) can load geographic pictures to build game maps
An RTS game player’s task of collecting resources may become repetitive and boring as soon as he has learnt the position of resources and the existing paths
27
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
learnt the position of resources and the existing paths in the map
Also strategies in the same battles fields may become trivial for skilled users
RealPath can improve the game’s longevity by supporting a simple and automatic generation of new game mapsThe mods concept
Target applications
Peace keeping mission scenariosThe player has to reach destinations for monitoring (they may be placed automatically on the map) and move conveys minimizing attack risks and damagesDecision strategy training combined with the possibility for a player to contextualize his experience in the real target area.
Civil protection scenario
28
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
Civil protection scenarioFirst, the whole road network for an area is computed through several iterations of the RealPath algorithmThen, some roads are blocked with a symbol, simulating the damages of the destructive event� e.g., an earthquake
Also in this case, personnel can realistically train on strategies in a real-world environment.
Conclusions
A new solution for automatic definition of paths on aerial/satellite images
Costs reduced for creating new game maps, also supporting UGCHigh-performance parallel implementation� GPUs� Now porting on CUDA
29
1st International Workshop on Serious Games Development & Applications
Univ. of Derby, 8 Jul. 2010
The algorithm has been tested with several real-world images, with good results
top related