ConsenSysMesh / web3studio-sidejam

SideJam is a series of projects designed to develop application-level examples, frameworks, components (and requirements driving protocol and R&D teams) that use the W3S narrative approach to prove the need for and ability to use the Mainnet as a way to make business safe without silos.
Apache License 2.0
2 stars 2 forks source link

Message Bus for Stratego4 #1

Open barlock opened 5 years ago

barlock commented 5 years ago

Overview

This is an Epic encapsulating research on using an EVM as a message bus and then applying that concept to the game of Stratego4.

Stratego4 was chosen as a simple example of cross-company blockchain patterns:

  1. Information that all parties know and share
  2. Information that each party keeps secret to themselves
  3. Information shared between a subset of the parties
  4. Shared information that can eventually be proven true or false

Reference

Assumptions

Acceptance

barlock commented 5 years ago

Storyboard of Gameplay: https://app.mural.co/t/consensys3989/m/consensys3989/1557345438344/718181f0ee878f1cfdc2756c9dc6aa363680b634

image

barlock commented 5 years ago

Simple Message Bus pattern image

Notes

barlock commented 5 years ago

image

barlock commented 5 years ago

Official rules for Stratego4

Source

Introduction

You are a military commanding officer on the eve of a mighty battle. The fortress you must capture looms in the distance. But there are two, or even three, opponents and they, too, will fight to call the fortress their own!

The battle takes place with:

one double-sided board 4 sets of figures in 4 colours 4 sets of cardboard ranks 4 flags and stickers in 4 colours 4 promotion cards I fortress

Before playing for the first time:

Attach the ranks to the figures, taking care to use the correct colour (see illustration). Then place the stickers on the flags.

Before the battle starts:

The board has a side for three players and a side for four players. Place the appropriate side up and put the fortress in the middle. Choose a colour and take your place at the appropriate side of the board. Then take the corresponding army, promotion card and flag. Set the moveable part of the promotion card to '0'

The object of the game:

You must get your flag and one of your pieces to the top of the fortress. The first player to succeed is the winner and the battle is over.

How to set up your army:

Place each of your 20 pieces on fields of the same colour. The centre field (see illustration on page 8) should be left empty. The pieces should be positioned in such a way that only you, and not your opponents, can see their ranks. Attach your flag to any piece. This piece must staff on the field illustrated with flags. You will learn from experience how best to arrange your pieces. Start by spreading out your high and low pieces and do not put the Cannons right at the back. You may need them in a hurry!

How to play:

The players decide who is to start and then play in turn. You can either move a piece or attack one of your opponent s pieces. Only one move is allowed per turn.

Moving the pieces:

  1. Pieces may be moved one field to the right, to the left, forwards or backwards (there are some exceptions, which will be discussed later).
  2. Pieces may not be moved diagonally; only one piece may occupy a field at any time and pieces may not jump over other pieces.
  3. Pieces may not move into the lakes, nor can they jump over them. Cannons can, of course, be fired across them!
  4. The fortress in the middle has two fields. the first ring and the top. The first ring counts as a single field, so only one piece may occupy it at any given moment. You can move into it from any of the 12 surrounding fields, and move out of it into any of these surrounding fields. A piece in the first ring can also be attacked by a piece from any of these 12 fields - and the other way around!
  5. A piece may not move to and fro between two adjacent fields more than five times. It is important to remember which player started moving to and fro, because this player has to stop doing it first and this can mean losing an important piece.
  6. The central field in the area m front of you is called the promotion field. Its purpose will be described more fully later on. Leave it empty when you are setting out your pieces, although all pieces are allowed to use this field during play.

Attacking:

  1. If an opponent's piece is directly in front of you, next to you or behind you, you can attack it; but you don't have to if you don't want to.
  2. To attack an opponent: take your piece, tap your opponent's piece with it, and state your rank. Your opponent then names his rank.
  3. The piece with the lowest rank loses and is removed from the board. If the attacking piece wins, it takes the place of the losing one; if the defending piece wins, it stays put.
  4. If the attacking piece and the defending piece turn out to have the same rank, both lose and both are removed.
  5. Losing pieces return to their owner, who must arrange them in front of him in order of rank so that all the other players can see these ranks.

Your pieces:

