Steem Monsters Tech Talk - Part 5 - The Decentralized Match-Making Protocol

in #steemmonsters6 years ago


To make this post a little more interesting for the non-techies, I'll give 10 STEEM to whoever comes up with the funniest text to go in the text bubbles in the image above!

I know that everyone is eagerly awaiting the release of the card stats and gameplay mechanics, and I promise that is coming soon - and I mean for real soon, not SMTs soon! In the meantime, I thought I would take some time to talk about the planned protocol for the decentralized match-making and battle/tournament system. I hope everyone can contain their excitement :-P

Finding a Match

The first step to starting a 1-on-1 battle with another player is to broadcast an "sm_find_match" custom JSON transaction with the details about the type of match you're looking for and a hash of your team (more on this later). The content of the operation is as follows:

{ 
    match_type: 'standard', 
    mana_cap: 20, 
    expiration_seconds: 120, 
    team_hash: 'some_hash_value'
}

The "match_type" property will indicate what format you are looking to play. Initially we will start with a single format - "standard" - but in the future we plan to create many different formats with all sorts of different rules and mechanics and to keep things interesting.

The "mana_cap" specifies the max combined mana cost for all of the cards on each team and "expiration_seconds" specifies the amount of time available to find a match before the transaction expires. Time here is actually measured in blocks so the value will be divided by 3 and rounded down to determine the number of blocks before the transaction expires.

Lastly, the "team_hash" is an MD5 hash of the cards that make up your team. We use a hash here instead of publishing the team directly so that you cannot see what cards other players looking for matches are using and cherry-pick the ones you feel you have a better chance of beating.

The hash is calculated as follows:

md5(summoner + ',' + monsters.join() + ',' + secret);

where "summoner" is the UID of the Summoner card chosen and "monsters" is an array of the UIDs of the Monster cards. "secret" can be any value and is just used so that people can't brute-force guess what a player's team is by hashing different combinations of card UIDs.

Match-Making

Whenever a new "sm_find_match" transaction is broadcast and included into a block, the protocol will search through the list of open "sm_find_match" transactions in the match queue in a deterministic fashion to see if it finds a match.

A match is found if there is another "sm_find_match" transaction that has not been matched yet and has not expired which has the same "match_type" and "mana_cap" and both players ratings are within a specified range.

We are planning to use the Elo system to assign ratings to all players based on their performance in the 1-on-1 battles. This will help ensure that matches are fair and that players get matched against players with similar card levels and similar skill levels.

If no match is found from the transactions currently in the match queue, then the new transaction is placed in the match queue until it either expires or gets matched with a new "sm_find_match" transaction that comes in.

Team Reveal

Once two players have been matched up for battle, it's time for them to reveal the cards on their teams. At this point, the match has officially started, and if any player fails to reveal their team it will count as a loss and their rating will decrease accordingly. If both players fail to reveal their teams then the match will be cancelled.

Each player will have 20 blocks (1 minute) from the block containing the second "sm_find_match" transaction to reveal their team. To do this, each player must broadcast an "sm_team_reveal" custom JSON transaction with the following content:

{
    "trx_id":"84edab614797bfbd5d117f3ef387f20f3491389e",
    "summoner":"C-PCPBW2W82O",
    "monsters":["C-V8JFUUPV1C","C-FFNFY8RBS0","C-WCAPN7E0Q8"],
    "secret":"a6MkvmV2R1"
}

The properties are as follows:

  • "trx_id" is the transaction ID of the initial "sm_find_match" transaction
  • "summoner" is the UID of the team's Summoner card
  • "monsters" is a list of the UIDs of the Monster cards on the team
  • "secret" is the secret value used to compute the hash broadcast in the "sm_find_match" transaction

At this point, the protocol will perform the following checks to validate that the team is valid:

  1. Check that the player actually owns all of the cards listed and that they are not currently for sale on the market.
  2. Calculate the MD5 hash using the summoner, monsters, and secret values to ensure that it matches the one broadcast in the "sm_find_match" transaction.
  3. Check that the cards used are all allowed in the specified match format and that the total mana cost is under the specified mana cap.

