/Awesome-Repository

A collection of links to examples and tutorials to help you get started building Decentraland scenes and other content.

Apache License 2.0Apache-2.0

Decentraland Awesome Repository

Welcome to the Decentraland Awesome repository!

Here you can find content to help you build scenes for Decentraland. Here you'll find links to:

If you can think of an example that is easy to understand and covers valuable topics that aren't covered here, you're encouraged to create a Pull Request and contribute!

If something doesn’t work, please file an issue.

Key Concepts

Article Thumbnail Description
SDK functionality to a Builder scene Take an exported Builder scene and understand how to edit its code to add more functionality.
Introduction to Entities, Components & Systems A walkthrough that starts from scratch and covers most of the main ideas to understand: Entities, Components, Systems, and more.
Motion & Animations - Part 1 A walkthrough that covers animating an entity and making it move to follow a path.
Motion & Animations - Part 2 Building up on the previous part, this part covers alternating animations, and responding to the player's proximity.

For a fully comprehensive introduction, we also recommend you read the following topics from the Documentation:

See the Decentraland documentation to find more specific information about various other.

Examples

Essentials

Example Thumbnail Description
Sliding Door Use the Utils library to shift the position of a door gradually. Clicks on the door toggle it from open to closed.
Door Use the Utils library to rotate a door gradually. Clicks on the door toggle it from open to closed.
Puffer Use the Utils library to scale items and delay actions. Also include 3D models and sounds.
Button events A simple example of each way in which players can use button events to interact with the scene. Each shape's color is activated by interacting with it in a special way.
Jukebox Play different songs by pressing buttons on a jukebox.
Hypno Wheels A first encounter with Systems, Custom Components and Component Groups. Check out the related tutorial.)
Shark Animation Control animations on a 3D model. Toggle them on or off when clicking on the model.
Gnark Patrolling A character walks along a fixed path, using lerp over each segment of the path. If you approach it, it will switch states to yelling at you. Check out the related tutorial.
Hummingbirds A new bird spawns every time you click a tree. Each bird moves on its own to random positions.
Smoke Use planes to create a particle system that simulates smoke rising.
Dance Floor Combines animations, sound, and tiles on the floor that randomly change color to the beat.
Laser-Ray Casting Use ray casting to trace a line in space and check for intersections. Cubes change material when hit by the laser. They also change when being pointed at by the player.
UV Map Use ray casting to trace a line in space and check for intersections. Cubes change material when hit by the laser. They also change when being pointed at by the player.
Swimming in Circles Move a shark along the segments of a curve to swim in circles.
Block Dog A simple AI character that randomly chooses what action to take: follow you, sit or remain idle. Tell it to sit or stand up by clicking it, or tell it to drink water by clicking its bowl.
Workspaces Use workspaces to deploy multiple scenes/portable experiences at onces to see how they interact.

Game mechanics

Example Thumbnail Description
Atari Arcade Cabinets Arcade cabinets containing variations of the classic Breakout game.
Avatar Swap Swapping out the default avatar for another character model.
Beer Dispenser A beer dispenser that uses P2P messaging so that you can pour beer for yourself and friends.
Coconut Shy A coconut shy built using cannon.js physics engine.
Coin Pickup Coins are picked up once the player walk over them.
Enemy Spawner Spawning enemy spaceships from various shaped portals.
Grab Objects Click an item to hold it and drop it somewhere else in the scene.
Grab Objects Advanced Click an item to hold it in the air and carry it or toss it around the scene using physics.
Inflatable Punch Bag An inflatable-punch-bag scene built using cannon.js physics engine.
Item Pickup Various items like health packs and ammo that are picked up when players walk over them.
Key Binding Using emote events as key bindings for switching between multiple paint colors, which can be expanded for something like weapon switching.
Light Bounce Puzzle Reflecting a ray off of multiple objects at arbitrary angles.
Mirror Puzzle A puzzle game where you reflect a beam of light to a target using a series of mirrors.
Moving Platforms A simple platformer that demonstrates various platform movements using code.
NPC Dialog A UI window presents texts from an NPC, allowing you to use Mouse Clicks, E and F keys to advance the conversation or answer questions.
Portal Puzzle Using the new spawn feature to recreate a simple Portal clone.
Power Cube Using simple planes to create a force field effect that blocks the player from reaching the access card.
Push Box Puzzle Based on the classic Sokoban puzzle game where you push statues onto marked spots.
Random Noise Movement Use noise generation to imitate the kind of randomness you see in nature.
Rocket Board A rocket board that you can stand on and pilot. The board uses the cannon.js physics engine so you experience the momentum and inertia effects.
Rotating Platforms A simple platformer that demonstrates rotating various platforms using code.
Shooting Range Shoot at moving targets. Bullet holes appear in the spots where shots hit.
Shooting Range Advanced Shoot at moving targets. Bullet holes appear at whatever angle the bullet strikes the target.
Splat Attack Cover as much of the ground as you can with paint before calculating the area covered by it.
Switchboard Platforms A platform that moves when the player stands on one of the switches.
Tin Can Alley A tin-can-alley scene built using cannon.js physics engine.
Translocator Example of how to create a projectile with physics and combining that with the new spawn feature to create a translocator disc.
Zombie Attack A zombie will chase you around and attack you once it gets near.
Block Smart Wearables Players wearing smart wearables are blocked from certain aspects of the scene, to prevent unfair advantages over others.

