<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Pathfinding and Map Feature Learning in RTS Games with Partial Observability</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Hao Pan</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>QOMPLX</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tysons Boulevard McLean</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Virginia</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>hao.pan@qomplx.com</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>In this paper we deal with the pathfinding problem in Real Time Strategy (RTS) games with partial observability for Artificial Intelligence (AI) agents. We first propose a Bootstrap JPS algorithm to perform pathfinding efficiently alongside a routine to preprocess terrain features. We then establish a grid system to learn map features systematically considering both mobile and immobile units. Utilizing the learned map features, we employ a waypoint-based pathfinding technique to navigate pathfinding agents away from threats efficiently. Using maps from a few established RTS games, we demonstrate the performance of our pathfinding framework and compare it with a few alternative approaches.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Pathfinding is the process of searching a graph and finding
a path between the start and the destination nodes. There
can be map features such as obstacles along the way,
making the process potentially challenging to solve.
Pathfinding is not a new topic, and various algorithms have already
been developed. There are mainly two schools of such
algorithms. Breadth-first search and depth-first search approach
this problem by examining all possible paths exhaustively.
The other school of algorithms focus more on finding the
optimal path. Dijkstra’s algorithm
        <xref ref-type="bibr" rid="ref3">(Dijkstra 1959)</xref>
        maintains an
“open set” and examines the node in the set with the
shortest distance from the start. Once the destination is marked
as visited, the shortest path is determined by tracing back all
the visited nodes.
        <xref ref-type="bibr" rid="ref13 ref16 ref19">(Wagner, Willhalm, and Zaroliagis 2005)</xref>
        reduced the search space of Dijkstra’s algorithm by
extracting geometric information from a given layout of the graph
and by encapsulating precomputed shortest-path
information in the so-called geometric containers. A*
        <xref ref-type="bibr" rid="ref5">(Doran and
Michie 1966)</xref>
        is an extension of Dijkstra’s algorithm. The
main difference is that A* assigns a weight to each node in
the open set equal to the cost from the starting node to that
node plus the approximate cost between that node and the
destination. The approximate distance is found by
heuristic.
        <xref ref-type="bibr" rid="ref2">(Bjo¨rnsson and Halldo´rsson 2006)</xref>
        used the dead-end
heuristic to eliminate certain map areas that are provably
irrelevant, and the so-called gateways to improve estimates
for the current query. The authors further demonstrated that
both heuristics reduced the exploration and time
complexity of A* search significantly over a standard distance
metric. Jump Point Search (JPS)
        <xref ref-type="bibr" rid="ref9">(Harabor and Grastien 2011)</xref>
        is considered an improvement over the A* algorithm as it
facilitates the search procedure by means of graph
pruning, eliminating certain nodes in the grid based on
assumptions that can be made about the current node’s neighbors.
This means the algorithm can consider long jumps from the
current node, while traditional A* only considers adjacent
nodes. In the following years, the authors further optimized
JPS by considering a preprocessing grid and stronger jump
rules
        <xref ref-type="bibr" rid="ref10 ref11">(Harabor and Grastien 2012, 2014)</xref>
        .
      </p>
      <p>
        It can be demanding when applying pathfinding in games,
as one has to consider extra factors such as map
properties and algorithm efficiency.
        <xref ref-type="bibr" rid="ref13 ref16 ref2">(Bjo¨rnsson and Halldo´rsson
2006; Sturtevant and Buro 2005)</xref>
        used maps from
different games and of different sizes. They evaluated the
performance of pathfinding methods based on multiple criteria
such as the number of nodes expanded, path-length, and
runtime.
        <xref ref-type="bibr" rid="ref22 ref8">(Zarembo and Kodors 2015)</xref>
        studied pathfinding
algorithms including A*, BFS, Dijkstra’s algorithm, HPA* and
LPA*
        <xref ref-type="bibr" rid="ref13 ref14">(Koenig, Likhachev, and Furcy 2004)</xref>
        , and compared
them based on execution time and the number of traversed
nodes. (Sturtevant et al. 2019) improved pathfinding
efficiency by planning in an abstract space and then refining
abstract paths to traversable paths. The authors took into
account terrain costs and dynamic terrain, and achieved a good
balance between memory usage, path quality, and
pathfinding speed.
        <xref ref-type="bibr" rid="ref12 ref22">(Hatem, Stern, and Ruml 2013)</xref>
        studied the
