Giter Club home page Giter Club logo

ganft-tools's Introduction

GA-NFT Tools

This package is a collection of tools to convert WebGL games to GA-NFTs (Game-As-Nonfungible-Token). Currently, the tools only support Unity builds but the process could be adapted to support any WebGL game.

Getting started

First clone this repo onto your computer. Export your Unity build in WebGL format with compression format set to disabled. You can access this setting by selecting Player Settings->Publishing Settings->Compression Format.

Convert Game

Move your exported game into the input directory of the repo. Change into the project directory in the command line. There's an example game located in the input directory called "unitysample".

Run the command:

npm run convert -- --dir ./input/unitysample   

The output game will be placed in:

ganft-tools/converted/unitysample

Generate Game Collection

After a game has been converted, this command generates multiple numbered instances of the converted game. This command also replaces data inside the index.html file for each game instance. If you wanted to modify how each game gets outputted, look in the "generate.js" script. The generation can be configured using the fields located in "generatorConfig.js" The games will have the build directory removed by default. The build directory should be accessible at the "directUrl" specified in "generatorConfig.js". After the games are generated, upload them to IPFS and copy the CID.

npm run generate

Generate Metadata for Game Collection

NFT metadata for the generated games can be generated with the command:

npm run metadata -- -d "./generated/unitysample" -c "QmTGNaMxcfZ3ApoKUbsgFesVJh5jWhz4KQmUWB41LEwKQ2"

The "-c" parameter is the IPFS CID for the uploaded game collection. This parameter is used to generate the NFT metadata fields such as this for the image:

ipfs://QmTGNaMxcfZ3ApoKUbsgFesVJh5jWhz4KQmUWB41LEwKQ2/0/TemplateData/bg.png

The generated metadata will be in the "generated" directory inside the project folder. This metadata can then be uploaded to IPFS for ERC721 smart contract usage.

ganft-tools's People

Contributors

taylorsloan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.