Game

(Redirected from Universes)
This page is about the entity containing multiple places. For the global variable game used in scripts, see API:Class/DataModel.

At one point, a game in Roblox consisted of one place. Roblox would make copies of this place once it got filled with players so any number of people could play at once, but there were still restrictions on the size of a place. With too many parts a place could slow down, which limits the scale and detail of the environments players could explore.

While this article refers to it as a game, more people call it a universe, which is also correct. Both names can (and are) used by both players and Roblox APIs.

Games now can consist of multiple places. Moving players between places in a Game is easy, meaning developers can make much larger worlds. For example, imagine a RPG with a hub town where players start. That town could be surrounded by different areas (such as caves, forests, dungeons), each of which is a place. TeleportService allow for easy transport between each of these places.


Persistence[edit]

A key part to the new Game system is persistence. For a while, Roblox has had the concept of Data Persistence, which could save player information in a place. However, this information was not carried over when moving between places. To solve this, games have a feature called Data Stores, which can save information in a universe and can be accessed from any place in that universe. If your game tracks information such as the experience of a player, or certain checkpoints they have reached, that can be stored in a data store and accessed from any other place they teleport to in your game. Moreover, information in data stores are not player specific. With data stores, a developer can store and access any data they find useful (such as top player scores, number of times a boss has been defeated, etc).

How to Use[edit]

While multi-place games allow for vast variability in how places are constructed and organized, they all will share several features:

Start Place[edit]

Each game needs a Start Place. Anyone who enters your universe will first be brought to this place. From there, you can provide teleports to any other place in your game. By default, whenever you publish a place to Roblox that place will become the Start Place of its own game. This place needs to be Active.png, or else players will not be able to enter the game.

Other Places[edit]

CreatePlaceConfigure.png

A game can have any number of other places in it. Any place that you have created can be added to your game. These places do not need to be active, so even non-Builder's Club members can create a game with multiple places (as long as the Start Place is active). It is important to note that these places will actually be used as templates for the games. When you want a new instance of a place in your game, you will make a copy of the place which players will then be able to teleport to. The reason for this is that the state of these places can be changed and saved. For example, if you provide a place where a player can build a house, you want that player to always have access to what they built, but you want new players to go to a fresh instance of the place.

To allow a place to be used as a template place in your game, you must set a flag in the configurations. Log into Roblox and click on the Develop tab. Then, select Places from the list on the left. This will open a list of all the places in your inventory. Click on the Configure PluginEditButton.png button to the right of the place you want to use as a template and then select Games on the left. You can then set whether the place can be used as a template and if the place can be saved.

See CreatePlace and SavePlace for more information.

Managing Places in a Game[edit]

Game-and-a-Place.png

You can change the Start Place or add Other Places in a game on the Roblox website. First, log into Roblox and click on the Develop tab. Then, select Games from the list on the left. This will open a list of all the places in your inventory. You should see the current start place under each of the games listed. Clicking on the Configure PluginEditButton.png button to the right will allow you to edit the information about your game. The Basic Settings tab will allow you to change the name of the game. The Places tab will allow you to change the Start Place, as well as remove and add other places. The Created Places tab lists all of the specific instances that have been created in this game.

Persistence[edit]

Saving data in your game is achieved with Data Stores. This allows your game to remember information between places and even between play sessions. A Data Store is essentially a long list of information. Each entry in the list has a key and a value. The value is the information you want to store (such as how much gold a player has, or whether the player has defeated a certain boss), and the key is a simple name you will use to look up that information. You can have any number of data stores in your game, each of which can be accessed at any time by any place in the game. There is also a special kind of Data Store called an Ordered Data Store which allows easy access to a sorted list of integers which can be used to implement leaderboards or other similar features in your game.

See Data Store and Ordered Data Store for more information.

Teleport[edit]

Moving players between places in your game is achieved through the Teleport Service. See Teleport Service Guide for more information. CreatePlace and SavePlace also has a useful example.

Sample Place[edit]

A sample place showing a simple implementation of multi-place game is live on Roblox here: [1]

The place used as a template place in the game can be viewed here: [2]

Neither place is code locked, so please feel free to view the places in Studio to learn more about how to make games with multiple places.

See Also[edit]