suboptimal search algorithms and proposed a linear space
analogue of Explicit Estimation Search (EES) to alleviate the
problem of the memory being overrun on large problems.
      </p>
      <p>
        Additional considerations were needed when applying
pathfinding in Real Time Strategy (RTS) games such as
StarCraft. On a general level, the prevalent approach is to
couple terrain learning/analysis methods and pathfinding.
        <xref ref-type="bibr" rid="ref7">(Hagelba¨ck 2015)</xref>
        coupled pathfinding with two techniques:
1) Potential Field (PF); and 2) Flocking. They discovered
that PF techniques require much more computational
resources than the counterpart which is relatively simpler.
        <xref ref-type="bibr" rid="ref1 ref18">(Amador and Gomes 2019)</xref>
        combined Influence Maps and
pathfinding in a way that the influence costs replaced the
traditional distance-based costs. Utilizing repulsors and
attractors in the game world, the authors constructed
boundedsearch pathfinders that avoid obstacles (repulsors) and
follow check points (attractors).
        <xref ref-type="bibr" rid="ref15">(Ninomiya et al. 2014)</xref>
        introduced hybrid environment representations that balance
computational efficiency and search space density to provide a
minimal, yet sufficient, discretization of the search graph for
constraint-aware navigation.
      </p>
      <p>
        There are still challenges present for pathfinding in RTS
games with partial observability. Even for a well established
algorithm such as the A*, it can be improved much
further. An AI agent with poorly performing pathfinding
routines slows down the game and hurts a human’s experience
of playing against it. Additionally, in tournaments there are
limits on how much time an agent can spend within each
logical step (also known as frame) for doing everything
including pathfinding. For example, a bot will be given a game
loss if it spends more than one second in at least ten game
frames in the AIIDE StarCraft AI competition1. Last but not
least, the Fog of War (FoW) obscures the position
information of opponent units, making pathfinding difficult. FoW is
the common way partial observability presents itself in RTS
games.
        <xref ref-type="bibr" rid="ref6">(Hagelback and Johansson 2008)</xref>
        illustrated that a
bot using potential fields can deal with imperfect
information equally well as one with the perfect information, while
being computationally more efficient, using the game Open
Real Time Strategy (ORTS). However, ORTS is a much
simpler game than StarCraft and these authors did not consider
unit movement under the FoW. Furthermore, potential field
based methods are prone to get stuck in local minima.
      </p>
      <p>In this paper, we propose a pathfinding framework to
tackle the aforementioned challenges by means of: 1)
performing preprocessing to eliminate nodes deemed
unnecessary to explore; 2) devising the Bootstrap JPS to further
improve the efficiency of the exploration; 3) establishing a
grid system which is capable of both efficiently storing the
learned position of immobile units and predicting the
potential position a mobile unit may move to under the FoW;
and 4) employing a waypoint-based pathfinding technique
to navigate the pathfinding agents out of danger efficiently.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <p>2.1</p>
      <sec id="sec-2-1">
        <title>Problem Definition and Assumptions</title>
        <p>First we describe some details of the pathfinding problem we
are dealing with here. The input of the pathfinding problem
is a map where some parts are covered by the FoW which
can be lifted once the influenced area is explored. The
presence of the FoW conceals certain information such as the
position of an enemy unit and the shape of the terrain. Even
with perfect information, the built-in pathfinding algorithm
can sometimes fail to find a valid path, causing units to get
stuck indefinitely when being issued a move command.
Furthermore, certain information such as the start and
destination nodes can be potentially changing. We utilize the
8connected grid map representation. We further assume there
is no traveling cost (e.g., it is equally easy to traverse
grasslands and deserts, and there is no extra difficulty when
mov1AIIDE StarCraft AI tournament has rules on frame times:
https://www.cs.mun.ca/ dchurchill/starcraftaicomp/rules.shtml
ing downhill or uphill). We deal with single-agent
pathfinding problems and the pathfinding agent does not have size.
We also assume that the unit collision does not exist. The
solution to the problem is expected to yield an optimal path
safe for pathfinding agents to travel on from enemy threats
which can damage or even kill the agents.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Terrain Preprocessing</title>
        <p>We believe terrain preprocessing is a necessary step to
perform before the actual pathfinding process begins. More
specifically, this is about performing obstacle filling which
is achieved by completing the following sub-tasks:
i Identify U-/L- shaped islands which are adjacent obstacle
nodes connected to each other either horizontally or
vertically. We do not consider diagonally connected nodes as
doing so could potentially identify two different islands
as a single one.
ii Mark the nodes bounded by those islands identified
previously as obstacles.</p>
        <p>The motivation here is that the U-/L-shaped islands could
