Picture of Alexander Brazie
Alexander Brazie
Alexander is a game designer with 25+ years of experience in both AAA and indie studios, having worked on titles like World of Warcraft, League of Legends, and Ori and The Will of The Wisps. His insights and lessons from roles at Riot and Blizzard are shared through his Game Design Skills wiki, Funsmith Club, and game design bootcamps.
Skip To...

D-star (D*) Algorithm in Pathfinding: Definition, Comparison

D-star (D) Algorithm in Pathfinding: Definition, Comparison
Picture of Alexander Brazie
Alexander Brazie
Alexander is a game designer with 25+ years of experience in both AAA and indie studios, having worked on titles like World of Warcraft, League of Legends, and Ori and The Will of The Wisps. His insights and lessons from roles at Riot and Blizzard are shared through his Game Design Skills wiki, Funsmith Club, and game design bootcamps.

The D* algorithm is a pathfinding algorithm used in video games to plan routes for AI NPCs to follow. The D* algorithm behaves similarly to the A* algorithm, with the major difference being that the D* algorithm calculates its search for an optimal path at the end of a path rather than the beginning. Its goal is the same as the A* algorithm, however, in finding the shortest path for the AI to follow.

The D* algorithm calculates the cost
from the goal node to the start node

The D* algorithm is a popular pathfinding algorithm in video game development because of its efficiency and easier implementation, especially compared to the A* algorithm. Developers who are considering using D* pathfinding over A* pathfinding must know what D* is and how it behaves. Learn the definition of the D* pathfinding algorithm and the difference between pathfinding and path planning.

What is the definition of the D* pathfinding algorithm?

The D* pathfinding algorithm is a pathing algorithm used in video games with the purpose to find the shortest distance between a starting and ending point, similar to A* pathfinding, except it begins its calculation from the ending point to the starting point. The benefit of using D* over A* is that the D* algorithm updates the existing path when obstacles are encountered instead of starting a new path from scratch, making the algorithm run faster and more efficiently. The algorithm is used both for AI route planning in video games and mobile robotic pathfinding.

The original D* pathfinding algorithm was developed by Anthony Stentz in 1994, which he called an informed incremental search algorithm. The term D* comes from the name Dynamic A* because the algorithm behaves similarly to A* but with different cost behavior. D* is designed for maps that aren’t fully known or that change over time since the algorithm is able to dynamically update the path when it encounters new obstacles. Over time, new variants of the D* pathfinding algorithm were invented, such as Focused D* and D* Lite.

How the D* algorithm uses raise and
lower states to identify obstacles

Focused D* combines A* pathfinding and D* pathfinding after Stentz further developed the original D* algorithm. Focused D* aims to focus the algorithm on spreading its search based on raise and lower nodes. The algorithm uses a heuristic to accomplish this search, which ensures that only the nodes that matter are updated. This method is similar to how A* pathfinding works in that A* only computes the cost of a few nodes instead of an entire grid of nodes.

D* Lite was created by Sven Koenig and Maxim Likhachev. Koenig and Likhachev built D* Lite off of Lifelong Planning A*, which is an incremental heuristic search algorithm that combines the A* algorithm and the Dynamic SWSF-FP algorithm. Despite being called D* Lite, the algorithm isn’t based on the original D* or Focused D* algorithm. It does, however, have the same behavior. D* Lite is an easier algorithm to implement since it requires fewer lines of codes and provides better performance than Focused D*. Many game developers use D* Lite over D* for their pathfinding needs.

D* Lite implementation is added into the
existing code for the D* algorithm

Understanding how the D* algorithm works requires an understanding of the terms outlined below.

  • Node: Location on a graph or map that the algorithm, and later the AI, is moving to.
  • New: The node has never been placed on the open list.
  • Open: Data structure with nodes that have been discovered but not evaluated for cost efficiency yet.
  • Closed: Data structure that refers to nodes that have been discovered and evaluated for cost efficiency. Node information is placed on the closed list to prevent the algorithm from re-evaluating the same nodes repeatedly.
  • Cost: Distance from the end or goal node to the starting node, with the goal of finding the path through the available nodes that costs the least.
  • Raise: Informs the algorithm that the node has a higher cost than the last time the algorithm placed it on the open list.
  • Lower: Indicates that the node has a lower cost than the last time the algorithm placed it on the open list.

