Archipelago - Time and Tide

in utopian-io •  6 months ago


Time and tide wait for no man.

The last two items on the implementation roadmap for trade contracts both required a measure of time to be added to the game. Trade contracts are activated by an initial delivery of goods but the resulting trade routes need to held open for a period of time in order for the contract to be completed. For the duration of the open period trade routes can be interrupted and cancelled by obstacles, for example pirate ships moving onto their line.

With most of the game operating around the figure eight and octagons, the eight phases of the moon seemed like a fitting measure for time. Each series of player turns represents one phase of the moon with each moon month lasting 8 full turns.

The new features in this contribution are thus:

  • Addition of moon and time measure
  • Adding time to trade contracts
  • Obstacles cancelling trade routes (first obstacle is pirate ships)
  • Assigning quadrants to pirate ships (game play improvement)

Screen Shot 2018-05-30 at 21.42.20.png

Phases 2 (Resources, Goods, Building, and Trade Contracts) and 3 (Conflicts) of Archipelago development are now well underway.

For a full view of the current state of the game development see my github-hosted page.

Please note that the game is not yet complete - you can see current progress and test functionality but you will have to wait a little longer to play!

Background details of the project can be found at the end of this contribution post.


The repository for Archipelago can be found here:

New Features covered by this Contribution

Addition of moon and time measure

The graphic for the current moon phase was added to the top right of the board, together with a written date. The moon graphic uses two arcs, one for each side of the moon, superimposed upon a background circle. At some point in the future I may animate the transition from one phase to the next but it looks good for now.

A new SVG layer was added to the game board for the moon graphic. The approaches to adding canvas and SVG layers to the board were simplified and added to methods to avoid repeated code.

The moon phase and moon month are updated after each player has moved, i.e. after the pirate moves.

Screen Shot 2018-05-30 at 21.47.00.pngScreen Shot 2018-05-30 at 21.47.26.png
Screen Shot 2018-05-30 at 21.47.41.pngScreen Shot 2018-05-30 at 21.48.01.png
Screen Shot 2018-05-30 at 21.48.20.pngScreen Shot 2018-05-30 at 21.48.42.png
Screen Shot 2018-05-30 at 21.49.03.pngScreen Shot 2018-05-30 at 21.51.41.png

Moon phases

The code changes for the above new feature can be found here:

Adding time to trade contracts

Once a contract is established between a player and a Kingdom island it must be maintained for a period of time. The time period I have initially chosen is a full turn of the moon, i.e. eight phases, although this may be adapted during gameplay testing. The contract requires delivery of one good per turn which is assumed taken by Kingdom ships along the mapped trade route.

This new feature:

  • Adds a countdown of the remaining time required for an active contract to be completed.
  • Updates the contract dashboard (on the right sidebar) to show the remaining time for each contract.
  • Reduces a resource tile's goods each turn based on the contracts that are active (typically a resource tile will produce 1 good each turn which is immediately delivered if a contract is active).
  • Adds the resource tile coordinates and the contract trade route to the contract array for later use.

Screen Shot 2018-05-30 at 22.55.13.png

Contracts dashboard showing an "active" contract with 2 phases on the moon remaining until completion, together with some open contracts with their initial delivery requirements and some closed (or completed) contracts.

In addition some simplifications and additions were made to goods production and new contracts:

  • Simplification of the initial and renewal amounts for each contract generated.
  • Simplification of the resource tiles to all produce 1 good per turn except for one of each resource type which produces double.
  • Update of the left sidebar to show this double resource with "2x".

The code changes for the above new feature can be found here:

Obstacles cancelling trade routes (first obstacle is pirate ships)

For the duration of the open (or active) period of eight moon phases a trade route can be interrupted and cancelled by obstacles, for example a pirate ship moving onto the route.

Screen Shot 2018-05-30 at 23.52.14.png

A pirate ship has ended its move on a trade route which will be cancelled at the start of the next Red Team turn

The implementation of this feature required:

  • A method to check whether a pirate ship sits on their trade routes at the start of each player's turn.
  • An update to the contracts game logic for the removal of an existing trade route and resetting of that trade contract.
  • The elements of trade route SVGs to be combined into a single group for ease of removal of the SVG.

The code changes for the above feature can be found here:

Assigning quadrants to pirate ships (game play improvement)

The wind direction and game board edges were resulting in pirate ships clustering together, often at the edges of the board. An improvement was made to assign a quadrant of the board to each of the four pirate ships, and a tile towards which they return if they stray outside that quadrant (once they have finished chasing any cargo ships).

I also took the opportunity of this change to rework the pirateShips array to contain permanent information on each pirate ship (home tile and return tile). This is likely to be the underlying approach followed when automating the computer opponents.

