The ultraviolet (UV) bright accretion disc in active galactic nuclei (AGNs) should give rise to line driving, producing a powerful wind that may play an important role in AGN feedback as well as in producing structures like the broad-line region. However, coupled radiation-hydrodynamic codes are complex and expensive, so we calculate the winds instead using a non-hydrodynamical approach (the QWIND framework). The original QWIND model assumed the initial conditions in the wind, and had only simple radiation transport. Here, we present an improved version that derives the wind initial conditions and has significantly improved ray tracing to calculate the wind absorption self- consistently, given the extended nature of the UV emission. We also correct the radiation flux for relativistic effects and assess the impact of this on the wind velocity. These changes mean the model is more physical, so its predictions are more robust. We find that, even when accounting for relativistic effects, winds can regularly achieve velocities ≈(0.1-0.5)c, and carry mass-loss rates that can be up to 80 per cent of the accreted mass for black hole masses of 107-9 M⊙, and mass accretion rates of 50 per cent of the Eddington rate. Overall, the ratio of kinetic power carried by the wind to bolometric luminosity increases with mass accretion rate at a given black hole mass, unlike the constant fraction generally assumed in current cosmological simulations that include AGN feedback. The updated code, QWIND3, is publicly available in GitHub.1