Event hosting

Example Thumbnail Description
Video Streaming A video streamed from an external URL. The repo includes instructions for various alternatives for uploading the video content.
POAP Booth Interact with the POAP contract to mint a POAP token when clicking on a booth.
Digital Bouncer Grant admin players special abilities, including kick other players out, and displaying UI announcements.
Lazy Loading Only load certain entities when the player walks into a room or region.
Auto Dance Areas Make players dance in a loop when they stand in certain areas of your scene.
Show Management Schedule the start of a video, then sync the timing of actions in the scene to the video

Physics

Example Thumbnail Description
Bouncing Balls Kick balls around and make them bounce off each other, using the cannon.js library for physics.
Car + Physics Drive a car through piles of boxes and see them tumble down, using cannon.js for physics.
2D Bouncing Ball A bouncing ball using the box2d physics library to simulate physics in a 2D space.

Monetization & Blockchain

Crypto library

Example Thumbnail Description
Donation Box Request MANA donations to a wallet.
NFT Scanner Basic Checks whether the player owns a token from a particular smart contract before granting them permission to enter the club.
Paid Button Add a button that is only activated by paying a MANA sum to a specified address.
Paid Lever Add a lever that only switches state by paying a MANA sum to a specified address.
Wearables Scanner Fetch the list of wearables that a player currently has on. If they have something in the eyewear category, open the door for them.
Wearables Store Display all wearables on sale on L2 and purchase them in-world. You can also configure it to only display certain collections.

NFTs

Example Thumbnail Description
Simple NFT Display a 2D NFT in a picture frame.
NFT Wall Display a collection of 2D NFTs in picture frames, these swap every few seconds, taking data from a JSON file.

Interact directly with contract

Example Thumbnail Description
MANA Burning Interact with the MANA contract to burn MANA fees collected over time by the Market place in a ceremonious way.
Mint Pixelchain NFT Paint a mural made from 32 x 32 pixels. You can then mint the image as a PixelChain NFT.

Multiplayer & APIs

Hit an API

Example Thumbnail Description
Party Time Hit a world clock API to check the time, start a party if it's after 9PM.
DCL Trams Hit a world clock API to sync the position of a tram line, so all players see them on the same location. Each tram does a full loop every 3 minutes, basing its position on every frame relative to the time.
Events API Query the Decentraland Events API for any events that are currently active to display their info. If more than one, flip through them on the display.
Weather Simulation Check a weather API, then represent the weather conditions, whatever they are.

Run server-side validations

Example Thumbnail Description
Validate Player Authenticity Hit a server that validates that the player really is in Decentraland, in a specific parcel, with a recent time-stamp, and signed a message cryptographically with their ephemeral key.

Use message bus

Example Thumbnail Description
Block Fountain The cubes in this fountain have several animations that each set can play. When a player pushes a button, all players see the same animation.
Clap Meter A meter that goes up based on the number of claps from players applauding in the scene.
Piano Floor Play the keys of this piano by stepping on them. All players will hear the notes that are played.

Use an API as DB

Example Thumbnail Description
Leader Board Upload player's final scores to a server, the best ones are displayed for all to see on a board.
Guest Book API Players that sign this guest-book upload their user name and address to the server. All signatures are fetched when opening the book.
Pixel Mural Create 2D pixel art by painting tiles. Players are synced through both the messagebus and a DB in a server.
3D Voxel Art Creator Create 3D voxel art by placing cubes in place. Players are synced through both the messagebus and a DB in a server.
Zenquencer Create musical patterns that are played in sequence. Players are synced through both the messagebus and a DB in a server.

Plain WebSockets

Example Thumbnail Description
Broadcast Server (server code only) A basic server that broadcasts all messages it receives to all other players in a room.
Color Switch A minimal scene where clicking on cubes changes their color. The broadcast server syncs these changes to all other players in the same realm.
Bouncing Balls Each player runs physics client side. Websockets sends information about new forces applied to the entities. The broadcast server syncs these changes to all other players in the same realm.
Frisbee Throwing Each player runs physics client side. Websockets sends information about the throwing of the frisbee. The frisbee is hidden when picked up by a player.
Basketball Each player runs physics client side. Websockets sends information about the throwing of the ball. The ball is hidden when picked up by a player.
Discord Chat Display messages being posted to Decentraland discord server in real time inside the world

Colyseus

Example Thumbnail Description
Cube Jumper A basic server that broadcasts all messages it receives to all other players in a room.
Land Flipper Game A team game for 2 players or more, where tiles switch colors when walked on. The server keeps track of the game's state, and has the final word about when the game ends and who won.
Space Traitor A game of deceit and secret identities. One player is randomly assigned as the trator, that will work against the others to sabotage the space ship.
OSC Relay Listen to OSC messages from any source, relay them to affect Decentraland scenes in real time via a Colyseus server.