lead to the exploration of nodes which are not on the optimal
path and cause an algorithm to get stuck. Subtask i can be
accomplished by sweeping through every node on the map and
conducting a depth-first search (DFS). In each DFS
traversal we recursively call for the 4 neighbours. We keep track of
the visited nodes so that they are not visited again. Subtask
ii is fulfilled by examining every node on the map to see if
they are bounded by the obstacles in at least three out of the
four directions (up, down, left, right). We only care about
the L-shaped islands when at least one of the ends touches
the boundary of the map. If that is the case, the map
boundary effectively acts as an obstacle, and combined with the
L-shaped island, they together form a U-shaped island. To
ease the understanding, one can consider the map boundary
as an artificially added obstacle which is to be welded to the
L-shaped island (see fig. 1 for a visual demonstration). Note
that for cases where the destination node or nodes from
another island are bounded by the U-/L-shaped islands,
obstacle filling is not to be performed, otherwise one runs the risk
of blocking the agent from finding the destination by adding
obstacles unnecessarily. All the procedures discussed here
are summarized in algorithm 1.</p>
        <p>In algorithm 1, grid is a matrix storing the status of each
node. A value of 0 means the current node is not an
obstacle, 1 means it is an obstacle, and 2 means the current
node is already visited for island counting purposes. count
is the number of the islands identified. The size of a
particular island, Islandk, is the number of nodes constituting
this island. There are three blocks of code in algorithm 1.
The first defines the M arkIsland() function which is to be
recursively called by the second block of code. The
execution of the first two blocks of code identifies all the islands if
they exist. The last block of code examines if a node is
surrounded by a U-/L-shaped island and artificially marks the
node as an obstacle if so.</p>
      </sec>
      <sec id="sec-2-3">
        <title>Bootstrap Jump Point Search</title>
        <p>Jump Point Search (JPS) speeds up pathfinding on
uniformcost grid maps by “jumping over” many locations that would
otherwise need to be explicitly considered. Here we aim at
expediting the exploration further by using JPS itself (hence
the term bootstrap) to compute the cost function between a
node and the destination instead of calculating the heuristics
using traditional means such as the Euclidean or
Manhattan distance. Depending on the complexity of the terrain,
Euclidean or Manhattan distance may sometimes provide
an overly optimistic estimation because neither metric
considers obstacles along the way. The Bootstrap JPS is to be
used after the completion of the terrain preprocessing as
discussed previously. The time complexity associated with the
bootstrap JPS is O(n2) considering the worst case scenario
where every possible (source, destination) pairing must be
evaluated. However, this process is easily parallelizable.</p>
      </sec>
      <sec id="sec-2-4">
        <title>Memoization routine for Bootstrap JPS We store the</title>
        <p>path found and its length for each node, hoping to further
speed up the search process. At each iteration of Bootstrap
JPS, a few sub-pathfinding problems are solved and
potentially the solution to one of them is a part of the optimal
path. The solution to each of these sub problems consists of
a series of nodes leading to the destination from the current
node. Storing such nodes can potentially allow us to
terminate the Bootstrap JPS at a much earlier point and further
improve the efficiency.</p>
        <p>To determine when to terminate the Bootstrap JPS, we
rely on two simple conditions:
i Terminate the Bootstrap JPS when an optimal path from
the current node to the destination is found.
ii Terminate the Bootstrap JPS when an optimal path from
the next node (a jump point) to the destination is found.</p>
      </sec>
      <sec id="sec-2-5">
        <title>Optimality of Bootstrap JPS Often in a pathfinding pro</title>
        <p>cess, a heuristic is used to estimate the cost of reaching the
goal state. A heuristic function is said to be admissible if it
never overestimates the cost of reaching the goal. That is,</p>
        <sec id="sec-2-5-1">
          <title>Algorithm 1 Obstacle Filling</title>
        </sec>
        <sec id="sec-2-5-2">
          <title>MarkIsland(grid, p, q, ROWS, COLS)</title>
          <p>if Node(p, q) is within the map boundaries then</p>
          <p>Mark current cell as visited: grid[p][q] = 2