D* pathfinding searches work by having the algorithm begin at the end or goal node, and then selecting a node from the open list and evaluating it. The algorithm performs an action called expansion, which is when it spreads its search to all neighboring nodes and evaluates their cost from the goal node to the starting node. As the algorithm evaluates the cost of each node, focusing on the nodes with the smallest cost, or distance, from the end to start node, it creates a finalized path based on the cheapest, or shortest, distance.

D* works similarly to A* in that it searches
neighboring nodes for cost

The D* pathfinding algorithm is able to handle obstacles by detecting them along the intended path and tagging the nodes in the affected obstacle region as raised. When the nodes are placed on the open list and the algorithm reads that they’re raised, it tells the algorithm that it’s costlier to navigate through that area. Since the algorithm is seeking the cheapest route, its final path ignores the obstacle, avoiding it. In a video game, this means that the AI encounters a wall in its way and instead of walking through it, the algorithm tells it to walk around the wall since it’s the cheapest route.

What is the difference between pathfinding and path planning?

The difference between pathfinding and path planning is path planning finds all the possible paths while considering different aspects such as speed, obstacles, efficiency, and radius, while pathfinding searches for the shortest path amidst all the various paths that path planning generates. Pathfinding relies on information provided by path planning. Other differences between pathfinding and path planning include the type of constraints and algorithms they use to generate paths.

Constraints play a role in differentiating between pathfinding and path planning. Pathfinding is restricted to map geometry, such as avoiding collisions with walls or other obstacles. The major question pathfinding asks itself is the route that it needs to take. Path planning has several other constraints, such as physical dynamics. Physical dynamics such as speed, acceleration, and turning radius are important for it to consider. Path planning asks itself about both the route and movement strategy it needs to navigate the environment with the constraints present.

Pathfinding and path planning work
together to help Al navigate in games

Pathfinding and path planning use different algorithms. Pathfinding uses A*, D*, D* Lite, Dijkstra’s, and Breadth-First Search to determine the most optimal path from its starting point to its end point. Each algorithm behaves differently, but its goal of finding the shortest distance is the same across them. Path planning uses Rapidly-exploring Random Trees, and Trajectory Optimization algorithms to generate all the paths in an environment.

Join the Funsmith Tavern to get exclusive game dev tips that we don't share anywhere else