The code changes for the above feature can also be found here:

Proof of Work Carried Out

This is the full url to my github account:

That is all for this update. If you have any queries please drop them in the comments or contact me on discord.

Details of the Archipelago Project

What is the Project About?

Archipelago is a new project that I have been working on. The aim is to develop a seafaring and trading turn-based strategy game. Players will guide their ships around the islands, searching for goods to aid construction of ships and their bases, trading with the Kingdom settlements and avoiding hazards like pirates and whirlpools.

Technology Stack

The project is a browser based game:

  • Mechanics: Javascript
  • Visuals: HTML and CSS initially but now moved across to Canvas and SVG.


Phase 1 - the first main goal of getting ships on the board and moving at different speeds under the influence of the compass is complete.

The graphics overhaul is also now complete.

Work is now ongoing on Phase 2 which is resource discovery, goods production, building and the trade contracts that underlie the game.

Work has also begun on adding pirates and conflicts.

Phase 1 - Board and ship movement: COMPLETE
  • Board set up - COMPLETE
  • Basic ship creation: functionality and graphics - COMPLETE
  • Manual ship movement and board updating - COMPLETE
  • Basic compass creation: functionality and graphics - COMPLETE
  • Turn based activity of ship movement - COMPLETE
  • Logic of length of longer moves around obstacles - COMPLETE
  • Chaining together transitions to allow graphics of longer moves - COMPLETE
  • Separation of board layers (Canvas base layer, Canvas activation layer overlay, SVG piece overlays) - COMPLETE
Phase 2 - Resources, Goods, Building and Trade Contracts


  • Add Resource tiles (forest, ironworks, flax, gold etc) - in progress: forest, ironworks, quarry, plantation added
  • Discovery of resource tiles - COMPLETE
  • Claiming of resource tiles - COMPLETE
  • Dashboard of player pieces - COMPLETE


  • Creation of new goods each turn - COMPLETE
  • Loading, unloading and transportation of goods - COMPLETE
  • Dashboard of goods pieces - COMPLETE
  • Goods icons - COMPLETE
  • Variable quantity of goods to be loaded / unloaded - COMPLETE

Contracts for delivery:

  • Semi-random (equitable) generation of trade delivery contracts - COMPLETE
  • Creation of trade settlements - COMPLETE
  • Dashboard for contracts - COMPLETE
  • Mechanics for contract sign-up - COMPLETE
  • Mechanics for contract delivery - COMPLETE
  • Island naming: for describing location of trading settlements - COMPLETE
  • Graphics of trade routes - COMPLETE
  • Continuance of contracts over time - COMPLETE
  • Breaking of contracts due to interference - COMPLETE

Building (On hold - decide if necessary once contracts implemented)

  • Recipes, time to implement, graphics etc


  • Work out scoring mechanism (linked to contracts)
  • Add score dashboard
Phase 3 - Conflicts


  • Add pirate ships - COMPLETE
  • Automate pirate ship movements (basic movement with wind and search for cargo ships) - COMPLETE
  • Search - telescope range of 5 tiles for stronger search for ships - COMPLETE
  • Consider separate cargo and war ships for teams


  • Add fort icons - COMPLETE
  • Create safe harbour from pirate ships - COMPLETE


  • Attack - Develop conflict method between ships - COMPLETE
  • Stealing of cargo - COMPLETE
  • Limping back to harbour - COMPLETE
  • Ship repair - COMPLETE
Phase 4 - Game Management and Settings


  • Settings pop up box created - COMPLETE
  • Options added - In progress - game speed added, developer tools added
  • Local options (player name etc)
  • Game saving and replay
Phase 5 - Central trading centre
  • Develop central market allowing players without resources to trade and fulfill contracts
Phase 6 - One player version development

Artificial Intelligence levels for computer players

Phase 7 - Rules, roll-out, documentation, testing etc

Contact / Contribute

You can get in touch with me on discord if you would like to contribute.

You can find the current state of the game here:

The repository for the project is here:

Have fun!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thanks for the contribution!

The moon looks great and fits the theme well!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

Need help? Write a ticket on
Chat with us on Discord.


Thanks Amos!

Nearly there. Working on building the next few days. The just scoring and a few more bits and pieces to tidy up for phases 2 and 3 to be complete!

I'm so excited for you, @miniature-tiger! This is a major achievement. It looks like you are in the home stretch.


Thanks @jayna!

Yes, it's nearly there. Just a few more steps to a first working version. I'll probably take a pause at that point before launching into developing the computer opponents. But I'm pleased with how it's turning out!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 5 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 48 SBD worth and should receive 62 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,

Hey @miniature-tiger
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord

Vote for Utopian Witness!