New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI: tweak explore to work with new pathfinding. #528

Closed
wants to merge 3 commits into
base: develop
from

Conversation

Projects
None yet
2 participants
@nullkiller
Copy link
Contributor

nullkiller commented Dec 25, 2018

Since the new pathfinding was implemented explorationDesperate function has been broken. I removed it because it duplicates logic of explorationNewPoint except of using sector map. Now the new pathfinding already contains all required info and I do not see any point of having two separate functions.

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch from 3a8f01b to 2ccdeeb Dec 25, 2018

@@ -179,3 +167,220 @@ bool Explore::fulfillsMe(TSubgoal goal)
}
return false;
}

bool Explore::hasReachableNeighbor(const int3 &pos, HeroPtr hero, CCallback * cbp, VCAI * vcai) const

This comment has been minimized.

@nullkiller

nullkiller Dec 25, 2018

Contributor

Moved and logic changed a bit. Now it depends on new pathfinding

int radious,
CCallback * cbp,
HeroPtr hero,
std::function<bool (const int3 &)> filter) const

This comment has been minimized.

@nullkiller

nullkiller Dec 25, 2018

Contributor

Moved and added a filter. explorationNewPoint does not use the filter anymore. explorationBestNeighbor uses hasVisibleNeighbors as the filter as it was before

return ret;
}

TSubgoal Explore::explorationBestNeighbour(int3 hpos, int radius, HeroPtr h) const

This comment has been minimized.

@nullkiller

nullkiller Dec 25, 2018

Contributor

Just moved and a bit changed the signature. Now it returns TSubgoal to visit a tile instead of the tile itself.

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch from 2ccdeeb to a672527 Dec 25, 2018

Show resolved Hide resolved AI/VCAI/Goals/Explore.cpp Outdated
Show resolved Hide resolved AI/VCAI/Goals/Explore.cpp
Show resolved Hide resolved AI/VCAI/Goals/Explore.cpp Outdated

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch from a672527 to b22b7cc Dec 29, 2018

Show resolved Hide resolved AI/VCAI/Goals/Explore.cpp Outdated
Show resolved Hide resolved AI/VCAI/Goals/Explore.cpp Outdated

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch 2 times, most recently from 5a9e182 to 4eb9ecb Jan 5, 2019

@nullkiller nullkiller changed the title AI: tweak explore to work with new pathfinding. [WIP] AI: tweak explore to work with new pathfinding. Jan 5, 2019

VCAI *aip = ai.get();
const TeamState * ts = cbp->getPlayerTeam(aip->playerID);

std::vector<int3> tiles; //tiles[distance_to_fow]

This comment has been minimized.

@alexvins

alexvins Jan 5, 2019

Member

The comment is not relevant any more.


if(nearbyVisitableObjs.size())
{
vstd::removeDuplicates(nearbyVisitableObjs); //one object may occupy multiple tiles

This comment has been minimized.

@alexvins

alexvins Jan 5, 2019

Member

Not needed, we pick only one closest object.

PR is in progress again, to be reviewed later.

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch 2 times, most recently from 599a822 to b9a1d95 Jan 6, 2019

@nullkiller nullkiller changed the title [WIP] AI: tweak explore to work with new pathfinding. AI: tweak explore to work with new pathfinding. Jan 7, 2019

@nullkiller

This comment has been minimized.

Copy link
Contributor

nullkiller commented Jan 7, 2019

Logger experiments were removed from this PR.

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch from b9a1d95 to bdaf127 Jan 7, 2019

@alexvins alexvins self-assigned this Jan 7, 2019

@nullkiller nullkiller force-pushed the nullkiller:ai-refactor-exploration-according-to-new-pathfinder branch from bdaf127 to 39acfe5 Jan 7, 2019

@alexvins

This comment has been minimized.

Copy link
Member

alexvins commented Jan 7, 2019

Merged already right before force push. Please start new PR if there is more to do.

@alexvins alexvins closed this Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment