Pathfinding demo
Work in progress
This is a demo of pathfinding on a 2D grid. It consists of 2 main parts:
Python
Standalone script
Run python pathfinding_demo.py
. Requires numpy and matplotlib to be installed.
Jupyter notebook
Contains the same demo as the standalone script and some notes. Since Github supports Jupyter Notebooks now, you can go directly to the file.
Alternatively (or if you want to edit the file), you can use the Jupyeter Lab on the official website:
- click the icon "Upload files" (on the top of left sidebar)
- select pathfinding_demo.ipynb
- file should be now visible in the left sidebar. Double-click it and confirm default kernel selection
- run all the cells one by one (play button on the top) or run all of at once using menu "Run -> Run All Cells"
C++
Work in progress. At the moment Linux build only.
Build
Install prerequisities
- SDL3
- SDL3-image
- GLEW
e.g. on Archlinux:
pacman -S glew sdl3 sdl3_image
Compile
cd cpp/
make -j $(nproc)
Run
Run the "pathfinding" in the cpp folder.
TODO
- python
- get jupyter lab running
- drawing utility
- interface for pathfinding
- research methods
- implement methods
- DFS
- BFS
- Dijsktra
- GBFS
- A*
- performance measurement: time/visited nodes
- finalize the script and copy back to the jupyter notebook
- finish text on the page
- create a dedicated python script
- C++
- re-use 2D game engine
- add tiles (with cost) to map
- conversion functions from tile coords to world coords
- drawing tiles
- add "terrain tiles" with different costs
- add mouse-click action
- add direct movement (through mouse click action, no pathfinding)
- implement pathfinding
- BFS
- GBFS
- Dijkstra
- A*
- windows build?
- VS solution
- merge to master
- cmake?
- zoom + pan of the map
- maze generator?
- collisions
- multiple units
- change from single unit (player) to RTS-style multiple units
- unit selection
- selection rectangle?
- pathfinding for multiple units
- pathfinding for multiple units
- group formation, local cohesion, etc
- cpython interface
- control the game through the interpreter
- clang-format config
- git hooks?
- gcovr
- clang-tidy
Description
Languages
C++
48.3%
Jupyter Notebook
42.4%
Python
8.7%
Makefile
0.6%