Resource discovery and addition of new tiles - Archipelago.

Up until now there have been lots of empty land tiles on the map as phase one of development focused on the board creation and ship movement.

Phase two aims to build in the resource discovery, goods production, building, and trade contracts functionalities. A key part of this second phase of development is the ability for players to visit islands and discover new resources which will produce the goods that they can then use for building and the trade contracts that underlie the game.

This contribution mainly focuses on the "resource discovery" functionality. In addition the contribution covers:

  • Creation of two new tiles in SVG format: desert (no resources) and quarry (stone production).
  • Allocation of random resource tiles to each base at the start of the game.



Screen Shot 2018-04-12 at 22.22.14.png

For a full view of the current state of the game see my github-hosted page:
https://miniature-tiger.github.io/archipelago/

Background details of the project and a list of previous updates can be found at the end of this contribution post.


New Features covered by this Contribution


"Resource discovery" functionality

The "resource discovery" functionality allows ships to visit unknown islands in the archipelago and uncover new resources. When ships anchor next to unclaimed open islands, the resources present on the island are revealed.

The type of resource on the island is drawn randomly from a "resource deck", as if from a pack of cards; the idea being that only a certain number of resources will be available in each game.

The game play can be seen below:



Screen Shot 2018-04-12 at 18.41.54.png

Ship approaching islands


Screen Shot 2018-04-12 at 18.42.13.png

Two quarry resources and a forest resource are revealed

A new javascript object "resource.js" was created to handle the resources. New methods were written which:

  • Count the total land tiles available on the board;
  • Populate the deck of resource tiles based on certain constraints; and
  • Pick tiles from the deck at random.

A method was also written to handle the land discovery, checking a single tile grid around the ship at the end of each move. When resources are discovered new SVG tiles are created and the boardArray is updated. The land discovery is included within a timeout function to ensure new tiles only appear once the ship transition is complete.

The code changes for this section can be found here:
https://github.com/miniature-tiger/archipelago/pull/32/files


Creation of two new tiles in SVG format: desert (no resources) and quarry (stone production)

The quarry tile and desert tiles were designed in SVG format and added into the relevant methods. The quarry tile will allow stone production. The desert tile will produce no goods.



Screen Shot 2018-04-12 at 21.12.12.png

Quarry tile at the bottom: "pick and stone"


Screen Shot 2018-04-12 at 22.21.06.png

A couple of desert tiles are revealed among these islands: "sand dunes"

The code for designing and integrating the new tile graphics is covered here:
https://github.com/miniature-tiger/archipelago/pull/33/files


Allocation of random resource tiles to each base at the start of the game

The final change in this contribution allocates two random resource tiles to each player at the start of the game for their base islands. This will introduce some luck at the start of the game, requiring the players to adopt different strategies and seek out different resources.



Screen Shot 2018-04-12 at 23.17.27.png

Quarry and forest tiles allocated to Team Orange

The main complexity was in determining in which order to call the various methods and reordering code on this basis:
(1) board is created (2) empty tiles are counted (3) resource deck is created with right number of tiles to fill all empty tiles (4) random tiles are picked for team bases

The file changes can be seen here:
https://github.com/miniature-tiger/archipelago/pull/34/files

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 central market and each other, 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

For the short term roadmap the first main goal of getting ships on the board and moving at different speeds under the influence of the compass is complete.

The interlude of overhauling the graphics is also now complete.

Work has now begun on the second stage which is land squares and goods discovery and delivery contracts including the player dashboards.

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
Phase 2
Land Squares and Resources:
  • Dashboard of player pieces and resources - COMPLETE
  • Resource tiles (forest, iron, flax, gold etc) - in progress: forest and ironworks added
  • Summaries of produce and populations and functioning for each Resource
Contracts for delivery:
  • Semi-random (equitable) generation of trade delivery contracts
  • Creation of trade settlements
  • Dashboard for contracts
  • Mechanics for contract sign-up
  • Mechanics for contract delivery
The long term roadmap is still to be fully fleshed out but includes:
  • Building: (recipes, times etc)
  • Islands (naming: for describing location ot pieces, trading settlements)
  • Central trading centre:
  • Conflicts:
  • Pirates:
  • Scoring:

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!



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
4 Comments