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

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.

tech talk 03.png

Well played @yabapmatt love your work my friend

photostudio_1534770223591.jpg

contest to Steemmonsters.jpg
I hope to practice the rules of the game before the tournament.
I like the progress of Steem Monsters!

Top Balloon - You look like some kind of Pokemon!

Bottom Balloon - So what? You are a fake Pharaoh!

I am a mom who only played pokemon red years ago, because my son was too young to read at that time. The rest of this topic has passed me by. Maybe in my next life.

I found you on twitter and came for the "non-techies" part. I am highly qualified in this area. Many people can vouch for my technical stupidity. I did not read the rest of your post, but I'm sure it is very good :)

monstermeme.png

Create your own tournament by broadcasting a custom JSON transaction!?!?!

Escrow service for third-parties!? This just gets better every day!

This game is the future IMO. So much potential here. Keep up the great work Matt. :)

Correct me if i'm mistaken but this sounds a lot like the starcraft system when you could create all sorts of types of games and people could jump in. And on that note i am very nostalgic of those days.

The first game like starcraft I ever played was warcraft.

Just look at these gfx! #NostalgiaToTheMax

I remember those days.

  • I’ve just spent an hour building all these cannons, going to crush this level,
    -entire army defeated by giant fire orc

.7BA6E975-7874-421B-AE93-F3355A0B9341.jpeg

“Weary is the flesh upon the stakes which yet hold sway against an onslaught of perpetual. Frailty encompasses as a swarm stings, ten upon ten into the hundreads. This place, once pastures and ponds, feeding the peace and pleasentry, is besieged. Lascivious creations of all a fowl manner spew forth from the sky, from the bowels of mantles even unto the unseen darkness of dark folds unraveling. Madnesses lays rest to civility as the monsters march upon every monument of sanctuary held dear. Conflict is inescapable, who amongst the stemmians will crawl from the depths of slumber to battle STEEMMONSTERS!?!?!?”
-M

It's so exciting!! :-)

I think based on what you said about tournaments it seems many people can do sponsored tournaments with prizes and say that a particular tournament has a prize.

I think we'd like to jump in and do some. Not as big as your 1000 steem contests but still we can add to the fun. right?

Definitely! I should have mentioned that we'll probably be listing all of the tournaments on the official site, not just our own.

AMwTf6K.jpg

Great news, I like the possibility to make tournaments on our own, still that code think is too much for me. I don't think I would be able to promote one :).

Very cool matt!
I hope that everything works smoothly so we can start competing.

So we have to learn a bit of coding to play this game?

No not at all, this is just how it will work under the hood. As a player you don’t have to know about any of this.

Dude no idea what that code means but I'm super psyched for it :D. Keep up the killer work.

I don't know code either but I'm with you, I'm so excited! I can't wait to have so much fun and it's all right here on the Steem Blockchain! No high gas costs,etc. Like the Ethereum Blockchain and games I played there. I'm happy!!! :-) Nice collection you have! I sent you that Peacebringer!

Thanks so much @clove71, that's too nice of you!

I think I will read this post one more time because I am not a thech person , I really like steemmonsters and want to understand all details of this game

@yabapmatt what would I use to create a bot

Hi @yabapmatt I'm a bot, and wanted you to know that I've upvoted and re-steemed your post to help you with your promotion efforts! -exp

And on a personal note, you've had my vote for witness also :)
-exp

Buenas noche. Excelente propuesta de juego. Saludos desde Venezuela

@yabapmatt

Interesting thought many would like to jumpin and participate..

You got a 80.60% upvote from @postpromoter courtesy of @steemmonsters!

Want to promote your posts too? Check out the Steem Bot Tracker website for more info. If you would like to support the development of @postpromoter and the bot tracker please vote for @yabapmatt for witness!

Excited!

You have recieved a free upvote from minnowpond, Send 0.1 -> 10 SBD with your post url as the memo to recieve an upvote from up to 100 accounts!

Lol! I was getting worried in the begining of your post with all the talk about hashes and code. Thanks for clearing up that it was all happening under the hood. You got me worried there, for a bit.

very interesting in this battle, it will be very necessary to try this

interesting stuff.

I really enjoyed the writing. Thanks a lot of this attractive content.

@yabapmatt really amazing article....

i'm your witness ! O.ob

@yabapmatt
Thank you thank you so much sir for your gift...you dont know how much i need it...🙏

Thanks @yabapmatt for the generous prize for your meme contest! We now look forward to the battles:)

Thank you so much @yabapmatt ^^!, this prize it's very important to me I will use it wisely to grow up my account here. Hope I can help others like you did with me this time. Thank you very much.