Skip to content

A custom pathfinding algorithm that BHOPs from one point to another

Notifications You must be signed in to change notification settings

Gumbo64/godot-bhop-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it

This is a path-finding AI that takes advantage of bunnyhopping, a movement technique in Counter Strike and other such games. To move optimally, a bot also has to factor in acceleration, variable turning radius and speed gains/losses from slopes and walls. This unique scenario means that conventional path-finding approaches can only be used as a general guide but won't help it with fine control.

How it works

  • Normal path-finding algorithm provides a path to follow (think google maps)
  • Monte Carlo Tree Search algorithm is used for planning out how to follow this path considering the physics and using the available controls

Other notable parts

This is stuff you'd probably want to know if you started looking into the code

  • "multistep" is an easy way for the MCTS algorithm to look further into the future by repeating the chosen action n amount of times. Since trees increase exponentially, it is important to have each node to be different to the last but holding down for too long will make it less agile.
  • "splitcounter": when multistep is used, each action will be held for n times longer than normal and those steps still need to be shown onscreen anyway, so instead of allowing all the MCTS iterations to be done on a single laggy frame they can be split across each of those n frames for a better framerate

edit: I also used a bad version of "Search Tree Reuse" in https://ieeexplore.ieee.org/document/6731713 (my approach would be with no decay ie γ=1 ) so definitely read that explanation

Credits

The most notable/helpful sources I used. Basis meaning I still had to port it over to GDScript and make some changes.