decentraland / proposals

Review of community proposals for Decentraland's art and applications
46 stars 16 forks source link

Decentraland Client using Electron and AFrame #120

Open ethereumdegen opened 7 years ago

ethereumdegen commented 7 years ago

In order to get the ball rolling, I built a very simple prototype desktop client for Decentraland using Electron and AFrame. This has the capability to go Full Screen, be used with or without VR Goggles, and uses Javascript and HTML throughout as programming languages to make things easy for open source development. Here is the repo:

https://github.com/admazzola/decentraland-revolt-web

The premise is that a local webserver is hosted by the client which serves up the AFrame HTML (for entities) and 3D models. Events such as other entities spawning are streamed over via a WebSockets connection from the local webserver to the AFrame client which lives in an Electron environment. The next steps are to add 3D model rendering capability which is quite simple using AFrames embedded tooling for this purpose. After that, multiplayer can be realized by using a centralized server which the clients can connect to and pass player-entity data back and forth from, most likely using JSONRPC or Websockets.

All other entities will be defined in the blockchain and IPFS as per the decentraland standard whereby every 'tile' is owned by an Ethereum account and that account holder uses a smart contract to store an IPFS hash of a 'LandContentFile' in the smart contract storage in a mapping which ties to the tile hash. The 'LandContentFile' will be stored on IPFS and is simply a JSON file that contains information about what should be rendered on that tile. The Client will use an IPFS adapter to read those JSON files for every nearby tile and will spawn/render entities on those tiles as necessary. The entities will be AFrame objects; shapes or 3D models.

At that point, a nice little client will be running ! So that's the general premise. IMO this is one of the first things that has to be done but it should be done right!