A-star pathfinding for Vector Racer

English article

Getting started with pathfinding

Tags: Pathfinding Heuristics BFS  A* 2014-2015 

Table of Contents

  1. Introduction
  2. Resources: getting started with pathfinding
  3. VectorRacer physics
  4. Applying pathfinding to VectorRacer


Programming computer algorithms is great fun. It requires cunning, dedication and insight. There are always new challenges and optimisations to be found depending on the goals you set yourself.

Vector Racer is a turn-based racing game, which simulates a car race on a squared sheet of paper. You move from one grid point to another and have to try to get to the finish in the least amount of turns. The player is allowed to accelerate/decelerate the car along 2 axis' each turn, lending the driving a 'realistic' touch.


   This page is focused on getting you started with an A* pathfinder and basic heuristics for Vector Racing.

Writing a fitting algorithm to challenge and entertain a human player is great fun, but not trivial. What is the best algorithm? How do you write it? I'd like to explore this with you and share my thoughts along the way.

2Resources: pathfinding basics

The best place to start learning is through the (interactive) pages at Stanford Universaty by Amit Patel
It covers everything you need to be aware of and more, with a lot of links to interesting examples:

Fortify your understanding by fiddeling with this app at qiao.github.io

3VectorRacer physics

Vector Racing (VR), as a game, is thorougly explained at Wikipedia

VR complicates the basic grid search by introducing momentum. This requires us to account both position and speed.
This also

4Applying pathfinding to VectorRacer

More to come soon...

Kind regards,
Bob Reijnders