Sunday, 20 September 2020

Sphere Of Influence

 I created a small game, that can be played here:

https://sphere-of-influence-service-bajtxwzftq-ew.a.run.app/

Players place tokens on the map in succession. Token can be placed on any pixel that is a land tile, (so on plains, mountains and rivers), not in oceans. The first token of each player is placed randomly. From the second turn onwards, players can only place their token in their "sphere of influence". 

Each pixel is in a player's sphere of influence if the player can travel from there to one of its tokens the quickest. It does not matter how fast you travel, or how many tokens are close, it only matters that your token is closer (in travel time) than any of your enemies' tokens. 

Travel time is calculated as follows

  1. Travelling over flat land takes 1 unit of time.
  2. Travelling over mountains takes 1 to 10 units of time, depending on how mountainous it is. 
  3. Travelling over rivers or ocean takes 10 units of time
If all players have placed 10 tokens, the player who has the larger sphere of influence, land or water, wins. 

The code for this game is open source and can be found here: