Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Meme Trading Card Game #281
Name: Meme Trading Card Game
The Meme Trading Cards game is a turn based, peer-to-peer board game played on a 3x3 grid using provably rare ERC721 crypto collectible memes (cards) that are issued in the Meme Factory’s Token Curated Registry (TCR). While not playing, the owners of the memes can train their cards to be stronger in a process called “working” which borrows elements from MMORPG games, namely the logic behind allocating experience points for time spent working on the card.
The goal of this project is to help build a solid ecosystem around provably rare memes that originate from the TCR. This is beneficial to the Meme Factory platform as the game provides an incentive for meme authors to create new content. It is also beneficial to the meme authors who can train their owned meme cards to be stronger and play against each other in a peer-to-peer matching system so their memes are put to actual real use in a way which will increase the meme’s value instead of laying dormant in their crypto wallet collecting virtual dust.
This turn based game is played on a 3x3 board where cards are placed as the game progresses. Each card has four values shown in the top left corner. Each value corresponds to one of the four sides of the card (left value for left side of the card, top value for top side of the card, etc.) The values range from 1 to 10 with the value 10 represented by the letter A.
The first player is chosen randomly after which they may choose a card to place anywhere on the board. After the first card is placed, the opponent may place a card on any unoccupied space on the board.
The color of the card indicates which player has captured it on the board. All green cards are captured by the player and all yellow cards are captured by the opponent. The game starts with both players having an equal score of 5 (because they both have 5 cards that haven't been played yet).
To win, a majority of the total ten cards played (including the one card that is not placed on the board) must be of the player's card color (green). To do this, the player must capture cards by placing a card adjacent to an opponent's card whereupon the value of the sides where the two cards touch will be compared. If the value of the player's card is higher than the opponent's card, the opponent's card will be captured and turned into the player's color (green). The opponent can capture the player's cards the same way.
A draw occurs if the player and the opponent possess equal numbers of cards in their color on the board.
A more thorough description of the game rules as well as a playable demo can be found here.
Registering a card:
The owners of memes issued in the Meme Factory TCR are able to register their card in the Meme Trading Cards game platform giving each new card the initial value of 1 on all of the corresponding card sides (top, right, bottom, left). The registration procedure is straightforward as the DApp will only have to call the
After successfully registering and proving ownership of a card, the player can then choose which side of the card they wish to work on. Once the choice is made, the player will be able to start working on the chosen side. The smart contract will take note of the current timestamp which will be used later. The entire process of working is AFK (Away From Keyboard) so it doesn’t require much effort, but it will take quite some time to train the card side’s value all the way up to A (level 10).
The process of working:
There is no limit to the amount of cards the player can concurrently work with, but each card can only gain experience to one chosen side at a time.
The process of working consists of mainly two actions: starting and stopping the work session.
A work session is considered successful when the player calls the
Experience for the card is calculated by first dividing the duration of the work session by a global xp modifier that the community will agree upon and then multiplying the result by the card’s individual xp multiplier. The individual xp multiplier for each card is increased by an increment of 1 only after a successful work day.
The duration of time spent working is calculated by the smart contract by subtracting the current timestamp from the timestamp when the card started working. The timestamps are in unix format which makes the calculation very simple.
Experience points will be counted only upon a successful and uninterrupted work session where the
Levels for each of the card’s sides are increased according to the following table:
Level 1: 1154 xp
Notice how the first 4 levels are easily attainable by working for just 24 hours while in contrast the maximum level is reached after 14391160 seconds or approximately 166 days. Using this formula we ensure that the higher leveled cards are more difficult to get which in turn make them more valuable should the player wish to sell their cards on a decentralized marketplace like OpenSea.
Card level restrictions:
Maxing up all the card’s sides would take a while, but would effectively make the card invincible in the game. In order to avoid that there is a limit to how strong each card can get.
These checks are performed each time a player calls the function to
Card tiers are the overall levels for each card. Tiers indicate the overall strength of a card and a different cosmetic appearance is applied as an overlay on the cards based on their tiers. Higher tier cards will look more appealing than lower tier cards.
Card tiers are determined by the sum of the square values of each of the card’s sides divided by 2.
For example if we have a card with the following levels: 5,5,6,6 then 5^2 + 5^2 + 6^2 + 6^2 / 2 is 61 which makes it a tier 5 card based on the Tiers Table below.
Tier 1: (18 to 22.5)
The copystrike ability:
The copystrike ability is a laugh at Youtube’s expense where anyone can claim someone else’s video and take all the revenue. Copystriking in the Meme Trading Cards game follows the same general principle, but it’s essentially a form of attack that can be performed on any player’s card which is currently working or leveling up.
When a card gets copystriked all of the earned experience from since the card started working to the point when the copystrike attack took place will be given to the player performing the attack and the experience gained will be allocated to the attacker’s chosen card. Note that this does not reduce the already “locked” card levels on the victim’s card that were earned when the player successfully ended a work session.
The xp multiplier for the victim’s card will not be increased when copystriked even if the card had otherwise been working for at least a work day. This makes copystriking your enemies useful if you wish to disrupt their progress because the lower their xp multiplier, the less experience they earn per work session.
Restrictions to the copystrike ability:
An attacker can only perform the copystrike on cards that are currently in an active work session. Additionally the attacker’s card must have a chosen card side they wish to gain experience in and the attacker’s card must not currently be in an active work session.
In order to prevent abuse and make earning experience through working more relevant than simply stealing it, there are certain restrictions applied to the copystrike ability. For this we have introduced two additional variables: the cooldown modifier and the total work hours count.
The cooldown modifier is triggered after each attack preventing the player from performing any additional attacks with their card during the time period dictated by the global cooldown time variable.
The total work hours counter keeps track on how long each card has worked in total since they were first registered in the game. Unlike experience points that can be stolen, the total work hours will always stack up on the victim’s card total work hours counter despite being copystrike attacked.
By implementing the total work hours counter we can stop the attacking card from performing the copystrike attack on cards that have a higher total work hours count than them. In other words new players with no work hours cannot simply start copystriking other cards to gain free experience points. And at the same time, since the total work hours always stacks up on the victim's counter, we reduce the number of times an attacker can consecutively copystrike one single card. They'd simply have to start working at one point in order to increase their work hours to be allowed to attack again.
Benefits of the copystrike ability:
The copystrike ability, while not as useful as earning experience through working and ending a successful work session after a work day has passed, can still be beneficial in some cases. For example the attacker can potentially earn huge amounts of experience points by copystriking cards that have been forgotten by their owners.
This is possible because a card that is forgotten and working (
This will force the player to return to the game to check up on their card’s progress regularly. If they don’t, they risk losing a lot of experience points to the attacker’s who listen in on the public Events on the Blockchain to find potential victims with long work session duration that have not called the
Additionally the copystrike attack can be used to disrupt a player’s progress towards incrementing the xp modifier. This allows for the formation of malicious teams who copystrike their competitors systematically and make earning experience points more difficult for their victims.
Hiring a lawyer:
Finally there is a feature in the game called hire a lawyer which is essentially a way to gain temporary immunity towards any copystrike attacks.
The way it works is a player can pay a fixed lawyer fee in BrofistCoin at any time and once assigned to a player’s card the smart contract will not allow any copystrike attacks to be performed on the card for the duration of one work day + 1 hours. The additional hour is added to protect players should the Ethereum network transactions take too long to get mined and give the player enough time to call the stop working function before being copystriked by someone.
The Peer-to-Peer mode is where the game gets really fun and exciting! This is where the players can show off their hard worked stats and battle against each other in a peer-to-peer matching system. In essence we will have a casual lobby type chatroom where players can show off their stats and invite other players to stake a card and play against them.
Staking a card:
Before a peer-to-peer match can begin, both players have to come to an agreement on which card they are going to stake. A player can also choose to stake a card before any match has been initiated and continue chatting in the lobby to let other players know that they are ready for a match.
The staked card will be temporarily given to the Meme Trading Cards game smart contract and after the match is over, the loser will simply not regain ownership of that card. It will instead be delivered to the winner along with their staked card.
BrofistCoin is an unofficial fan-made ERC20 cryptocurrency inspired by PewDiePie also known as the great Meme Lord. BrofistCoin can be earned by having your memes that you submit in the PewDiePieSubmissions subreddit appear in a LWIAY(Last Week I Asked You) episode in which PewDiePie reviews the most upvoted memes from his subreddit weekly.
Each week after the episode we take the top 3 memes based on Reddit upvotes and allocate 100 BrofistCoin between them by considering the overall percentage of upvotes within the top 3. For example 25 BrofistCoin is rewarded to the meme author who got 25% of the combined upvotes of the top 3 memes.
The remaining 10 million coins have been distributed in a way which leaves 2,5 million coins to both PewDiePie’s wallet and the developer’s fund and the remaining 5 million coins is held in the Meme Fund which we use to reward LWIAY winners and potentially will use in the Meme Trading Card game to reward players as well.
BrofistCoin has no financial value as it has not been listed on any official exchange other than ForkDelta where the trading volume is minimal.
Conversion of experience points to BrofistCoin:
While not yet official we have been considering the option which would allow the player who has earned experience points from working with a card to exchange their experience to BrofistCoin instead of allocating it to their card levels.
The exchange rate would have to be carefully considered, but one of the reasons we implemented the hire a lawyer feature is to bring a solid stream of BrofistCoin back into the game which would allow us to transfer it back to the players again making the rewarding process economically viable in the long run.
Please note that the economics of this have not yet been thoroughly thought through as this would require some form of a community vote from the players themselves.
PewDiePie’s non-involvement and a disclaimer:
BrofistCoin is a fan-made project. We are not working with PewDiePie and we have never been in contact with him although we have tried to reach him numerous times before.
The private keys for the PewDiePie’s BrofistCoin wallet mentioned above are currently under my possession, but should Felix ever be interested in claiming these funds I will release the private key to him immediately. After all it was his idea that started it all and even though it was just a joke, BrofistCoin has grown to be one of the biggest ERC20 tokens out there in terms of transaction volume.
We never encouraged anyone to get the airdrop even though it was free which shows just how powerful his reputation is within the internet community. People still wanted BrofistCoin even though it was essentially a useless token (we never did promote it to be anything other than that) and some have even stated that because of this it is “more legit than all the other ****coins out there”.
I’m more than happy to bend the knee should the Meme Lord ever be interested in taking over this community driven project and lead the way towards an epic and decentralized future in where memes are not banned and the copystriking problem is nothing more than something to laugh about in a Meme Trading Cards game.
Current state of development:
I would like to stress the fact that just a year ago I had no experience in developing anything on Ethereum. The project has been more of a hobby for me because I am deeply fascinated about the potential that Ethereum and DApps have to offer to the world and I would definitely want to be included in the decentralized revolution that’s upon us in one way or another.
That said, we have a rough mockup of the the game available as a playable demo. It has nothing to do with the blockchain or smart contracts as of yet. Interested parties can however try out the game right now just to get a general feel for the game mechanics.
Ideally this game would run on its own sidechain and I have been looking into the Loom Network's SDK, but unfortunately, even after following their tutorials and guides, I have been unable to successfully run the sidechain locally. I'm not sure what I am doing wrong, but I'm looking forward for new and improved documentation from Loom Network in the near future.
I have also been reading up on peer-to-peer solutions and I experimented with a library called PeerJS, but the whole peer-to-peer networking aspect is still confusing to me. Perhaps this would also easily be solved with a sidechain implementation.
For now I have started working on the smart contract that will be responsible for the training and leveling of cards, but there is currently no front-end for any of that. It will take a lot of fine tuning to get the initial concept game out on testnet and we don’t yet have an ETA for any of this.
I am pretty confident that the idea for the game has at least been thought out well enough. Other than that it's still a long way from becoming a reality.
Most of the work so far has been done by me alone in my spare time while having to read countless guides, documentations and tutorials on how to build smart contracts and DApps in the first place. What I’m trying to say is, if we could have volunteer developers join our cause, this would all be done a lot faster and more efficiently.
Hey, thanks! Yeah I got the account back, but it was only temporary. Someone from Github emailed me and told me it was a mistake and can sometimes happen. And now it just happened again lol. This time I'm not even sure why because I didn't update/submit anything during the period.