Skip to content

Commit

Permalink
Fixed some errors in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tikitikitikidesuka committed Nov 13, 2021
1 parent b3f3701 commit 109c26f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SSSV makes understanding state space search algorithms intuitive. It represents

![edit](docs/images/edit.gif)

- **Precise controls** let the user step through each step of the algorithm.
- **Precise controls** let the user step incrementally through the search algorithm.

![controls](docs/images/control_menu.gif)

Expand All @@ -30,7 +30,7 @@ Adding custom algorithms is simple. The algorithm's `gd` file just needs to be p
For a more detailed explanation on developing and adding custom algorithms, refer to the [custom algorithms documentation](docs/custom_algorithms.md).

## Dependencies
This project was made using the [Godot Game Engine](https://godotengine.org/). A free and open source game engine which I would very much recomend anyone to checkout. It's github page can be found [here](https://github.com/godotengine/godot).
This project was made using the [Godot Game Engine](https://godotengine.org/). A free and open source game engine, I would very much recommend checking out. Its github page can be found [here](https://github.com/godotengine/godot).
<p align="center">
<a href="https://godotengine.org">
<img src="https://github.com/godotengine/godot/raw/master/logo_outlined.svg" width="400" alt="Godot Engine logo">
Expand Down
2 changes: 1 addition & 1 deletion docs/base_algorithm_methods.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BaseSearchAlgorithm Class

The `BaseSearchAlgorithm` class is extended by all search algorithms. It includes usefull methods common to most search algorithms.
The `BaseSearchAlgorithm` class is extended by all search algorithms. It includes useful methods common to most search algorithms.

## Methods

Expand Down
6 changes: 3 additions & 3 deletions docs/custom_algorithms.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Developing Custom Algorithms

A [custom algorithm `gdscript` file containing the basic search algorithm structure](search_algorithm.gd) can be found among the documentation. It's code is as follows:
A [search algorithm template](search_algorithm.gd) containing the basic structure is provided within the documentation. Its code is as follows:
```gdscript
# Extend BaseSearchAlgorithm to have useful methods
extends "res://Code/BaseSearchAlgorithm.gd"
Expand All @@ -19,14 +19,14 @@ func expand(CP, path):
pass
```

The algorithm extends the [`BaseSearchAlgorithm.gd`](base_algorithm_methods.md), which contains some [very useful methods](base_algorithm_methods.md) such as ordering the path list, `CP`, by cost or heuristic.
The algorithm extends [`BaseSearchAlgorithm.gd`](base_algorithm_methods.md), which contains some [very useful methods](base_algorithm_methods.md) such as ordering the path list, `CP`, by cost or heuristic.

The `expand` method is the most important. It must modify CP so that it contains the paths that should be considered in next steps.
- `CP` contains all the paths to consider in future steps.
- `path` contains the path being checked in the current expand method call.

The `Graph2D` methods `getUnvisitedNeighbours(pos:Vector2)` and `getAllNeighbours(pos:Vector2)` are crucial to expand the path buffer. These methods return a list of the unvisited or all neighbours, respectively, of the tiles located at `pos` on the `Graph2D`.
> NOTE: Since paths are objects, they are passed by reference. To add a new path to `CP` without editing the existing ones, neighbours shoud be added to a clone of the checked path. A path can be cloned with it's `duplicate()` method.
> NOTE: Since paths are objects, they are passed by reference. To add a new path to `CP` without editing the existing ones, neighbours shoud be added to a clone of the checked path. A path can be cloned with its `duplicate()` method.
## Algorithm Usage
The `Graph2DSearch` class will use the algorithm defined:
Expand Down

0 comments on commit 109c26f

Please sign in to comment.