Predicting effects of ecosystem engineering on species richness along primary productivity gradients