MarkIsland(grid, p, q-1, ROWS, COLS)
MarkIsland(grid, p, q+1, ROWS, COLS)
MarkIsland(grid, p-1, q, ROWS, COLS)</p>
          <p>MarkIsland(grid, p+1, q, ROWS, COLS)
end if
for i0 in 1:ROWS do
for j0 in 1:COLS do
if grid[i0][j0] == 1 then
count++</p>
          <p>MarkIsland(grid, i0, j0, ROWS, COLS)
end if
end for
end for
for i in 1:ROWS do
for j in 1:COLS do
if Node(i, j) is surrounded by an island or a map
boundary in any three of the four directions (left,
right, top, bottom) then</p>
          <p>Mark Node(i, j) as an obstacle
end if
end for
end for
the cost it estimates to reach the goal is not higher than the
lowest possible cost from the current point in the path.</p>
          <p>An algorithm will terminate on the shortest path if an
admissible heuristic is used and the algorithm progresses per
iteration only along the path that has the lowest total
expected cost of several candidate paths and terminates the
moment any path reaches the goal. In short, using an
admissible heuristic guarantees the optimality of the path found if
such a path exists.</p>
          <p>
            Our proposed approach computes the heuristic by
calculating the lengths of the paths found by JPS and
memorizes them for all following intermediate calculations. It
is already proven that the JPS yields optimal paths
            <xref ref-type="bibr" rid="ref11 ref9">(Harabor and Grastien 2011, 2012)</xref>
            . This means our heuristic can
never overestimate the cost and consequently the heuristic
is indeed admissible. At this point we can say our proposed
approach also guarantees the optimality of the paths.
2.4
          </p>
        </sec>
      </sec>
      <sec id="sec-2-6">
        <title>Unit movement estimation under the FoW</title>
        <p>When one applies pathfinding methods in an RTS game
environment where the Fog of War is present, the optimal path
may sometimes backfire, as the obstacles/threats may have
changed their position without being detected, and as a
result hinder/damage the pathfinding agent(s). The corrrect
estimation of unit movement under the FoW becomes vital to
solving the pathfinding problem in this setting.</p>
        <p>The core of the solution to address the estimation of unit
movement with partial observability is the velocity of the
unit. Such quantity is available via BWAPI2 which enables
an AI bot to interact with the game StarCraft. BWAPI
provides the kind of information a human player would have
access to. The velocity information is not always available,
as it would become inaccessible if the unit in question is
under the FoW.</p>
        <p>In order to estimate the unit movement, the question to
consider is, how far into the future would we like to perform
the forecast? Our approach is to set the time window to be
the duration tdur it takes for a unit to cover its sight range
dsight while traveling at its speed v:
tdur =
dsight
v</p>
        <p>In StarCraft, a unit has both a sight range and an attack
range, with the sight range being oftentimes greater than the
attack range. If an enemy unit were to attack ours, it needs to
travel to a point where the target is within the attack range.
By having it to cover the entire sight range, we ensure that
the estimation serves as the upper ceiling.</p>
        <p>
          What happens when we do not have access to a unit’s
velocity (i.e., the unit is covered by the FoW)? We turn to
heuristics by first acquiring the last known position and the
velocity of the unit. Using such information, the velocity is
then modeled as one that decays over time. This means that
as time goes by, we grow more and more uncertain about the
velocity, and as a result, the magnitude of the velocity will
gradually reach zero, indicating that any obscured area in
the contiguous FoW is possible for the unit to travel to. The
interpretation in this context is that, given enough time, if a
unit is still under the FoW, it becomes reasonable to assume
that it is not actively trying to come out of FoW/chasing our
unit(s). As a result, it would be safe to assume that the
magnitude of its velocity is zero as the unit can be traveling in
any direction. This approach is similar to the particle model
          <xref ref-type="bibr" rid="ref21 ref9">(Weber, Mateas, and Jhala 2011)</xref>
          . However, our decay model
has the advantage of being flexible to account for the threat
level perceived, and this is controlled by the power
parameter p in the decay model:
v = v0
v0
p
tdur
tp
        </p>
        <p>Here v0 is the last known velocity of the unit before it
entered the FoW and became inaccessible. The model is
further illustrated in fig. 2.
2.5</p>
      </sec>
      <sec id="sec-2-7">
        <title>Map Feature Learning</title>
        <p>Having the correct unit movement estimation alone is not
