Gave up on trying to get the GOAP algorithm to correctly apply the cost structure to competing choices, and instead I take the resulting action list and simply find the next best one based on cost.
This commit is contained in:
parent
52f45e1d45
commit
c014e65c13
11 changed files with 43 additions and 30 deletions
|
@ -205,6 +205,7 @@ TEST_CASE("Confirm EntityAI behaves as expected", "[ai]") {
|
|||
enemy.set_state("in_combat", true);
|
||||
enemy.set_state("health_good", false);
|
||||
enemy.update();
|
||||
enemy.dump();
|
||||
auto& best = enemy.best_fit();
|
||||
REQUIRE(best.name == "run_away");
|
||||
REQUIRE(enemy.wants_to("run_away"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue