<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mdichtler</title>
    <description>The latest articles on DEV Community by mdichtler (@mdichtler).</description>
    <link>https://dev.to/mdichtler</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F738823%2Fc6a0af2b-b7c7-42b0-a914-93acb22fa588.png</url>
      <title>DEV Community: mdichtler</title>
      <link>https://dev.to/mdichtler</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mdichtler"/>
    <language>en</language>
    <item>
      <title>Developing games for blockchain</title>
      <dc:creator>mdichtler</dc:creator>
      <pubDate>Thu, 13 Jan 2022 20:26:55 +0000</pubDate>
      <link>https://dev.to/mdichtler/developing-games-for-blockchain-3ema</link>
      <guid>https://dev.to/mdichtler/developing-games-for-blockchain-3ema</guid>
      <description>&lt;p&gt;Together with the boom in popularity of cryptocurrencies, new doors have opened for us, developers, to build decentralized apps and cash in on the trend.&lt;br&gt;
However many developers choose to go about it the wrong way, not doing enough research and just trying to ship the product as quickly as possible. This has to lead to the creation of many dApps as well as practically unusable games, while they sold the idea, and made money in the process, often they are unable to maintain the hype and keep the user base from rapidly declining.&lt;/p&gt;

&lt;h2&gt;
  
  
  Research for blockchain game developers
&lt;/h2&gt;

&lt;p&gt;To find out how to build your game the right way you’ll need to do enough research in the first place. Start by identifying the needs of your idea. Am I making a game that is action-packed or turn-based? Do I want to use NFTs? Do I want the in-game currency to have its token?&lt;/p&gt;

&lt;p&gt;All of these questions will guide you through your research, but most important are the questions that you’ll ask yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Axie Infinity does it
&lt;/h2&gt;

&lt;p&gt;Let’s look at a successful example of a blockchain-based game, Axie Infinity. Instead of using a public blockchain, they forked their own and built a ronin chain. Due to the low amount of validator nodes, and only their projects being available on the blockchain, it’s comparable in price to the traditional server structure. What’s cool is how they handle in-game currency and axies (game characters, think of Pokemon but in 2021).&lt;/p&gt;

&lt;p&gt;As you play the game, you can earn $SLP (Smooth Love Potion). However, this currency works just like any video game currency. Its value is stored in a traditional database, not on the blockchain. The users can claim it once every 14 days which triggers minting of the token. The blockchain subsequently rewards the user with cryptocurrency. This approach limits the stress put on the blockchain, keeping its cost to run relatively low and the transactions free.&lt;/p&gt;

&lt;p&gt;The same applies when it comes to axies (Axie Infinity’s NFTs). The gameplay aspect, such as stats, abilities, and its name is stored in an SQL-like database. The NFTs users own, are just a reference to that data and proof of ownership.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR;
&lt;/h2&gt;

&lt;p&gt;What can we take away from Axie Infinity’s approach? TLDR; when building a blockchain game, build a normal game first and add the blockchain functionality on top of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Applying the process
&lt;/h2&gt;

&lt;p&gt;Take League of Legends for example. All you have to do to migrate it to a blockchain under Axie Infinity’s model is to make an association between the blockchain addresses of the users and their in-game accounts. Then create your token and give users the ability to convert the in-game currency once every 14 days into minted tokens.&lt;br&gt;
Finally, mint NFTs with the creation of any cosmetic items (champion skins, wards, etc.) and award them to the users. This will have close to zero impact on the user experience, yet provides what most people are looking for in blockchain games. Proof of ownership, and the ability to monetize your gameplay...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://karmastudios.dev/developing-games-for-blockchain/"&gt;Read the full article here&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Axie Infinity - Breaking the market with bots</title>
      <dc:creator>mdichtler</dc:creator>
      <pubDate>Sun, 31 Oct 2021 17:21:32 +0000</pubDate>
      <link>https://dev.to/mdichtler/axie-infinity-breaking-the-market-with-bots-19gp</link>
      <guid>https://dev.to/mdichtler/axie-infinity-breaking-the-market-with-bots-19gp</guid>
      <description>&lt;p&gt;As many of us know, Axie Infinity has quickly risen to become the #1 NFT powered game in the world, with that, and ever growing market reaching $670M worth of transactions in the past month, it is also a great playground for developers to learn and practice new skills.&lt;/p&gt;

&lt;p&gt;In this article, will go over one of my &lt;a href="https://github.com/mdichtler/axie-infinity-sniper-bot"&gt;github repos&lt;/a&gt;, and learn how to setup a bot to scrape data from axie.zone (community website providing leaderboard information) and in combination with axie infinity's graphql API, find the Axies played by the top 100 players on the marketplace.&lt;/p&gt;