The ranks are displayed in correct order on your promotion card. To make them easier to tell apart, each rank also has a number. The Marshal is the highest-ranking piece and has the number 9; the General is a number 8, and so on, down to the Cannon with the number 1. A Marshal beats a General and all other lower ranks, a General beats a Major and all other lower ranks, and so on, down to the Cannon, which can be beaten by any other rank.

A few ranks have special features:

Captains belong to the cavalry, so they can move faster. A Captain is allowed to move two fields at once, changing direction halfway if he wants to. He can also attack opponents only once during such a move, though, and if he attacks an opponent in the first field, then he cannot move any further in that turn.

Scouts can jump over more than one empty field in a straight line; left, right, forwards and backwards. They cannot jump over pieces, over the fortress, or over the lakes. So a Scout can attack from a great distance, provided there are only empty fields in between. Scouts can mean real trouble for Cannons and Spies!

Spies are the same deceptive characters they were in the original Stratego. Almost every piece that attacks a Spy, wins. But If a Spy attacks a Marshal, the Marshal dies! The Spy has to attack first in order to kill a Marshal; if the Marshal attacks the Spy first, then the Spy dies.

Cannons are dangerous weapons. Think carefully about when you fire a Cannon and where you aim it, because a Cannon can only be fired once; after it is fired it is removed from the board. Look after them, because as the lowest ranking piece Cannons can be beaten by every other piece - including from a distance, by a Scout! They are moved just like ordinary pieces. A fired Cannon beats every other piece, but their field of fire is limited: three fields, in a straight line. So the cannonball lands not one, or two, but exactly three fields away. And the two fields in between have to be empty! Cannons can fire over lakes; a lake then counts as one field. Cannons cannot fire over the fortress.

The flag:

Any piece can carry the flag. Just fix the flag onto it. But any piece holding the flag, even a Scout or a Captain, can only move one field at a time. If the piece holding your flag is beaten, your opponent can take your flag, and move away with it in a later turn. If this happens, you will have to win your flag back to be able to win the game! If your flag is attacked by an opponent's piece of the same rank, or if it is attacked by a Cannon, then both pieces are removed from the board but the flag remains, unguarded, on the ground. The first piece to arrive at that field can pick up the flag. If you want, you can drop the flag and let another one of your pieces pick it up on your next turn. A piece can only carry a single flag.

Promotion:

At the beginning of the game, each player gets a promotion card and sets the slider to Every time you attack an enemy piece or are attacked, and you beat that piece, you can slide one number up. When you reach the 'VI', you must choose one of your pieces that was beaten earlier and put it back on the board, in the promotion field. You have to choose straight away, and if your promotion field is alrea4y occupied, then tough luck - you lost your chance!

(Thanks to @nicholas-cook for translating)

There is another way to return one of your pieces to the field: when you take the flag from one of your opponents. But this is only possible if the last player holding the flag is the player who started the game with that flag. This rule also applies when the original flag holder drops their flag on a field and you pick it up before they do. If this happens, and your promotion field is already occupied, you cannot wait for your next turn to put your piece back on the board. Too bad!

Playing with four players:

When you have four players, you can split into two team for even more fun. Teammates sit facing each other and work to help one another. Of course, they are not permitted to tell each other their pieces’ ranks. The team that gets one of their two flags to the top of the fortress first wins.

Tactics and strategy:

Try to place your pieces where they can easily move to attack…without losing sight of your defensive positions.

Be wary of players who move their flag into battle at the beginning of the game! They might be trying to get their flag out quickly to advance towards the fortress. If nobody stops them, the game will soon be over. Stay alert!

Pay close attention to the different ranks of the pieces your opponents have lost in battle.

Save a few scouts for the last moments of the battle.

image

This is where they are strongest. When you place a cannon behind one of the lakes, the first ring of the fortress is in firing range!

In other words, it is the best place to put your cannons. When playing with three people, and your two opponents attack you, it will be difficult to defend yourself for long.

Try then to convince one of them to move their flag towards the fortress, or start moving your own flag in the same direction.

Be careful not to waste your highest-ranking pieces. However, there is no need to be as careful as you are when playing Stratego Original.

Thanks to promotion, you can recover one of your pieces!

Diagram (starting with cannon, moving counterclockwise): 1. If your cannon is here, you cannot fire towards the fortress as you cannot fire over the fortress. The piece carrying the flag starts at this field. The promotion field 3. A scout located here can move to any of these fields.