Ship repair and safe harbours - Archipelago


Introduction

In the last update pirate ships were given a new lease of life. Telescopes were added so that pirates could chase down cargo ships at greater range. Sea battle functionality was developed to allow pirate ships to attack other ships and steal their cargo. This resulted in lots of damaged ships littering the map!

This contribution redresses the balance a little:

  • Safe harbours have been added around forts. The fort cannons prevent pirate ships from approaching the fort too closely and give cargo ships some map tiles onto which to escape.
  • Damaged ships can limp back to these safe harbours (using oar power) and undergo repairs, becoming good as new!
  • Pirate ships also receive a home harbour and will return there if they become damaged.

In addition, the board arrangement has also been changed a little in an attempt to improve gameplay.



Screen Shot 2018-05-19 at 22.47.39.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.
https://miniature-tiger.github.io/archipelago/

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.


Repository

The repository for Archipelago can be found here:
https://github.com/miniature-tiger/archipelago


New Features covered by this Contribution

Addition of safe harbour functionality

Harbours have been added around forts. These harbours cannot be entered by pirate ships due to the fort cannons, allowing cargo ships to dock, deliver goods, hide, or be repaired in safety. Pirate ships now have to box around Kingdom fort areas and will ignore any docked ships rather than waiting for them to exit.

The harbours are shown on the map as filled tiles in a slightly darker sepia shade. Some examples are below:


Screen Shot 2018-05-19 at 22.55.53.png

Harbours around forts

The code changes for the above new feature can be found here:
https://github.com/miniature-tiger/archipelago/pull/56/files

The change required:

  • A new method to find safe harbour spaces around forts and then to add them to the boardArray.
  • A new method to draw safe harbours on the map.
  • Updates to movement.js so that pirate ships can no longer enter safe harbours (which also means they do not target cargo ships in harbours for attack).
  • Updates to the logic in pirate.js so that pirate ships no longer use their telescopes to find ships in harbours - docked cargo ships are thus ignored.

Repair of team cargo ships in harbours

If a cargo ship loses a sea battle its mast and sails are damaged and it must be rowed back to a harbour for repairs. This change added the harbour arrival and repair functionality.

The repair takes place in stages with each stage lasting a full turn:

  • Damaged cargo ship approaching harbour:
    Screen Shot 2018-05-19 at 23.17.48.png

  • Addition of scaffold
    Screen Shot 2018-05-19 at 23.19.07.png

  • Repair of mast
    Screen Shot 2018-05-19 at 23.19.47.png

  • Repair of sails
    Screen Shot 2018-05-19 at 23.20.31.png

  • And away!
    Screen Shot 2018-05-19 at 23.21.22.png

This change also reduced the mobility of damaged ships to two tiles in all directions - given the loss of the mast and sails, wind power is no longer an option.

The code changes for the above features can be found here:
https://github.com/miniature-tiger/archipelago/pull/57

The main change required were:

  • The addition of a graphics method for step-wise repair of cargo ships in harbours (removal of oars, add scaffolding, add back mast and sail).
  • A new method to handle the damaged ship arrival in the harbour including turning the ship to face the fort
  • A method to check for cargo ships to repair at start of each turn and to upgrade their repair stage
  • Integration of the harbour arrival into the game logic
  • Change to movement.js to reduce cargo ship movements to 2 tiles in all directions for damaged ships

Pirate harbours and repair

That just leaves the repair of pirate ships. Pirate ships can also be damaged in sea battles. If this happens they row their way back to their home harbour and undergo repair.

The pirate home harbours were added on the space where they commence the game. The coordinates of this tile were added to the relevant pirate ship piece in boardArray so that the piece knows where to return to once damaged. The repair progress is the same as for cargo ships.


Screen Shot 2018-05-19 at 23.47.09.png

Pirate ship undergoing repair on its home patch

The code changes for the above features can be found here:
https://github.com/miniature-tiger/archipelago/pull/58

The main changes were:

  • Addition of homeRow and homeCol to all Transport pieces so pirate ships know where to get repaired.
  • Update of activateTiles in movement.js so that separate search range and maximum look range can be passed. This allows pirate ships to find a route to their home tile which may be a long way away.
  • Addition of pirate logic to harbourRepairArrival, harbourRepair, and drawHarbours.
  • Update of pirate.js logic to handle new logic priority for damaged ships.

Proof of Work Carried Out

This is the full url to my github account:
https://github.com/miniature-tiger


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.

Roadmap

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

Resources

  • 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

Goods

  • 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
  • Breaking of contracts due to interference

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

  • Recipes, time to implement, graphics etc

Scoring:

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

Pirates

  • 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

Forts

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

Conflicts

  • 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

  • Settings pop up box created - COMPLETE
  • Options added - In progress - game speed 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:
https://miniature-tiger.github.io/archipelago/

The repository for the project is here:
https://github.com/miniature-tiger/archipelago

Have fun!

Sort:  

Thanks for the contribution!

Some very cool little features! I am curious to see how you will implement the various levels of AI for NPCs!

Click here to see how your contribution was evaluated.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks Amos!

Yes, the AI will be tricky. I'll start with basic sets of rules / priorities like for the pirate ships. Then it will be a question of finding different strategies that work and adding those. Perhaps making more aggressive / less aggressive personalities. Easier level computer opponents will have fewer strategies and simpler games.

Eventually it may be possible to run computer opponents against each other and have them learn but I think that's a way off yet!

nice brother @miniature-tiger!! Please folback 😉

Thanks @rezamusic. I'll take a look at your blog!

Beautifull work dear keep it up . @miniature-tiger

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 4 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 40 SBD worth and should receive 56 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,
trufflepig
TrufflePig

Thanks @trufflepig. You may want to add the utopian API to your code to improve the algorithms. It should be possible to work out roughly how much utopian posts will receive, which could save your voting power for those that may need it more.

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 https://discord.gg/h52nFrV.

Vote for Utopian Witness!

hello, i like this post, i voted for you, i have followed you, hihi you, i have a private blog about coffee in steemit, maybe you like, i will share your opinion You will know there are many good things about my coffee blog, follow me, and vote for me, thank you, make a funny steemit

Coin Marketplace

STEEM 0.20
TRX 0.14
JST 0.030
BTC 67808.66
ETH 3248.00
USDT 1.00
SBD 2.67