Differentiable Game Mechanics