Autowalker is now using the GOAP AI system and works way better. Still quite a lot of jank in the code but that'll get removed over time. Next thing is being able to detect when its near an item/enemy and properly react.
This commit is contained in:
parent
ff81c78d13
commit
d15c9b12fd
9 changed files with 84 additions and 47 deletions
|
@ -7,6 +7,7 @@ using matrix::Matrix;
|
|||
|
||||
constexpr const int PATHING_TOWARD=1;
|
||||
constexpr const int PATHING_AWAY=-1;
|
||||
constexpr const int MOVE_DIAGONAL=8;
|
||||
|
||||
class Pathing {
|
||||
public:
|
||||
|
@ -28,7 +29,7 @@ public:
|
|||
Matrix &paths() { return $paths; }
|
||||
Matrix &input() { return $input; }
|
||||
int distance(Point to) { return $paths[to.y][to.x];}
|
||||
bool random_walk(Point &out, bool random, int direction);
|
||||
bool random_walk(Point &out, bool random, int direction, size_t dir_count = 4);
|
||||
|
||||
bool INVARIANT();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue