So thinking about this for more than a passing moment. The answer for variant rule is much simpler than one may think. Here's the step by step way one could calculate. Assumption : You're always traveling vertically (whether that's straight up or down or diagonally up or down) until you reach the destination in the z-axis. Suppose the number of cubes in the z-axis to travel is less than or equal to the number of cubes to travel in the x-y plane. Then, the total distance traveled is equal to the distance traveled in the x-y plane since you'll reach the z-axis destination before (or right as you reach) the destination in the x-y plane and thus we can compute the traveled distance by first projecting onto the x-y plane. Suppose the number of cubes in the z-axis to travel is greater than the number of cubes to travel in the x-y plane. Then, the total distance traveled is equal to the distance traveled in the x-y plane plus number of cubes remaining in the z-axis after subtracting the number cubes traveled in the x-y plane times 5'. You can think of this as first project onto the x-y plane then when you reach the destination in the x-y plane, you'll have remainder of straight vertical travel as computed above. In short, the formula can be computed given three parameters (a = # of cubes in x-y plane, b = # of cubes in z-axis, c = x-y distance) dist = c + max{b-a , 0}*5 Or in Roll20 command, [[?{x-y Dist|0} + [[{[[?{No. z cubes|0}-?{No. x-y cubes|0}]],0}kh1]]*5]]