Each Friday, get a shot of 2-min TL:DR update in your inbox on the latest
Actionable tips, templates, or in-depth guides by game dev experts
— Entry-level Game design job listings(+ playtesting and internships)
— Private community workshops, events, and discussions

    The Funsmith Tavern

    Weekly Game Design Newsletter

    Level-up your game design knowledge, skills, career, and network

    Bi-weekly on Tuesday, get a shot of 2-min TL:DR update in your inbox on the latest

      All tactics. No fluff. Pro advice only. Unsubscribe any time

      Get Exclusive Game Design Tips that I Share Only with Funsmith Tavern Subscribers

      Weekly Game Design Newsletter

      Level-up your game design knowledge, skills, career, and network

      Bi-weekly on Tuesday, get a shot of 2-min TL:DR update in your inbox on the latest

        All tactics. No fluff . Pro advice only. Unsubscribe any time

        EXPERIENCE & BACKGROUND:

        [STUDIO] Blizzard Entertainment: Content, mechanics, and systems designer

        (Creator of Apex Legends & former Creative Director at Respawn)

        [GAME] World of Warcraft: MMORPG with 8.5 million average monthly players, won Gamer’s Choice Award – Fan Favorite MMORPG, VGX Award for Best PC Game, Best RPG, and Most Addictive Video Game.

        • Classic:
          • Designed Cosmos UI
          • Designed part of Raid Team for Naxxramas
        • Burning Crusade:
          • Designed the raid bosses Karazhan, Black Temple, Zul’Aman
          • Designed the Outlands content
          • Designed The Underbog including bosses:
            • Hungarfen, Ghaz’an, Swamplord Musel’ik, and The Black Stalker
          • Designed the Hellfire Ramparts final bosses Nazan & Vazruden
          • Designed the Return to Karazhan bosses: Attumen the Huntsman, Big Bad Wolf, Shades of Aran, Netherspite, Nightbane
        • Wrath of the Lich King:
          • Designed quest content, events and PvP areas of Wintergrasp
          • Designed Vehicle system
          • Designed the Death Knight talent trees
          • Designed the Lord Marrowgar raid
        • Cataclysm:
          • Designed quest content
          • Designed Deathwing Overworld encounters
          • Designed Morchok and Rhyolith raid fights
        • Mists of Pandaria: 
          • Overhauled the entire Warlock class – Best player rated version through all expansion packs
          • Designed pet battle combat engine and scripted client scene

        [GAME] StarCraft 2: Playtested and provided design feedback during prototyping and development

        [GAME] Diablo 3: Playtested and provided design feedback during prototyping and development

        [GAME] Overwatch: Playtested and provided design feedback during prototyping and development

        [GAME] Hearthstone: Playtested and provided design feedback during prototyping and development

        [STUDIO] Riot Games: Systems designer, in-studio game design instructor

        (Former Global Communications Lead for League of Legends)
        (Former Technical Game Designer at Riot Games)

        [GAME] League of Legends: Team-based strategy MOBA with 152 million average active monthly players, won The Game Award for Best Esports Game and BAFTA Best Persistent Game Award.

        • Redesigned Xerath Champion by interfacing with community
        • Reworked the support income system for season 4
        • Redesigned the Ward system
        • Assisted in development of new trinket system
        • Heavily expanded internal tools and features for design team
        • Improved UI indicators to improve clarity of allied behaviour

        [OTHER GAMES] Under NDA: Developed multiple unreleased projects in R&D

        Game Design Instructor: Coached and mentored associate designers on gameplay and mechanics

        [STUDIO] Moon Studios: Senior game designer

        (Former Lead Game Designer at Moon Studios)

        [GAME] Ori & The Will of The Wisps: 2m total players (423k people finished it) with average 92.8/100 ratings by 23 top game rating sites (including Steam and Nintendo Switch).

        • Designed the weapon and Shard systems
        • Worked on combat balance
        • Designed most of the User Interface

        [GAME] Unreleased RPG project

        • Designed core combat
        • High-level design content planning
        • Game systems design
        • Game design documentation
        • Gameplay systems engineering
        • Tools design
        • Photon Quantum implementation of gameplay

        [VC FUNDED STARTUP] SnackPass: Social food ordering platform with 500k active users $400m+ valuation

        [PROJECT] Tochi: Creative director (hybrid of game design, production and leading the product team)

        • Lead artists, engineers, and animators on the release the gamification system to incentivize long-term customers with social bonds and a shared experience through the app

        [CONSULTING] Atomech: Founder / Game Design Consultant

        [STUDIOS] Studio Pixanoh + 13 other indie game studios (under NDA):

        • Helped build, train and establish the design teams
        • Established unique combat niche and overall design philosophy
        • Tracked quality, consistency and feedback methods
        • Established company meeting structure and culture

        Game Design Keynotes:

        (Former Global Head of HR for Wargaming and Riot Games)
        • Tencent Studio
        • Wargaming
        • USC (University of Southern California)
        • RIT (Rochester Institute of Technology)
        • US AFCEA (Armed Forces Communications and Electronics Association)
        • UFIEA (University of Florida Interactive Entertainment Academy)
        • West Gaming Foundation
        • Kyoto Computer Gakuin – Kyoto, Japan