Optimizer

From Minecraft Parkour Wiki
Revision as of 23:14, 1 March 2021 by MCPK (talk | contribs) (created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The goal of this page is to document ideas and progress on designing an algorithm for optimizing jump strats, with the ultimate goal of creating a mathematically optimal parkour bot, unlike other projects such as BaritoneParkour which use a coarser pathfinding for more general purposes.

Presentation and Motivations

A couple notes:

  • Minecraft only has 65536 angles, so there is such a thing as an optimal solution.
  • For sanity's sake, we'll ignore Half angles, and glitches in general.


Initially, we restrict the problem to ground movement, with zero initial speed.

The goal is to optimize a recursive function with threshold.

  • The recursive function is the player's speed, which takes an angle as input
  • The threshold represents a built-in mechanic-in that limits how little momentum can be conserved over ticks.


Formally, we have:

  • Analogous definition for


The function we want to optimize is the player's X position after N ticks (alternatively Z, with Vz instead):


In Minecraft, the threshold constant is 0.005 (changed to 0.003 in 1.9)

Two observations about the threshold function in general:

  • If , the function can be made nonrecursive. In that case, the function is differentiable, so finding a maximum isn't too complicated.
  • If , the velocity is constant, and the problem can be reduced to a simpler pathfinding problem. (with these constants, suffices)

For any value in between, the problem becomes quite a bit harder. In our case, because the threshold constant is low (0.005), the approximation with is quite good (and even perfect in the case the threshold isn't activated to begin with), so it can be used as a base for the true solution.


Initial approach:

  • A* algorithm, with implicit states (x,z,Vx,Vz)
  • Branch & Bound

In either case, a good heuristic we can use is one that ignores walls and angles, and goes straight towards the goal (constant angle)