enough to solve the pathfinding problem in an RTS game
environment. There are not only the usual terrain obstacles
we see, but also enemy units and buildings which can spawn
or move throughout the game, and affect the traversability of
nodes. We deemed the following features necessary to learn
to facilitate the pathfinding process.</p>
        <p>2The GitHub page of BWAPI: https://github.com/bwapi/bwapi
(1)
(2)
Terrain Features (Altitudes) Here we identify terrain
features such as a plateau which cannot be moved/destroyed
at all times. The identification of such features needs to be
done only once. Depending on the destination, ground units
will have to find either the way around the plateau, or the
ramp leading up to the plateau, thus posing a challenge for
pathfinding.</p>
        <p>Enemy Units’ Position It is easy to mark a unit’s position
if we can see the unit, but otherwise this matter becomes
difficult, as a unit can move, and under the FoW, we would
not be able to know the direction of the movement. This is
exactly the place where section 2.4 can become useful.</p>
        <p>Next, we categorize all mobile units as follows:
i Workers: these units are the primary targets for us to
harass as much as possible, so that we can disrupt the
opponent’s economy. After all, “having more units” remains a
fundamental winning condition in many RTS games.
ii Units that can attack ground targets
iii Units that can attack air targets</p>
        <p>Separating items ii and iii is essential because
pathfinding for ground units and pathfinding for air units are very
different: they depend on the opponent’s ground and air threats.</p>
        <p>Having the position of the units is not enough. We also
care about the attack range a unit has. This means the attack
range of both the opponent’s units and our own. This kind
of information together with the position information would
help a pathfinding routine to discover the position that would
allow us to fire on the opponent’s units at our maximum
attack range while staying out of theirs.</p>
        <p>
          Enemy Buildings’ Position We learn only the opponent’s
defensive buildings here. An immobile defensive structure
has its own attack range. Together with its position, all the
areas under the influence of such buildings are marked as
red grids (as in fig. 3) indicating positions to avoid. Unlike
a unit, a building cannot move, so what we once discovered
remains there unless the building gets destroyed. There are
opponent’s workers alongside the defensive buildings,
complicating the learning process. However, we were still able
to find the few green grids which are safe places for the
attackers to harass the workers.
Waypoint-based pathfinding techniques
          <xref ref-type="bibr" rid="ref23">(Zhu et al. 2015)</xref>
          offer an easy way to specify the space and handle obstacles.
The motivation of us employing it here is to establish
waypoints around any identified threat, and in turn facilitate the
pathfinding process. The simplest way to do so is to set up a
few corner points around the threat. fig. 4 illustrates a simple
example. The pathfinding agent first identifies a threat which
was previously unknown (potentially due to the Fog of War).
At the time of the discovery, the agent is already within the
radius of the effect exerted by the threat. The agent must
choose a set of waypoints in order to return to safety. First
path #1 is chosen because waypoint D is the closest to the
agent. It is desirable to evade the threat as soon as
possible. Then path #2 is chosen because waypoint C is closer to
the destination than waypoint B. Waypoint A is out of
question as an agent is only allowed to travel between adjacent
waypoints. Finally path #3 is chosen since it leads to the
destination directly and is deemed safe to travel upon.
        </p>
        <p>Compared to conventional pathfinding techniques such as
A*, the waypoint-based one has the advantage of exploring
much fewer nodes at the cost of the optimality of the path.
This is an acceptable tradeoff in an RTS game environment
where speedy reactions are important.</p>
        <p>There are a few small caveats here: 1) the agent is
forbidden from traveling through all the waypoints as that would
mean the agent is stuck travelling around the threat
indefinitely; 2) it is forbidden to set waypoints (illustrated as the
grey circles on fig. 4) directly on the edge of the threat
radius. This would endanger the agent as it travels between
such waypoints; and 3) the number of waypoints
established around the threat can have an impact on the agent’s
evasion from the threat as well as the computation
efficiency. In practice we found that eight waypoints around
each threat usually suffice to ensure that there are enough
safe nodes/options for the agent to choose from while not
inducing too much additional computation burden.</p>
        <p>
          We couple the waypoint-based pathfinding technique with
the proposed Bootstrap JPS based on the state of the
pathfinding agent. In the normal state where the agent has no
threat nearby, it proceeds to the destination using the
Bootstrap JPS. We switch immediately to the waypoint-based
pathfinding technique once there are threats close to the
agent, in order to minimize the potential damage dealt to
the agent. The waypoint-based technique also pairs with the
unit movement estimation smoothly as the position of the
waypoints can be readily updated based on the estimated
position of the threats.
The purpose of the case study is to compare the proposed
pathfinding framework with a few alternative approaches,
namely, A* and JPS. We applied all three pathfinding
techniques on two maps which are illustrated by figs. 5 and 6,
respectively. The maps were taken from a benchmark map
set3 created by
          <xref ref-type="bibr" rid="ref17">(Sturtevant 2012)</xref>
          . The two maps are from
