Categories
Advanced Tutorials

Packages, migrating level components from one game to another

Preface

Unless you are developing a very small and basic game, you will quite often reach a point of complexity in your game’s setup that requires a shift in the way you build it. The ability to split your game in smaller pieces or components, that can be developed and tested separately can help a lot with reducing that complexity. Crayta provides a powerful feature that allows you to do this, called packages.

In this tutorial we will explore how we can use packages to migrate components from our game, like voxels and templates, to another game.

In Unity there is a similar tool that implements this concept of packaging parts of your game to be used in another scene or game altogether, called Packages as well.

You are able to create Packages that contain models, textures, prefabs etc, export them and import them in another project.

Unity provides an Asset Store where users can publicly share packages.

Packages

In Crayta, at any point, you are able to create new packages that contain any number of valid assets. Assets that can be included in the package are:

  • Voxel Meshes
  • Scripts
  • Widgets
  • Templates
  • Worlds
  • Other packages (can be referenced as dependencies)

Core Crayta assets like Meshes or Sounds can’t be added in a package directly, although they can be part of a Template or World asset which can be added.

All new packages created are made available to all of your Crayta projects via the Library. When you are creating a new package you can make it public which in turn will make the package available not only to your projects but to all user created projects.

Packages Library

In Advanced Mode under the Library tab you can see a list of all the packages available to your project. Those include packages that have been installed from the Crayta library and those created in this project.

From here you can explore the contents of each package, review it, add it to your favourites and also update a package to its latest, if available, version.

Creating a Package

Clicking Create New Package will open the relevant window to start creating a new package.

There are several fields available here to provide a name, description, optional tags etc. for the package with the most important field being the Assets drag and drop zone. There you can drag and drop any valid asset from the Library window to be included in the new package.

You can add as many assets as you like this way in the package, and they will all be listed in the Assets list.

You can also drag and drop other packages to the Package dependencies field to be included here and Crayta will automatically add them as a dependency. This means when you are importing this package to another project, Crayta will make sure to download and install any other package required as a dependency.

Hitting Create will finish the creation process and make this package available in Crayta’s Library.

Importing a Package

The Crayta Community tab will list your newly created package allowing you to download and install it to any other project.

By doing so the contents of the package will be made available in the project’s Library. A special icon indicates that this asset is part of an installed package.

You can now use this asset much like any other asset included in your project.

That way packages become a powerful tool to share components between games.

You can use this feature to split the development of your game in components that can be easily developed and tested separately and when ready incorporated back to the original game.

You can also have templates used in one game migrated and reused in another game. 

Crayta users can make their packages public and share them with other users building games.

Updating a Package

At any point you can edit any of your packages to push changes to existing assets or add new ones.

To edit a package you start by locating it in the Packages library window and clicking edit.

This will bring up a window similar to the package creation window, in which you may use a similar method to edit the package.

When finished, clicking Update will update the published the package with any changes you have made. Any projects using this package will show an active Download button which users may then click on to download the newest version of this package.

By clicking this button the latest version of the package will get downloaded and the included assets will be updated.