Finding a Mathematical definition of a Discrete Time Game

108 Views Asked by At

Preface:

Suppose we have a game world as depicted in the following figure:

enter image description here

Where each of the white blocks is passable, And each of the black blocks is a wall and so impassable.

Each of the Green and Blue figures is a tank. Its turret determine where it is facing and to which direction it can shoot.

Now imagine that the Green tanks are controlled by some artificial intelligent player, And that the Blue tank is controlled by you.

Each tank can shoot, move and do nothing on the command of its owner (or player).

The mission of each player is to destroy the units of the other player.


Problem:

The problem is to find a mathematically presice definition of the game:

First we'll define the following sets and functions:

$Unit=\{Tank\}$
(The set of possible units, for simplicity we have just $Tank$)

$Player = \{1, 2\}$
(The set of players, for simplicity we have just two)

$Direction=\{Left, Right, Up, Down\}$ (A set of directions that determines which direction a tank faces, And to which direction a shell is going to)

$Shell = \{(BasicShell, -0.1)\}$
(A set of tuples of the form $(shell, damage)$ where $shell$ is the shell name, And $damage$ is the damage to inflict on when hitting a tank. For simplicity we have just one type of shell)

$PlayerShell = Player \times Shell \times Direction$
(A set of triples of the form $(player, shell, direction)$ where $player$ is the player who shot the shell, $shell$ is a tuple that includes the shell name and its damage, And $direction$ is the direction of the shell)

$Health = (0,1]$
($1$ for full health, near $0$ for 'nearly dead', Note: $0$ is not a possible value for health since if a $Unit$ has $0$ health then it is dead and gets immediatly removed from the game world (or $State$))

$PlayerUnit = Player\times Unit\times Health\times Direction$
(A set of quadruples of the form $(player, unit, health, direction)$ where $player$ is the player who owns the unit, $unit$ is the unit type, $health$ is the health of the unit, $direction$ is the direction the unit is facing)

$BlockState = \{Free, Wall\}\cup PlayerUnit \cup PlayerShell $
(The set of possible states that a block on a grid can be, $Free$ means passable block and $Wall$ means impassable block, The other values for a block indicate wether a tank or a shell is on the block)

$State = \mathbb{N}\times\mathbb{M}_{m\times n}^{BlockState}$
(A tuple of the form $(time, grid\_configuration)$ where $time$ is the time passed since the start of the game, And $grid\_configuration$ is the current game world state which is an $m\times n$ matrix over $BlockState$, Assume that $\mathbb{N}$ is the set of natural numbers (includes $0$)).

$Action = \{None, Left, Right, Up, Down, Shoot\}$
(The set of actions that a tank can take)

$Win:State\longrightarrow Player\cup\{Draw, Ongoing\}$
(A function that given a state determines the winner of the game, If the game is still ongoing and if its draw (I.e. no tanks on the grid))

$S_{init}\in State$
(The beginning configuration of the game world)


Now the problem is to mathematically define the function: $Transition:State\times 2^{ApplicableActions}\longrightarrow State $

That will return the next state after applying a subset of the set of applicable actions in the current state.

Where $ApplicableActions = \{\text{The set of applicable actions for each player in the current state}\}$.

(Surely $Transition$ cannot let tanks move through walls and destroy walls by shooting on them)

I think there is some problem in the definition of the $Transition$ function, Since $ApplicableActions$ depends on the current state, And since $Transition$ takes a $State$ and an $ApplicableAction$.

(Note: Since the game is Real-Time each one of the players can move simultanousely, In contast to Turn-Based games)

Clarifications
Assume that the tanks and shots move in discrete steps, And that shots move twice as faster as a tank, (It has some consequence on the $Transition$ function), Also a shot hits the first tank it encounters and then the shot got removed from the world (or state), Also assume that shots harm only tanks of other players.

Thanks.

(Note: You can check the following link for more information: http://arxiv.org/pdf/1208.1940.pdf)

(After that I want to execute on the State-Space of this game a Time-Based Minimax algorithm).