Terracore - Devlog #1

terracore(63)
Published in
#hive
Words
458
Reading
3 min
Listen
Play
4y

image.png
Our Login System will be using keychain@keychain

Welcome to TerraCore, the world has been ravaged by a catastrophic event known as the Great Upheaval. This event caused the destruction of much of the world's infrastructure and natural resources, leaving humanity to scavenge for scraps in order to survive. As a citizen of TerraCore, you must mine for valuable SCRAP, which is the new currency in this post-apocalyptic world. Use your SCRAP to upgrade your land claim and defend it from other citizens who will stop at nothing to steal your valuable resources. Can you build a thriving community and defend it from the dangers of TerraCore?

Terracore is a new game that I will be solo developing on the HIVE blockchain putting together all of the things I have learned throughout my development career and using AI to handle certain parts of the project that used to to many others to accomplish. Including ART & Storytelling. I have so many ideas for this project but just wanted to start getting some devlogs out there in the hivemind to get feedback, ideas, and thoughts from others as I build this out.

Next week I will be compiling a master post about what Terracore is and the entire vision. Hopefully these dev logs will help other Unity developers thinking about building on HIVE as we need more great projects to push the space forward.

For now strap in and get ready for the ride.

image.png

The fun part today was coming up with an on chain registration system in Unity where users can send HIVE to buy and account / become a citizen in the game. The cost for this is not final and the main focus at the moment is making sure this can be registered by our smart contract and logged once complete. For that we need the action and a unique hash that we can use of the blocks are missed due to node/rpc issues, we will be able to has previous blocks and make sure it was caught /audited.

    Register: function (username) { 
        console.log("Registering user: " + UTF8ToString(username));
        //create random unique 64 bit hash with letters and numbers
        var hash = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
        var memo = "register-" + hash;
        window.hive_keychain.requestTransfer(UTF8ToString(username), "terracore", parseFloat(0.001).toFixed(3), memo, "HIVE"), function(response) {
            console.log(response);
            if (response['success'] == true) {
                console.log("Transfer successful, username: " + response['data']['username']);
            }
            else {
                console.log("Transfer failed!");
            }
        };
        
    }

This code may look strange to because it is written in as a .jslib file to be used inside of unity.

image.png

Here is what it looks like when it hits the server, adding the user to the game, storing the hash for future reference. Now the player is registered and they can enter the game.

ezgif-5-2b2c4f2b25.gif

You will now land at the player screen where you have some based stats and are starting to earn SCRAP the currency that will be used in Terracore to do most of the tasks needed.

That is it for today I hope you all enjoyed learning more about TerraCore and be sure to follow and look out for a full pust next week!

Terracore - Devlog #1 | Ecency