If one of the player's team reveal is invalid and the other player's is valid, then it will count as a loss for that player and their rating will be adjusted accordingly. If both player's team reveals are invalid, or one is invalid and the other does not submit a team reveal transaction in time, then the match will be cancelled.

It is important to note that a different account can sign and broadcast the "sm_team_reveal" transaction than the one that signed and broadcasted the original "sm_find_match" transaction. As long as the hash matches, and everything else is otherwise valid, it will be considered a valid team reveal.

This will be useful for things like tournaments where a player might enter a tournament that doesn't start for a number of days. Instead of that player having to either make sure they broadcast their team reveal at the right time, or trust another account with their keys, they can instead just share their team and their secret with a service that they trust to keep it secret (such as steemmonsters.com) which can do the reveal for them.

Enough Talk, Let's Fight Already!

This probably all sounds like a lot, but it will all be under the hood and taken care of by the user interface. From the typical player's point of view they'll just choose their team, click submit, and get matched up without knowing any of this is taking place behind the scenes on the blockchain.

So, once all the stuff I wrote above happens, and two players are matched up and have revealed valid teams, the battle will take place!

The battles will be done completely deterministically and in a provably fair manner so that anyone can calculate the battle results for themselves and verify that they match the results calculated by steemmonsters.com or any other future UI that supports battling. This is the same as how card packs are generated and how we pick our raffle prize winners!

The random number generator used for the battles will be seeded with the MD5 hash of the block id, previous block id, and transaction id of the second "sm_team_reveal" transaction, since that is the final transaction necessary to start the battle.

Tournaments