&lt;p&gt;While we likely are not able to find the exact Axies (same ID), we can find Axies with the same class, as well as parts, that make them practically identical in combat, allowing us to recreate the best teams on budget.&lt;/p&gt;

&lt;p&gt;If you would like to support development of this project and future tutorials, feel free to donate using Ko-Fi. &lt;br&gt;
&lt;a href="https://ko-fi.com/R5R56SOT1"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FKanlt08--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ko-fi.com/img/githubbutton_sm.svg" alt="ko-fi" width="223" height="30"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Video Tutorial
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://youtu.be/LijzwzcuIKo"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6vBc8I9k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/baDtWpr.png" alt="IMAGE ALT TEXT HERE" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Instructions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/mdichtler/axie-infinity-sniper-bot"&gt;Clone the Github repo&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Firebase account &amp;amp; Project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable Firestore&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(optional) Enable Authentication using Google.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(optional) Update security rules to enable any authenticated user to read data (this setup is assuming usage with the provided Web GUI, if used within your own project tailor your security rules to the given project).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;rules_version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'2'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="n"&gt;cloud&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firestore&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;databases&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;=**&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uid&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Within Firebase, navigate to Project Settings &amp;gt; Service Accounts, select Python and click on "Generate new private key"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rename the file to serviceAccountKey.json and import it into the project directory ./database/serviceAccountKey.json (this file is included in .gitignore)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create virtual environment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the package manager &lt;a href="https://pip.pypa.io/en/stable/"&gt;pip&lt;/a&gt; to install dependencies from requirements.txt file.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip3 &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run main.py, after script finishes, your data will be loaded into two collections, leaderboards (top 100 players at the runtime, multiple documents) and on_sale (all axies matching one of the most used axies by top 100 players, including their price, which top 100 player it matches, ID, class &amp;amp; parts, see example json below).&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Example JSON:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "player_rank": 44,
    "image": "https://storage.googleapis.com/assets.axieinfinity.com/axies/7751721/axie/axie-full-transparent.png",
    "time": {
        "seconds": 1635428026,
        "nanoseconds": 751095000
    },
    "axie": {
        "class": "Bird",
        "player_mmr": "3312",
        "player_rank": 44,
        "axie_zone_score": "Excellent",
        "title": "",
        "matching_player": "#44 youtube.com de-hi games 3312 0 0%",
        "id": "7751721",
        "__typename": "Axie",
        "name": "Axie #7751721",
        "breedCount": 3,
        "battleInfo": {
            "banned": false,
            "__typename": "AxieBattleInfo"
        },
        "parts": [
            {
                "name": "Mavis",
                "specialGenes": null,
                "id": "eyes-mavis",
                "class": "Bird",
                "__typename": "AxiePart",
                "type": "Eyes"
            },
            {
                "type": "Ears",
                "specialGenes": null,
                "class": "Bird",
                "id": "ears-peace-maker",
                "__typename": "AxiePart",
                "name": "Peace Maker"
            },
            {
                "name": "Pigeon Post",
                "__typename": "AxiePart",
                "specialGenes": null,
                "id": "back-pigeon-post",
                "class": "Bird",
                "type": "Back"
            },
            {
                "specialGenes": null,
                "type": "Mouth",
                "__typename": "AxiePart",
                "class": "Bug",
                "id": "mouth-cute-bunny",
                "name": "Cute Bunny"
            },
            {
                "type": "Horn",
                "specialGenes": null,
                "class": "Bird",
                "name": "Eggshell",
                "id": "horn-eggshell",
                "__typename": "AxiePart"
            },
            {
                "id": "tail-post-fight",
                "class": "Bird",
                "specialGenes": null,
                "type": "Tail",
                "name": "Post Fight",
                "__typename": "AxiePart"
            }
        ],
        "stage": 4,
        "image": "https://storage.googleapis.com/assets.axieinfinity.com/axies/7751721/axie/axie-full-transparent.png",
        "player_url": "https://axie.zone/profile?ron_addr=0x1b246e446336f55b4150294ccd39693fb4a8aa9b",
        "matching_axie_name": "obasan",
        "auction": {
            "currentPrice": "40000000000000000",
            "__typename": "Auction",
            "currentPriceUSD": "165.82"
        }
    },
    "currentPriceUSD": 165.82,
    "id": "7751721",
    "class": "Bird"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>react</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
