We first derive the Hamiltonian for Lovelock gravity and find that it takes the same form as in general relativity when written in terms of the Misner-Sharp mass function. We then minimally couple the action to matter fields to find Hamilton's equations of motion. These are gauge fixed to be in the Painlev\'e-Gullstrand co-ordinates and are well suited to numerical studies of black hole formation. We then use these equations of motion for the massless scalar field to study the formation of general relativistic black holes in four to eight dimensions and Einstein-Gauss-Bonnet black holes in five and six dimensions. We study Choptuik scaling, a phenomenon which relates the initial conditions of a matter distribution to the final observables of small black holes. In both higher dimensional general relativity and Einstein-Gauss-Bonnet gravity we confirm the existence of cusps in the mass scaling relation which had previously only been observed in four dimensional general relativity. In the general relativistic case we then calculate the critical exponents for four to eight dimensions and find agreement with previous calculations by Bland et. al. but not Sorkin et. al. who both worked in null co-ordinates. For the Einstein-Gauss-Bonnet case we find that the self-similar behaviour seen in the general relativistic case is destroyed. We find that it is replaced by some other form of scaling structure. In five dimensions we find that the period of the critical solution at the origin is proportional to roughly the cube root of the Gauss-Bonnet parameter and that there is evidence for a minimum black hole radius. In six dimensions we see evidence for a new type of scaling. We also show, from the equations of motion, that there is reason to expect qualitative differences between five and higher dimensions.