Giter Site home page Giter Site logo

hemengtingyaodi / explorer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from decentraland/explorer

0.0 0.0 0.0 281.4 MB

๐ŸŒŽ Explore Decentraland from a web browser

Home Page: https://explorer.decentraland.org

License: Apache License 2.0

Shell 0.06% C# 59.75% ShaderLab 1.12% JavaScript 7.61% HTML 0.54% HLSL 0.54% Dockerfile 0.04% Makefile 0.10% TypeScript 24.59% CSS 0.95% C 0.03% GLSL 4.68%

explorer's Introduction

Decentraland Explorer

This is the decentraland explorer official repository.

Before you start

  1. Contribution Guidelines
  2. Coding Guidelines
  3. Code Review Standards

Running the Explorer

Main Dependencies

This repo requires git lfs to track images and other binary files. https://git-lfs.github.com/ . So, before anything make sure you have it installed by typing:

git lfs install
git lfs pull

Debug using Unity only

Why you should care

Take this path if you intend to contribute on features without the need of modifying Kernel. This is the recommended path for artists.

Steps

  1. Download and install Unity 2019.4.19f1
  2. Open the scene named InitialScene
  3. Within the scene, select the WSSController GameObject.
  4. On WSSController inspector, make sure that Base url mode is set to Custom and Base url custom is set to https://play.decentraland.zone/?
  5. Run the Initial Scene in the Unity editor
  6. A browser tab with explorer should open automatically and steal your focus, don't close it!. Login with your wallet, go back to Unity and explorer should start running on the Game View.
  7. As you can see, WSSController has other special options like the starting position, etc. You are welcome to use them as you see fit, but you'll have to close the tab and restart the scene for them to make effect.

Troubleshooting

Missing git lfs extension

If while trying to compile the Unity project you get an error regarding some libraries that can not be added (for instance Newtonsoft Json.NET or Google Protobuf), please execute the following command in the root folder:

git lfs install
git lfs pull

Then, on the Unity editor, click on Assets > Reimport All


Debug using Kernel only

Why you should care

Kernel mostly takes care of scene code execution and sandboxing, communication with catalysts, external services, comms, etc. If you want to delve into any of this, you may want to follow these steps and don't bother with the Unity installation.

Steps

Make sure you have the following dependencies:

  • Latest version of GNU make, install it using brew install make
  • If you are using Windows 10, you must enable the Linux subsystem and install a Linux distro from Windows Store like Ubuntu. Then install all tools and dependecies like nodejs, npm, typescript, make, et cetera.
  • Node v10 or compatible installed via sudo apt install nodejs or nvm

IMPORTANT: If your path has spaces the build process will fail. Make sure to clone this repo in a properly named path.


When all the dependencies are in place, you can start building the project.

First off, we need the npm packages for website and kernel. In most of the cases this should be done only once:

cd website
npm install
cd kernel
npm install

By now, you can run and watch a server with the kernel build by typing:

make watch

The make process will take a while. When its finished, you can start debugging the browser's explorer by going to http://localhost:3000/

Note that the Unity version used by this approach will be the latest version deployed to master branch. If you need a local Unity build, check out the advanced debugging scenarios.

Update local renderer build version

The unity build used when accessing through localhost can be changed with several commands:

  • make update-renderer downloads the renderer build for the current branch (or master branch if there is no current-branch build yet) and installs it, overwriting the previous build.
  • make update-renderer-master downloads the renderer build for the master branch and installs it, overwriting the previous build.
  • make watch triggers a make update-renderer during its local server startup process.

Keep in mind that a make watch should be run and keep the server up before updating the local build, otherwise it will be replaced by the make watch command.

Run kernel tests

To see test logs/errors directly in the browser, run:

make watch

Now, navigate to http://localhost:8080/test

Troubleshooting

Missing xcrun (macOS)

If you get the "missing xcrun" error when trying to run the make watch command, you should download the latest command line tools for macOS, either by downloading them from https://developer.apple.com/download/more/?=command%20line%20tools or by re-installing XCode


Testing your branch using automated builds

When any commit is pushed to a branch on the server, a build is generated and deployed to:

https://play.decentraland.zone/branch/<branch-name>/index.html

If the CI succeeds, you can browse to the generated link and test your changes. Bear in mind that any push will kick the CI, and there's no need to create a pull request.


Advanced debugging scenarios

Debug with Unity Editor + local Kernel

Why you should care

You may want to use this approach for any features that need both Kernel and Unity modifications, and you need to watch Unity code changes fast without the need of injecting a wasm targeted build in the browser.

When the steps are followed, you will be able to test your changes with just pressing the "Play" button within Unity. This will open a tab running the local Kernel build and Unity will connect to it using websocket.

This is the most useful debugging scenario for advanced feature implementation.

Steps

  • Make sure you have the proper Unity version up and running
  • Make sure you are running kernel through make watch command.
  • Back in unity editor, open the WSSController component inspector of InitialScene
  • Make sure that is setup correctly

Debug with browsers + local Unity build

Why you should care

Use this approach if you want to ensure your Unity modifications run well in the wasm targeted unity build, but don't want to wait for the CI to kick in. This is also useful for remote profiling.

When the steps are followed, you will be able to run the local Unity build by going to localhost:3000 without the need of CI.

Steps

  1. Make sure you have the proper Unity version up and running
  2. Make sure you are running kernel through make watch command.
  3. Produce a Unity wasm targeted build using the Build menu.
  4. When the build finishes, only copy all the files with the unityweb extension to static/unity/Build folder within the kernel project. Do not copy the UnityLoader.js and unity.json files.
  5. Run the browser explorer through localhost:3000. Now, it should use your local Unity build.
  6. If you need a Unity re-build, you can just replace the files and reload the browser the without restarting the make watch process.

Technical how-to guides and explainers

For more advanced topics, don't forget to check out our Architecture Decisions Records (ADR) repository.

Copyright info

This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.

explorer's People

Contributors

pravusjif avatar eordano avatar pbosio avatar moliva avatar ajimenezdcl avatar nchamo avatar pablitar avatar sandrade-dcl avatar menduz avatar rominamarchetti avatar d4rwinss avatar fmiras avatar javiermaria avatar oozakmckrackenoo avatar 2fd avatar dependabot[bot] avatar kuruk-mm avatar matiasjaure avatar caminoezequiel avatar landeplage avatar leohgc avatar marcosnc avatar madrex avatar hugoarregui avatar nearnshaw avatar nachomazzara avatar belohlavek avatar matiasbargas avatar endel avatar maraoz 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.