Archipelago - One-player version taking shape!steemCreated with Sketch.

in #utopian-io7 years ago (edited)

The one-player version of the game is really starting to take shape!

Introduction

In the last update I introduced team-based decision making for computer players. This is the process by which the potential moves for a computer player are collated and ranked and also allocated between ships to ensure that two ships do not pursue the same goal.

Over the last week I have added the resource delivery moves to this decision making process. I also added the necessary code for the gameboard and contract updates once the computer player arrived with the required goods.

With the completion of this functionality computer players can now:

  • Search the islands on the board for resources;
  • Claim those resources;
  • Collect goods from those resource tiles once a relevant contract is announced; and
  • Deliver those goods to Kingdom islands to fulfil contracts.

This completes the basic moves required for a computer player to complete and win the game. Although there is a fair amount still to add, a basic one-player version of the game is now taking shape!

In addition I added the following features:

  • Automated scrolling of the board so that computer ships are on the screen when they move.
  • Automated end-turn for computer player and pirate moves so that the human player does not have to keep pressing the button.
  • Some improvements to the gameboard for when players are eliminated.

frontscreen.png

Repository

The repository for Archipelago can be found here. Background details of the project and the road-map can be found in the read-me file.
https://github.com/miniature-tiger/archipelago

For a full view of the current state of the game see my github-hosted page. Please note that the game is not yet complete - you can see current progress and test functionality and play the basic one-player version but there is still plenty to be added!
https://miniature-tiger.github.io/archipelago/


New Features covered by this Contribution

Contract delivery decision making

The main addition is integrating the resource delivery moves into the computer decision making process. This allows computer players to choose and allocate between three move types: resource searches, resource collection and contract delivery. One such array of ranked moves can be seen below:

movedecision.png

The code changes for this new feature can be found here:
https://github.com/miniature-tiger/archipelago/commit/c707c074d607cf732a76a459e189177c66356786

Contract delivery move integration and graphics

Once a computer player makes a delivery move, the game board, dashboard, contract, and trade route arrays and graphics need to be updated. This commit integrates these changes. The gif below illustrates such a move:

contractdelivery.gif

The code changes for this new features can be found here:
https://github.com/miniature-tiger/archipelago/commit/51461b3da4958592b55133eb63da8070465af9f1

Automated scrolling, end-turn and listener management

Now that the basic computer player moves are in place I worked on ways to improve the feel of the game-play. The first two changes I made here are:

  • Automate the end-turn of the computer player moves and the pirate moves so that the human player only has to action their own moves. I also reworked the event listeners, separating between listeners that are on at all times (score dropdown, settings management) and action event listeners (end turn, piece movement, building, board searches) which are turned on and off to prevent interruption of automated moves and transitions.
  • For computer and pirate moves scroll the screen to the ship that is about to move. There is a delay before the scrolling, before tiles are activated, and before the ship starts to move so the game does not feel rushed. The scrolling is limited to upper and lower edges of board and there is a restriction on minimum scrolling to prevent jumpiness.

Another gif to illustrate!

gamescrolling.gif

The code changes for these new features can be found here:
https://github.com/miniature-tiger/archipelago/commit/845dc64d3b9fc062039e0c78f6b8a0ec727d7433
and here:
https://github.com/miniature-tiger/archipelago/commit/12ce73691d960fbd82c7d414e81e0cd6328ff679

Players elimination improvements

Finally some changes to improve the game when a player is eliminated.

  • Trade route SVGs are removed from the board for the eliminated player as well as removal of associated points and resetting of contracts array (since contracts were not completed).
  • Bug removed that caused game to freeze if first player in new round of moves had just been eliminated.

The code changes for these new features can be found here:
https://github.com/miniature-tiger/archipelago/commit/b7d86b9dd35b3bc5f83630e43f516052242ef69e


Proof of Work Carried Out

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


Contact / Contribute

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

Have fun!

Sort:  

Thanks for the contribution, @miniature-tiger! It's really great to see Archipelago being developed again! The automated end-turn and scrolling are some really great quality of life features you have added. Really looking forward to single-player being done, as the game is gorgeous and I really want to play it!

Since I am now coding in JavaScript as well I can give some more personal feedback. I've been using Prettier and ESLint together, which is really useful for keeping the code consistent. One thing I noticed is that let is sometimes used in the code when instead const should be used for example. I have it set up so that when I save it will automatically fix like that, so I don't even need to think about it, haha. I'd definitely recommend it!

Anyway, keep up the great work!


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 https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks Amos!

That's a good tip on the let/const. I'll admit that I default to "let" generally because I assume it won't give me any problems, aka laziness!

At some point I need to refactor the whole project, since it includes code all the way back to when I was first learning JS. Including moving across from callbacks to async/await, increasing DRYness and some of the later ES developments. I'm just waiting until I feel my code style has improved enough that I don't have to go through the process twice! But I'll aim to implement greater consistency and the code style tips I'm getting though feedback as part of that rework. All useful stuff and much appreciated!

Thank you for your review, @amosbastian! Keep up the good work!

Wow, this game is really good-looking, seems fun, and I definitely want to play it! It would be great if you could post some sort of tutorial (you could even ask for someone to make a video one through utopian-io!), because I have no idea how to play. Where can I find you on discord, I'd love to chat.

Ok, I figured out how to play (mostly) but couldn't figure out how to fight or do contracts/trade routes. Also, I found a bug where when you press end turn it turns black but the animation doesn't start for the AI turns. I had press it again to fully end the turn.

Thanks @shredz7!

I do need to add in hints / help to the game. It's one of the things I'm thinking about. I'll probably have a pop up which indicates which tiles to press each time a new move-type is possible for the first time.

For some quick tips:

  • Every move consists of either clicking on the ship and then on one of the red circles that appears, or clicking on one of the islands next to the ship and then clicking on the ship (to load goods for example).
  • For trade routes you need to discover the resource (anchor next to island), claim the resource (click ship then island when anchored), load the goods once you have the initial amount (click island then ship when anchored), move to Kingdom island to deliver (click ship then Kingdom island when in harbour).
  • You can't attack other ships. It's something I may think about adding. But currently the idea is that you just try to avoid the pirates who will steal your cargo.

Thanks for the bug tip. There is an issue with the pirate moves overlapping sometimes. But it occurs rarely so I'm having trouble nailing down exactly why it arises. I'll work it out soon!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 17 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 6 SBD worth and should receive 117 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

Hi @miniature-tiger!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @miniature-tiger!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.12
TRX 0.34
JST 0.033
BTC 112926.96
ETH 4171.47
USDT 1.00
SBD 0.86