I am developing a simple resource trading game set in space for fun. The board is a two dimensional representation of a solar system (roughly similar to this image).
The game mechanics are as follows:
- Planets orbit a sun at different speeds (meaning the distance between them changes with time).
- There is a limited number of resources being traded in the universe.
- Planets either offer a resource for sale or have a demand for it.
- You can travel between planets.
- The price for travelling is linearly related to the euclidian distance between the planets the player is travelling between.
- Not travelling incurs a fee per time unit.
- Resources can be bought from planets if there is an offering or sold is there is demand.
- Resources sold are not fed back (i.e. resources are consumed over time).
- The player can choose to end the game at any time. The amount of currency held when ending the game constitutes the final score.
I am now searching for an approach to identify a program that maximises the final score. I have a vague idea of how to solve a relaxed problem, where there is no movement of planets, but I am stuck figuring out how to go about programatically determining the optimum score.
Maybe someone can point me in the direction of an algorithm or research in the area?
Based on comments above, I'm going to assume a turn-based game with every planet reachable from every other planet in a single turn. I'm also going to assume a fixed game length (number of turns), at the end of which you're looking to maximize the wealth/capital of the ship owner. The fixed game length can be finessed a bit by setting an upper limit on the number of turns and then, if the game ends before then (for instance, because the ship owner runs out of money), you basically just park the ship and wait for the remaining turns to expire. I'm also going to assume that you can only change planets once per turn.
Cargo purchases and sales may be divisible quantities (any value in some interval), but the decision in each turn where to go next is inherently discrete. There are several ways the game could be modeled.
Personally, I would go with IP if everything is linear and CP if there are any serious nonlinearities but all quantities are discrete.