We present an extension of our earlier work on adaptive quantum wavepacket dynamics [B. Hartke, Phys. Chem. Chem. Phys., 2006, 8, 3627]. In this dynamically pruned basis representation the wavepacket is only stored at places where it has non-negligible contributions. Here we enhance the former 1D proof-of-principle implementation to higher dimensions and optimize it by a new basis set, interpolating Gaussians with collocation. As a further improvement the TNUM approach from Lauvergnat and Nauts [J. Chem. Phys., 2002, 116, 8560] was implemented, which in combination with our adaptive representation offers the possibility of calculating the whole Hamiltonian on-the-fly. For a two-dimensional artificial benchmark and a three-dimensional real-life test case, we show that a sparse matrix implementation of this approach saves memory compared to traditional basis representations and comes even close to the efficiency of the fast Fourier transform method. Thus we arrive at a quantum wavepacket dynamics implementation featuring several important black-box characteristics: it can treat arbitrary systems without code changes, it calculates the kinetic and potential part of the Hamiltonian on-the-fly, and it employs a basis that is automatically optimized for the ongoing wavepacket dynamics.