The AKSZ construction was developed as a geometrical formalism to find the solution to the classical master equation in the BV quantization of topological strings and branes based on the concept of QP manifolds. However, the formalism does not apply in presence of Wess-Zumino terms, as demonstrated in the example of WZW-Poisson sigma models. In this talk, I will discuss a class of topological field theories in arbitrary dimensions, the twisted R-Poisson sigma models, which suitably generalize Poisson or twisted Poisson sigma models beyond 2D. Their general relation to differential graded manifolds and higher geometry is discussed and the solution to the classical master equation in 3D is given, even though the target space does not have a QP structure.