Only a severely restricted class of tensor fields can provide classical spacetime geometries, namely those that can carry matter field equations that are predictive, interpretable and quantizable. These three conditions on matter translate into three corresponding algebraic conditions on the underlying tensorial geometry, namely to be hyperbolic, time-orientable and energy-distinguishing. Lorentzian metrics, on which general relativity and the standard model of particle physics are built, present just the simplest tensorial spacetime geometry satisfying these conditions. The problem of finding gravitational dynamics-for the general tensorial spacetime geometries satisfying the above minimum requirements-is reformulated in this paper as a system of linear partial differential equations, in the sense that their solutions yield the actions governing the corresponding spacetime geometry. Thus the search for modified gravitational dynamics is reduced to a clear mathematical task.