Generic game-related math and data structures