Full scenes

Example Thumbnail Description
Escape Room Tutorial An escape room full of puzzles to solve. A video tutorial series covers how to make it, starting from the essentials.
Crypto Valley Conference Center A fully equipeped venue ready for live events, with video streaming and POAP dispenser.
White Rabbit Night Club A 24/7 nightclub, with lights and smoke effects, arcade machines, and much more.
Genesis Plaza The full code used in Genesis Plaza (0,0), including all the interactive elements found there.
Soho Plaza The full code used in Soho Plaza (-75,0), including all the interactive elements found there.
Castaway 2048 A puzzle game based on 2048, where you merge similar gems into valuable ones, till you reach the value of 2048.

Smart items

This repository contains all of the smart items created and mantained by the Decentraland Foundation that can be used in the Builder:

Smart Items

Feel free to reuse and adapt the code and models in these to create your own smart items.

Learn more about how to create custom smart itmes in the SKD documentation

Libraries

Article Description
ECS Utils A very handy collection of common tasks made simple. Gradually move, rotate or scale over time. Add trigger areas, delay an action, run an event periodically, and more!.
UI Utils UI Prefab components and functions for common game UI elements. Show health-bars, labels, counters, icons, prompt windows, NPC dialogs
NPC Utils Tools to easily create non-player characters (NPCs) that you can have a conversation with. They can ask quesions, play animations, turn around to always face the player, etc
Crypto Utils Several functions to allow you to easily carry out operations with MANA, other currencies, NFTs, the Marketplace, sign messages or anything that involves smart contracts.
L2 Utils Several functions to allow you to easily carry out operations with MANA in a Layer 2 Ethereum network, with significantly reduced gas fees and transaction delays.
Authentication Middleware To use on servers that interact with Decentraland scenes, to validate that a request truly comes from a real player that is in fact in Decentraland.
Scene Object Model (SOM) A Scene Object Model (SOM) file lists all of the GLTF or GLB models to load into a Decentraland scene. This module contains a SceneObject data structure used to define the models and their positioning in the world, and a ModelLoader class that handles the loading and positioning at runtime.
Noise Utils Tools for generating semi-random noise based on the Perlin and Simplex algorithms. These generate random sequences of values similar to the kind of randomness seen in nature.
DCLDash A suite of entities, debug utilities and helper functions that will speed up your decentraland SDK development.

Note: To update these libraries from versions older than February 9th 2021, see the migration guide

Tutorials

Video tutorials

Find a full playlist of all Decentraland video tutorials here:

Youtube Playlist

Escape Room Video Tutorial Series

This series of 5 minute videos covers a number of essential concepts, game mechanics and coding best practices. They take you through the whole process of building a full escape room game.

See the videos

Tip: The videos are presented in the above link together with written accompanying content, including all the code in case you want to copy and paste parts of it.

The full code from the tutorial is available in this repository.

Multiplayer & APIs

Article Description
Servers - Part 1 Send requests to an API to fetch data.
Servers - Part 2 Launch your own server on Firebase to handle HTTP requests from your scene and store data in a DB.
Servers - Part 3 Build a WebSockets server to handle real-time updates.

Other

Article Description
Creating Genesis Plaza - Part 1 Tips and tricks that went into the creation of Genesis Plaza, regarding best practices and optimization.
Creating Genesis Plaza - Part 2 Guidance about several features that were first introduced with Genesis Plaza, like video and audio streaming, teleports, external links, etc.
Creating Salmonomicon Tips and tricks that went into the creation of Salmonomicon (-50,0). Mostly related to UI and ray casting.

Guest Posts

Article Description
Using the UI A walkthrough by Surz about how to create a UI for your scene.
Picking & Moving Objects A walkthrough by Interweaver about how to pick up objects and place them in position, snapping to a grid.
Sprite Animations A walkthrough by Brent Greyling about creating an animated fireplace using 2D sprite images.
Using the Blockchain - Part 1 Part 1 in a series by Baus that goes from scene building essentials to using smart contracts.
Using the Blockchain - Part 2 Part 2 in a series by Baus that goes from scene building essentials to using smart contracts.
Using the Blockchain - Part 3 Part 3 in a series by Baus that goes from scene building essentials to using smart contracts.
Using the Blockchain - Part 4 Part 4 in a series by Baus that goes from scene building essentials to using smart contracts.
Placing Art NFTs A walkthrough by Holodot about how to place NFT 2D art in a scene.

3D Modeling for Decentraland

Video Description
Add a collider Add a collider to an existing 3D model, to prevent players from walking through it.
Add predefined animations Download a freely licenced 3D model and apply free animations that you can download from Mixamo to it.
Create animations in Blender Download a freely licenced 3D model, import it into Blender and then create an armature to manually create your own animations for it.

Copyright info

All of these scenes are open source, protected with a standard Apache 2 licence. This licence states that this content can be used freely, even commercially, as long as you acknowledge the author. See the terms and conditions in the LICENSE file.