Introducing the SDK 6.0 Beta
Say hello to better audio, larger parcels, cooler animations, and more with Decentraland’s latest SDK
We’re proud to unveil Decentraland’s SDK version 6.0, the latest beta release of the tools you need to build scenes for Decentraland. This release comes with a lot of exciting new features, including larger 16m x 16m parcels. We’ve also introduced more robust support for animations, audio, textures, and many optimizations that will help your scenes (and the Decentraland platform) scale better.
If you’ve been following Discord discussions and Agora votes, you’ll know that we’ve been making a significant change to how parcels are sized. With this release, each parcel in Decentraland now measures 16 meters x 16 meters (as opposed to the previous 10m x 10m format).
This parcel size increase is a result of a community poll. Check out an overview of the poll and see the final results here. Voting took place in Agora, you can read more about it in this blogpost.
Side-by-side size comparison with current 10m x 10m parcel on the left, and 16m x 16m on the right.
If you own any LAND, this means you now have significantly more surface area (156% more, to be exact). If you’ve been building scenes for that LAND, this also means you have a lot more space to work with. You don’t need to redesign the layout of everything right away, if you prefer you can always just add a simple placeholder like a natural feature or simple structure to help fill in the unused space.
Keep in mind that scene limitations per parcel haven’t changed.
An improved audio engine
Version 5.0 fell short when it came to handling sound in scene, it was very limiting in what you could do with audio, and using it required getting into asynchronous events, which is a fairly advanced and cumbersome concept that doesn’t make for a good developer experience.
With the SDK 6.0 we can use sound in a faster and more intuitive way! You can now add multiple sounds playing at the same time in your scene, and each one can come from a distinct location in the scene. All you have to do is add a
SoundSource component to an entity, and you make that sound source play an audio clip.
More robust animation handling
This release includes several improvements to how animations are handled. You now have an easy way to reset or stop animations in an entity, which was often needed to make a 3D model return to its original pose.
We also introduce the “Animator” component as a separate component from the “GLTFShape” component. By keeping animation functionality separate from the 3D model itself, we allow you to reuse a single 3D model on various entities while keeping each of these entity’s animations independent. By reusing the same 3D model like this, you can often make big improvements in performance.
We also added an event that is triggered whenever an animation finishes playing. We realized that this was sometimes quite necessary to time different events. For example, if you want an NPC to play a “die” animation and then disappear from the scene, you can use this event to make sure that the entity is only removed after the animation has finished playing.
6.0 also adds support for more types of animations. Previous versions only supported skeletal animations, or animations that relied on a series of “bones” to guide the movements of the mesh. 6.0 now supports non-skeletal animations, where the vertices of the mesh can change position independently. This is super useful for simple animations, like opening or closing a door.
A more robust way to handle textures
6.0 introduces the
Texture component, which can be used to set an image as a texture that can be applied to primitive shapes. This approach works better than setting a texture file on a
Material component (as previous SDK versions did), as it exposes new settings that can help you fine tune and optimize the texture. It also allows you to reuse the same texture on different materials, setting different properties for each, such as alpha transparency, roughness, or bump-textures.
Read more about this in the documentation.
You can now emit and catch your own custom events in your scene by using simple methods that are part of the SDK. This allows you to write scenes that follow a cleaner pattern, with parts that are decoupled from each other.
For example, if you want a score-board to update the player’s score every time that he picks up a coin in your scene, you could have each coin emit a custom “addPoint” event. Then you could have a listener to catch all instances of this event, and add to the score every time.
Read more about this in the documentation.
Easier scene sharing
Metamask is no longer needed to preview scenes that don’t use Web3. This makes previews of your scenes much easier to share with other people! Now they just need to open the link on any browser, and won’t need to have any special extension installed to see it.
The release will also include support for Now 2.0, GitHub pages and Amazon S3. This, together with the ability to share scenes that don’t need Metamask signing makes preview content a LOT more shareable.
- This release optimizes much of the code that runs in the backend of the Decentraland platform. This should make more demanding scenes run a lot smoother in your browser.
- Billboards are now easier to use! Setting an entity to behave as a billboard makes it rotate to always face the user. This is typical of early 3D games, where most enemies and entities were 2D planes that always faced the user. The
Billboardcomponent is now separate from other components and is used to configure this behavior. Learn more in the docs!
- The new
OnPointerDowncomponent is similar to
OnClickdeals with a complex event that involves both the pushing down of a button and then pulling it up,
OnPointerDownjust deals with the pushing down of the button. This event is also a lot more versatile, as the event data comes with a lot more information, including ray distance, position of the user, and the name of the specific mesh in the 3D model that was clicked.
- Some of the syntax used to add, remove and check for components was changed for better clarity. For example
- To check if a 3D model is within the scene bounds, the scene now looks at the model’s bounding boxes instead of the vertices themselves in the model. This brings a significant improvement in performance, as less coordinates need to be checked. However, make sure that your 3D models don’t have any empty bounding boxes that extend beyond the space the model really occupies!
- We changed how we set the rotation of all 3D models in a scene to be more consistent with more widespread practices in the industry. All 3D models are now rotated 180 degrees along the Y axis. This should make it easier to import external 3D models into Decentraland.