I haven't built out the protocol for running tournaments yet, but the idea is that anyone will be able to create their own tournament by broadcasting a custom JSON transaction with all of the tournament details including:

  • Start Date/Time (indicated by block #)
  • Min/Max Entries
  • Tournament Format
  • Match Format & Mana Cap
  • Prizes

Then players who want to enter the tournament can submit a transaction similar to "sm_find_match" described above with a hash of their team and the ID of the tournament they want to enter.

Once we have reached the start block for the tournament, no new entries will be accepted, and all entrants will have a set period of time (in blocks) to submit their "sm_team_reveal" transactions.

Once that is done, any invalid teams will be discarded and assuming there are enough valid teams to cover the minimum required entries the tournament will take place in an automated, fully deterministic, and verifiable manner.

As for the prizes, we will likely create some type of escrow service for third-parties who want to run tournaments for blockchain-based prizes. This way they can send Steem, SBD, Cards or Card Packs, and @steemmonsters will automatically pay them out to the specified winners at the conclusion of the tournament, or refund them to the creator if the tournament does not take place for any reason.

All of this remains TBD at this point though, so please feel free to let me know if you have any other ideas, thoughts, or comments!

Tournament Prizes

As we have been saying since the beginning, the plan is to have tournaments sponsored by Steem Monsters. These tournaments will happen weekly and feature payouts of at least $1,000 worth of Steem/SBD to winners! We plan to also feature regular and gold foil variants.

Thanks For Your Support

As always, I want to sincerely thank everyone who has supported me by giving me upvotes, approving my witness, buying Steem Monsters packs, or just leaving an encouraging comment or message! We never would have built Steem Monsters, and probably wouldn't even still be using Steem, if it wasn't for the amazing community of people here!


Sort:  

Blank template if anyone needs

Thanks.

SteemMeme.gif

yabapmatt - entry 1.jpg


yabapmatt - entry 2.jpg

Hey @yabapmatt,

nice post and thanks for taking the time to share your wisdom.

I have two questions:

  1. What is a Summoner Card ?

  2. Wouldn’t make it more sense to check if the player owns all cards listed before he/she sends out the sm_find_match?

You can see which cards are summoners vs monsters on steemmonsters.com while viewing your collection. Currently there is one summoner for each color/element. More details about how the different types of cards will work will be released soon with the full gameplay mechanics and stats.

As for your second question, the cards being used are not published with the "sm_find_match" transaction, only the hash is published, so it's not possible for the protocol to verify them at this time. Most UIs, however, will enforce proper team creation prior to publishing the "sm_find_match" transaction so I expect it will be very rare that invalid teams are revealed.

i wish i had a collection to view hah. i want to see gameplay of these steemonsters, please direct me.

HELLO @yabapmatt thanks a lot for the infos. You and your team are so AMAZING too.
this is my entry:

2.png

final 3.png

Thank you so so much @yabapmatt . For picking my Entry. I was so surprise and very happy. Thanks again and Congratulations with the success and more success of The Steem Monsters and your other projects!!.

Hey @yabapmatt,

I love these updates, keep 'em coming! lol

Since you're implementing the Elo ranking system, you must have given thought to showcasing a 'player rank ladder'... if that's true, are you thinking of a weekly/monthly/all-time ladder? Maybe a seasonal reset, based around releases of new cards (beta, season 1, etc.). Any or all of these would be great 😃

Also, as much as I like the Elo ranking system for this zero-sum game, many other games have chosen to abandon this system due to players (and their fragile ego's) complaining about why they are ranked at the level they are. Do you see this possibly changing in the future, or just stick with it and let the 1v1's speak for themselves? The reason I ask is this: from what I've seen/heard so far, this game heavily favours players who spend more ($$$) vs players who may be more skilled.

Anyhow, food for thought. I love games. lol

Cheers,
OFI-sig.JPG

Thanks - I really appreciate this type of feedback and these ideas! The short answer, for pretty much everything, is that we we want to make sure that the community of players is happy with how everything works. So if we go in one direction and it has issues or the majority of players don't like it, we will change it. Making this a really fun game for everyone is our top priority.

More specifically, we are DEFINITELY going to have leaderboards/ladders/whatever you want to call them. We will also probably modify the Elo system a bit to make sure it's fun and that players can feel like they are constantly progressing.

As for the "pay to win" aspect, there is definitely part of that in the game - a player who buys a lot of cards will have cards at higher levels and will typically beat a player who didn't buy many cards even if they are less skilled. But we plan to make all different types of game / tournament / ladder formats to appeal to all different types of players. For example, there may be tournaments that limit the levels of all cards, so that there's not an advantage to players who bought a ton. In general we are going to try to have something for all levels of players and all levels of spenders.

This is so great to hear!
Balancing a game (in this case, from cards to gameplay) is no easy feat, and I'm really happy to hear that you and your team have given it much thought (as I can tell from your response).

We will also probably modify the Elo system a bit to make sure it's fun and that players can feel like they are constantly progressing.

Awesome - this is going to keep players around fora long, long time.

Time to add that witness vote :D

Cheers,
OFI-sig.JPG

Great to know. After coming across so many posts by people saying they were buying dozens of cards and maxing their entire deck's levels, I was getting worried the game might become purely "pay to win." Well, one of the initial posts months ago (I think it was the alpha release post) said it wouldn't be so much, but we had had practically no updates about the battling part after that, so... good to confirm that there'll be space for everyone!

Last but not least, I really hope the UI for setting up the battles will be accessible to screen readers :D .

Matt, this is very exciting and I like what you are doing here! Opening the mechanics up so that people can have their own tourneys will just enhance the user experience and lead to all kinds of new game creations. I'm very happy to see the progress and think you are doing an amazing job! Keep it up!!! :)

Everyone is eagerly awaiting the arrival of Steem Monsters Matt! A lot of excitement in the air, and some super cool features for all levels of players to enjoy...Here is my effort at being funny:)

ryx-bQqwI7.jpg

Steem Monsters Meme2.jpg

tech talk 03.png

Thanks for a fascinating insight, Matt.
Will a tournament creator have a lot of free reign to set entry requirements (assuming they know how to code them) or will they be picking from a list?
(If for example somebody wanted to run an underdog tournament, with entry limited to those who've opened at least 100 packs; with a lifetime legendary drop rate below, say 0.7 %)

This is all still TBD so I don't want to promise anything, but one of the options could be a private tournament where only people who the creator invites or approves can join. So you could manually check and approve people based on the rules in the example above, or if you know how to code you could automate that process.

Coin Marketplace

STEEM 0.25
TRX 0.20
JST 0.037
BTC 95682.64
ETH 3545.07
USDT 1.00
SBD 3.78