hestia-rsps / hestia

An open-source Kotlin game server.
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

AI Traversal #57

Open GregHib opened 4 years ago

GregHib commented 4 years ago

Scenario: Bot in lumbridge has task to mine iron. How does it find a path to the nearest suitable mine?

The entire collision map and target locations are for the most part static so once calculated can be reused.

Tagging

First "the bot" must identify what is a mine. Locate every single rock and weight by proximity to each other. This will mean bots will choose a cluster of rocks over a single rock of they are the same distance.

Filter

Now take the tagged areas and filter out wrong types. This will give a list of only iron ore mines.

Path

Collision map with weights based on several factors:

Decide

Combine path costs with proximity costs to get a final best decision which you already have the exact path for. Can potentially be randomised by bot type.

Traverse

Optionally splitting the path into points separated by view distance/max walk distance for realism and checking to use the shortcuts when within radius.