the RTS Game WarCraft III (published in July, 2002) and
StarCraft (published in March, 1998), respectively. On each
map we randomly chose 1000 pairs of starting and
destination nodes. Throughout the case study we assumed partial
observability. For each pair of starting and destination nodes,
we insert either a static or mobile enemy unit at a random
location along the optimal path which was pre-computed by
A*. Both the static and mobile enemy units were initially
unknown to the computer-controlled pathfinding agent due
to the partial observability. We programmed a set of simple
rules to govern the behavior of the mobile enemy unit. This
enemy unit always tries to move to or stay at its starting
position if the pathfinding agent is outside of its sight range.
Once the pathfinding agent is within the sight range but
outside of its attack range, the enemy unit will begin to chase
the agent. The enemy unit will attack the agent if the agent
is within its attack range. When using A* and JPS, the
enemy unit is handled by marking all the nodes within its sight
range as obstacles. Whenever a certain amount of nodes are
        </p>
        <sec id="sec-2-7-1">
          <title>3The map set is available from here: http://movingai.com</title>
          <p>newly marked as obstacles, every pathfinding technique is
going to be rerun as the map they operate on has effectively
changed. All experiments were run on a 2.2 GHz CPU
computer.</p>
          <p>Due to the complexity of the environment for
pathfinding, we use a few criteria to evaluate the performance of
pathfinding routines quantitatively: 1) number of nodes
explored/evaluated (NE); 2) runtime (RT) measured in
seconds; and 3) remaining hit points (RHP) of the pathfinding
agent after reaching the destination. The RHP is expressed
as a percentage of the agent’s total hit points. The results
for all the scenarios are summarized in table 1. We can see
that A* explored many more nodes than the other two
techniques and the RT is much longer as a result. Both the JPS
and our proposed pathfinding framework greatly reduced the
NE values. The proposed framework explored a few more
nodes on average than JPS mainly due to the additional
waypoints around the threats it established. As these nodes are
easily obtained, the resulting RT is slightly lower than that
of JPS. Both the A* and JPS scored poorly in terms of RHP
as they are not dedicated to this particular pathfinding
problem where partial observability is present. The matter
becomes worse when the enemy threat is mobile. While by
design, the proposed framework handles this problem more
sophisticately and significantly reduced the amount of
damage received from the enemy threat. Overall, the proposed
pathfinding framework performed the best here.
In this paper we proposed a pathfinding framework to
address the challenges encountered when performing
pathfinding in RTS games with partial observability by means of:
1) preprocessing terrain/map features to prevent
pathfinding routines to get stuck locally; 2) creating the Bootstrap
JPS to compute the cost function more accurately and in
turn further eliminate nodes deemed unnecessary to explore;
3) constructing the velocity decay model to predict unit
movement under the FoW; and 4) employing a
waypointbased pathfinding technique to help pathfinding agents to
maneuver around threats efficiently. We demonstrated that
the proposed framework was superior than a few mainstream
pathfinding routines such as A* and JPS.</p>
          <p>
            In the future we would like to augment this work by: 1)
solidifying an effective way to learn the decay rate used in the
decay model either in-game on the fly or from past data; 2)
considering other possibilities of velocity development
under the FoW. Currently we assume the worst case where an
enemy unit would immediately begin to chase our units at
all costs. This can be highly situational and depends on
several things such as the opponent’s stance (defensive or
offensive); 3) optimizing the resolution of the grid system. We
have noticed that occasionally units can still catch enemy’s
fire while maneuvering around using Bootstrap JPS and the
grid system. This was mainly caused by a grid falsefully
being marked as safe due to the relatively coarse resolution and
not accounting for unit sizes; 4) parallelizing the
preprocessing procedure to further speed up pathfinding; and 5)
comparing results with those from D* (Stentz 1994) and/or D*
Lite
            <xref ref-type="bibr" rid="ref13 ref16">(Koenig and Likhachev 2005)</xref>
            , especially for scenarios
where the obstacles are changing their position.
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Acknowledgment</title>
      <p>The authors would like to specifically thank Nathan Roth
(MSc) for his dedicated effort in helping to construct our
own StarCraft bot. The authors would also like to thank the
SSCAIT community for their kind support. The authors are
equally thankful for Dennis Waldherr and his BASIL
ladder, as it provided an invaluable test-bed like environment to
see replays in a timely fashion, ensuring our StarCraft bot is
performant and bug-free.
navigation in dynamic environments. Computer Animation
and Virtual Worlds .</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Amador</surname>
          </string-name>
          , G.; and
          <string-name>
            <surname>Gomes</surname>
            ,
            <given-names>A. J.</given-names>
          </string-name>
          <year>2019</year>
          .
          <article-title>Bounded-Search Pathfinders Based on Influence Maps Generated by Attractors and Repulsors</article-title>
          .
          <source>IEEE Transactions on Games 99.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Bjo</surname>
            ¨rnsson, Y.; and Halldo´rsson,
            <given-names>K.</given-names>
          </string-name>
          <year>2006</year>
          .
          <article-title>Improved Heuristics for Optimal Pathfinding on Game Maps</article-title>
          .
          <source>In Artificial Intelligence and Interactive Digital Entertainment Conference</source>
          ,
          <volume>9</volume>
          -
          <fpage>14</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Dijkstra</surname>
            ,
            <given-names>E. W.</given-names>
          </string-name>
          <year>1959</year>
          .
          <article-title>A note on two problems in connexion with graphs</article-title>
          .
          <source>Numerische Mathematik</source>
          <volume>1</volume>
          :
          <fpage>269</fpage>
          -
          <lpage>271</lpage>
          . doi:10.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>1007/BF01386390.</mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Doran</surname>
            ,
            <given-names>J. E.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Michie</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <year>1966</year>
          .
          <article-title>Experiments with the Graph Traverser program</article-title>
          . In Lockwood, M., ed.,
          <source>Proceedings of the Royal Society A</source>
          ,
          <fpage>235</fpage>
          -
          <lpage>259</lpage>
          . London, United Kingdom: Royal Society.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Hagelback</surname>
          </string-name>
          , J.; and
          <string-name>
            <surname>Johansson</surname>
            ,
            <given-names>S. J.</given-names>
          </string-name>
          <year>2008</year>
          .
          <article-title>Dealing with Fog of War in a Real Time Strategy game environment</article-title>
          .
          <source>In 2008 IEEE Symposium On Computational Intelligence and Games</source>
          ,
          <volume>55</volume>
          -
          <fpage>62</fpage>
          . doi:
          <volume>10</volume>
          .1109/CIG.
          <year>2008</year>
          .
          <volume>5035621</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <article-title>Hagelba¨ck</article-title>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <year>2015</year>
          .
          <article-title>Hybrid Pathfinding in StarCraft.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <source>IEEE Transactions on Computational Intelligence and AI in Games</source>
          <volume>8</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>1</lpage>
          . doi:
          <volume>10</volume>
          .1109/TCIAIG.
          <year>2015</year>
          .
          <volume>2414447</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Harabor</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Grastien</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Online Graph Pruning for Pathfinding on Grid Maps</article-title>
          .
          <source>In Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence</source>
          ,
          <fpage>1114</fpage>
          -
          <lpage>1119</lpage>
          . San Francisco, CA, USA: AAAI.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Harabor</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Grastien</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Improving Jump Point Search</article-title>
          . In Chien, S.; and
          <string-name>
            <surname>Fern</surname>
          </string-name>
          , A., eds.,
          <source>Proceedings International Conference on Automated Planning and Scheduling</source>
          , ICAPS,
          <fpage>128</fpage>
          -
          <lpage>135</lpage>
          . Portsmouth,
          <string-name>
            <surname>NH</surname>
          </string-name>
          , USA: AAAI.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Harabor</surname>
          </string-name>
          , D. D.; and
          <string-name>
            <surname>Grastien</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>The JPS Pathfinding System</article-title>
          .
          <source>In Proceedings of the Fifth Annual Symposium on Combinatorial Search</source>
          ,
          <fpage>207</fpage>
          -
          <lpage>208</lpage>
          . Niagara Falls, Canada: AAAI.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Hatem</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Stern</surname>
          </string-name>
          , R.; and
          <string-name>
            <surname>Ruml</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Bounded Suboptimal Heuristic Search in Linear Space</article-title>
          .
          <source>In Proceedings of the Symposium on Combinatorial Search (SoCS-13).</source>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Koenig</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; and Likhachev,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <year>2005</year>
          .
          <article-title>Fast Replanning for Navigation in Unknown Terrain</article-title>
          .
          <source>Transactions on Robotics</source>
          <volume>21</volume>
          :
          <fpage>254</fpage>
          -
          <lpage>363</lpage>
          . doi:
          <volume>10</volume>
          .1109/tro.
          <year>2004</year>
          .
          <volume>838026</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Koenig</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Likhachev,
          <string-name>
            <given-names>M.</given-names>
            ; and
            <surname>Furcy</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.</surname>
          </string-name>
          <year>2004</year>
          .
          <string-name>
            <given-names>Lifelong</given-names>
            <surname>Pathplanning</surname>
          </string-name>
          <string-name>
            <surname>A</surname>
          </string-name>
          *.
          <source>Artificial Intelligence</source>
          <volume>155</volume>
          :
          <fpage>93</fpage>
          -
          <lpage>146</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Ninomiya</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Kapadia</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Shoulson</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Garcia</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Badler</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Planning approaches to constraint-aware</article-title>
          <string-name>
            <surname>Stentz</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>1994</year>
          .
          <article-title>Optimal and Efficient Path Planning for Partially-Known Environments</article-title>
          .
          <source>In Proceedings of the International Conference on Robotics and Automation</source>
          ,
          <volume>3310</volume>
          -
          <fpage>3317</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Sturtevant</surname>
            , N.; and Buro,
            <given-names>M.</given-names>
          </string-name>
          <year>2005</year>
          .
          <article-title>Partial Pathfinding Using Map Abstraction and Refinement</article-title>
          .
          <source>In Proceedings of the 20th National Conference on Artificial intelligence,</source>
          volume
          <volume>3</volume>
          ,
          <fpage>1392</fpage>
          -
          <lpage>1397</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Sturtevant</surname>
            ,
            <given-names>N. R.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Benchmarks for Grid-Based Pathfinding</article-title>
          .
          <source>IEEE Transactions on Computational Intelligence and AI in Games</source>
          <volume>4</volume>
          (
          <issue>2</issue>
          ):
          <fpage>144</fpage>
          -
          <lpage>148</lpage>
          . doi:
          <volume>10</volume>
          .1109/ TCIAIG.
          <year>2012</year>
          .
          <volume>2197681</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          2019.
          <article-title>Pathfinding and Abstraction with Dynamic Terrain Costs</article-title>
          .
          <source>In Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment</source>
          , volume
          <volume>15</volume>
          ,
          <fpage>80</fpage>
          -
          <lpage>86</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Wagner</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ; Willhalm,
          <string-name>
            <given-names>T.</given-names>
            ; and
            <surname>Zaroliagis</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          <year>2005</year>
          .
          <article-title>Geometric Containers for Efficient Shortest-Path Computation</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <source>ACM Journal of Experimental Algorithmics</source>
          <volume>10</volume>
          (
          <issue>1</issue>
          .3):
          <fpage>1</fpage>
          -
          <lpage>30</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>B. G.</given-names>
          </string-name>
          ; Mateas,
          <string-name>
            <given-names>M.</given-names>
            ; and
            <surname>Jhala</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          <year>2011</year>
          .
          <article-title>A Particle Model for State Estimation in Real-Time Strategy Games</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <string-name>
            <surname>Zarembo</surname>
            ,
            <given-names>I.;</given-names>
          </string-name>
          and
          <string-name>
            <surname>Kodors</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2015</year>
          .
          <article-title>Pathfinding Algorithm Efficiency Analysis in 2D Grid</article-title>
          .
          <source>In Proceedings of the International Scientific and Practical Conference. doi:10.17770/ etr2013vol2</source>
          .
          <fpage>868</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <string-name>
            <surname>Zhu</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Jia</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ; Wan,
          <string-name>
            <given-names>H.</given-names>
            ;
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ;
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ;
            <surname>Qin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            ; and
            <surname>Cui</surname>
          </string-name>
          ,
          <string-name>
            <surname>X.</surname>
          </string-name>
          <year>2015</year>
          .
          <article-title>Waypoint Graph Based Fast Pathfinding in Dynamic Environment</article-title>
          .
          <source>International Journal of Distributed Sensor Networks</source>
          <volume>11</volume>
          . doi:
          <volume>10</volume>
          .1155/
          <year>2015</year>
          /238727.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>