Skip to content
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 #5015

Open
doomsdayreturns opened this issue Jun 28, 2022 · 2 comments
Open

AI #5015

doomsdayreturns opened this issue Jun 28, 2022 · 2 comments

Comments

@doomsdayreturns
Copy link

doomsdayreturns commented Jun 28, 2022

issues with ai acquiring players if another mobile is in the path and they move through them they cannot step on that tile so they move in a circle until able to step on that tile.

AI

@whoblitzell
Copy link

I run a small online game based on this code repository, a shard of a game from the UO era that was VERY similar to UO in almost all respects. Anyways, the way I addressed this problem was to use the "Diagonal" method described below:

https://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html

This can be easily integrated by making methods such as CanFit() and CanPlayerFit() on Map.cs and then having a MapPath.cs that can help a Pathfinding module use A-star algorithm or others to compute legal paths to player. Rather than moving in a circle, the algorithm will regard the non-goal player as an obstacle and simply move around them as they would anything else. An alternative method and an easier, cheaper one is to allow the mobile doll to occupy the same space as the opposing mobile temporarily on the server, although that can create client side issues for many games!

I would advise anyone doing this to simply extend the code as described above.

@kamronbatman
Copy link
Collaborator

It should already do what you describe. I wonder if this happens with the fixed A* changes on ModernUO. Should test it and see.
The bug we encountered from RunUO (and presumably ServUO has it too), is that in some scenarios, the mob will try to go around in one way, and then try another way, with no "give up" scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants