ROBLOX Game Development/ROBLOX
ROBLOX is a user-generated gaming site. This means that users can make games which other users can play. ROBLOX allows you to use their game engine and scripting API to create games of all kinds that other people can play. The games are in 3D and use building blocks that could be accurately compared to Lego blocks. These blocks can be customized, resized, positioned and manipulated using the studio. Games can also contain various other objects, including particles (smoke, fire, etc) and graphical objects (text labels, buttons, etc), and users can write scripts to add more functionality to their games.
Creating an account 
You will need an account to create games and use the website. If you don't have one yet, you can create one easily. First, you need to navigate to the following URL with your web browser: https://www.ROBLOX.com/Login/Signup.aspx. If you have never used the site before, you should explore around it enough to be able to find your way on it when you'll need to. You should also play some places (games on ROBLOX are frequently called "places") to see some examples of what can be done on ROBLOX. You will need the ROBLOX client to play games (it can be downloaded on the site by clicking on any place's play button).
ROBLOX was created by David Baszucki and Erik Cassel in 2005. The name is a combination of the words "robot" and "blocks". It started with only some hundreds of users and, today, it has many millions of users, and it is still growing. This book will cover many features that were added to the game engine and scripting API over the years since ROBLOX's creation, but it will be impossible to cover them all because of their number.
The website 
This book will not describe the entirety of the ROBLOX website or even most of it, but only what is necessary to start working on creating games. You are encouraged to explore the rest of the website yourself. You can navigate through the site using the menu bar at the top of the page.
You can see your places on your profile, which you can find by clicking on the profile link in the menu. Unless you upgrade your account to a premium membership, you can only have one place (you don't need more than one place or any of the premium features to complete this book). You can also find your places on the places page or on the build page.
ROBLOX Studio 
The ROBLOX Studio, which should have been downloaded on your computer when you installed the ROBLOX client, is a tool used to create ROBLOX places. Once opened, it should display a page on the ROBLOX website. You should log in from that page (it is not necessary to log in to use the studio, but some features require it). Once logged in your account, you can open a new place by opening the File menu and choosing New. You can also edit one of your current games by browsing to the game's page on the website and clicking on the game's edit button.
If you can't find a panel, open the View menu and click on the corresponding button to make it visible.
The game view displays the current game environment. When you open a new place, it should look like an empty sky and be in the middle. It will display your game in the same way as the players would see it when playing. You can move the camera by using the arrow keys.
The explorer panel, commonly called "explorer", is a panel displaying all the objects currently in the game in the form of an hierarchy. Clicking on an object in the hierarchy will select it. An object that is included in another is called a child of that object (the terrain object is a child of the workspace) while an object that includes another object is called the parent of that object (the workspace is the parent of the terrain object). An object can have many children, but can only have one parent.
You can perform many actions on an object by clicking on the corresponding button in the object's context menu (which is shown when right-clicking on the object). You can also move objects by dragging them into another object (some objects cannot be moved).
The property panel is a panel displaying the properties of the object that is currently selected. Properties are values that you can modify to change the behavior of the object.
There are many object types. These are called classes. Not all classes have the same properties, however, all have certain properties in common. The ClassName property is common to all objects, and its value is the name of the class of the object. For example, the class of a part would be "Part". The Name property is also common to all objects, and its value is the name of the object. Each object needs to have a name. The Parent property is yet another property common to all objects, and its value is the object the current object is included in.
The toolbox is a panel allowing you to insert models fabricated by other users. These models, also called "public domain models" or "free models" can be searched for with the toolbox. There are also models featured by ROBLOX. Your own models (you can publish your own models for other people to use) are also shown in the toolbox.
The basic objects panel is a panel allowing you to insert objects into the game hierarchy by double-clicking on the item's name. The object will be inserted in the object that is currently selected. The panel will display the available items in columns. If the checkbox is checked, it will select the object automatically after it is inserted. You can also search for a specific object using the search bar at the top of the panel.
The command bar is a toolbar that can be used to run short lines of code. It is frequently used with the output to see the result produced by a certain piece of code. It is also frequently used to automate tasks in your game or to do things that cannot be done with the studio's interface.
The output is a panel that displays output generated by scripts, as well as warnings and other information from the engine. It is an essential tool for finding errors in scripts and correcting them. It can also be used together with the command bar to execute code and see the result.
The script performance panel is a panel that displays information concerning the performance of the scripts running in the game. Scripts labelled as "[Unknown]" are usually either core scripts (internal scripts used by ROBLOX) or removed scripts, so they can be ignored. While the script performance panel isn't frequently used, it can help identifying scripts that are expensive in performance and it can be useful when evaluating the performance of a script.
The diagnostics panel is rarely used, but it is useful to know about it. Most of the information in it is very technical and useless to the average user. It can tell you the number of parts in the game, the number of connections handled by the physics engine, the frames per second (FPS) and some other things, but this information will rarely be needed.
Standard toolbar 
The standard toolbar can be used to perform various actions. The buttons in the first section of the toolbar can be used to create, open and save files. The second section can be used to cut, copy and paste game objects (or text in the case of a script). The third section can be used to undo or redo actions. The fourth section can be used to group or ungroup selected objects into models. Finally, the fifth section can be used to tilt, rotate or change the height of parts.
Camera manipulation 
The camera may be hard to get used to for a person who has never used it before. It is possible to unzoom with the mouse wheel or the I and O keys. The camera can be moved forward and backwards by using the up and down keys or the W or S keys. It is possible to rotate the camera by right-clicking and dragging the mouse.
There is also a toolbar for manipulating the camera. The camera toolbar, illustrated above, can be used to manipulate the camera. The two first buttons can be used to pan the camera left or right, the two next ones can be used to tilt it up or down, the two that follow can be used to zoom in or out and, finally, the last two ones can be used to zoom into the currently selected part or to zoom to the center of the currently selected part.
Game hierarchy 
The game hierarchy is the hierarchy of objects in the game. It can be seen and manipulated through the explorer, as explained above. Top-level objects (objects that have no visible parent in the explorer) are called services. Not all services are shown in the explorer (in fact, many classes are hidden by default).
The workspace is the place where all the scripts (the objects that allow you to run code in your game) and the visible parts (parts are also called "bricks" or "blocks") in your games are located.
The Players service is the place where Player objects (objects that represent players) will be located. You don't need to worry about this service right now, as you will only use it when writing scripts.
The Lighting service is the place where skyboxes, which give a different appearance to the sky, are stored. It also carries many properties that can be modified to change the lighting of your place. You are encouraged to experiment a little with these properties.
The StarterGui service contains GUIs, 2D elements that you can put in your game to create menus, buttons, etc. The GUIs contained in this service will be given to players when their character spawns. Without scripts, not much can be done with GUIs, so this book will not talk again about them until later, when we get into scripting.
The StarterPack service contains tools. Tools are used by players to do things. For example, a sword would be used to attack other players, a key would be used to open a door, etc. These tools will be given to players when their character spawns. Again, without scripts, you can't do much with tools.
The ROBLOX studio offers many ways to test games that are built with it. When a game is being edited using the studio, it is in an idle state. This means that the physics are disabled and that scripts are not running. It is possible to run the game by clicking the run button, which is the first button in the toolbar shown above. This will enable the physics and make all scripts run. The game can then be stopped by clicking the stop button, which is the second button in the above toolbar. The reset button can be used instead of the stop button to reset the game to its previous state and stop it.
Often, these will not be enough, and, instead, testing in-game will be necessary. For this, there are three options. The first is to test the game online. Unfortunately, this requires to publish the game online and to play it, which can take some time and does not give you access to an output and all the debugging tools available in the studio.
The second option is to use the "play solo" testing mode. Testing modes are available in the Tools menu, in the Test section. The "play solo" mode will create a pseudo game environment with the output and the full studio. It gives the user a character and runs the game. However, this testing mode has many differences with a real game environment and, sometimes, scripts will not work in it or, worse, only run in it (which happens often and really makes finding errors painful).
The third option is to use the pseudo server testing mode (which corresponds to the "start server" option in the menu), which creates a pseudo server on your computer. It then allows you to create players (using the "start player" option). It will also give you full access to the studio and, unlike the "play solo" mode, give you a normal game environment. However, some features like badges or data persistence (both will be explained later) can still not be used in it, and using it takes more time than the "play solo" mode to use.
You will probably not need to use any of these testing features until you start writing code and encountering errors.
Saving games 
The game currently opened can be saved either by using the standard toolbar or the File menu. Games are saved with the '.rbxl' extension and use an XML-based format. They can be opened again by using the open button in the File menu or the standard toolbar. Files saved on a user's computer or created in the studio can be uploaded to the website with the "Publish to ROBLOX..." option in the File menu. Games opened directly from the website will prompt the user to save before closing.
Building, on ROBLOX, is the art of putting parts together, manipulating them and customizing them. The studio offers many tools to facilitate this process. By being able to change the size, position and appearance of parts and putting them together, it is possible to build almost anything. From small buildings to very detailed rooms and to complex mechanisms, it is possible to create a lot of things in ROBLOX.
Models are used to group together parts, scripts and other models. They are indispensable for organization. A big game without any organization can quickly become very hard to maintain, so you should always use models to organize objects in your game. When many objects together form something bigger, they should be grouped together (a bed, a house, a car, etc). Parts can be grouped and ungrouped by using the explorer's context menu or the group and ungroup buttons in the Format menu (as well as the corresponding keyboard shorcuts). You can also use the corresponding button in the Format menu to select all the children of a model, which is very useful in certain cases.
For example, suppose you were building a tower, like the one on the right. Suppose it had a door and stairs to get to the top. You could group the parts that form the stairs together and do the same for the parts that compose the door. You could group the parts that compose the ramparts together and you could group all of the rest into a model called 'Walls'. Then, you could group all of these models together and call that model 'Tower'. The place would then surely be better organized than it would be if you had just kept all these parts scattered around without any organization!
Manipulating parts consists of moving, resizing and rotating them. In the studio, manipulation of parts is usually done by using the toolbar shown above.
- The first tool can be used to select parts by clicking on them and to move them, by dragging the mouse once they are selected. Parts can also be selected and dragged by using any of the other tools.
- The second tool can be used to move parts. It works like the first, but also shows dragging handles, which allow you to move a part on a particular axis.
- The third tool can be used to change the rotation of parts. This one is a bit harder to use, but it should still be easy: just use the handles to change the rotation of the part.
- The fourth tool can be used to change the size of parts by using the handles and dragging them, the same way as you would move the part with the second tool.
- The three buttons following the separator are used to change the grid used and the increment when moving, resizing or rotating the part. The best way to learn to use them is to experiment with them.
- Finally, the last button allows you to choose whether parts should be welded together when moved on other parts. If it is enabled, then parts will stick together. Otherwise, they will not stick together and they may fall when the game runs.
ROBLOX uses an unit called 'studs' for positioning and calculating distances. A stud is the equivalent of one of the squares with the R logo in them on a part. A meter is equal to 20 studs.
Customizing parts consists of changing their appearance and behavior. Like manipulation, it is, in the studio, generally done by using a toolbar, the toolbar shown above.
The first button can be used to anchor or unanchor a part. Anchoring a part means setting its position so it will not change in-game. Anchored parts can not move in-game (unless manipulated by code) and will not obey to gravity, but they will collide with other parts, meaning characters can walk on them, for example.
The second button can be used to lock or unlock a part. Locking a part makes it unable to be manipulated by building tools, both in the studio and in-game. This can be useful when you don't want players to be able to manipulate certain parts in-game (if your game is a building game) and it can also be useful to prevent yourself from moving a very important and huge part by mistake.
The third and fourth buttons are used to change the color of parts. The first allows you to choose the color in a color palette, while the second allows you to pick the color of an existing part by clicking on it.
Finally, the fifth button can be used to change the material of a part, by picking the material you want from a list of available materials. Materials can be given to give a better appearance to parts. Custom textures can also be used, though they are not very common.
Materials are very useful in games. A game made of parts containing only plastic parts does not look as professional and good as a game containing parts of various materials. There aren't many materials available, but they are enough for most purposes.
In cases where you need more complex textures than materials, it is possible to use either decals or textures. Decals are simply images that are put on parts. Textures are the same thing, but they are repeated, and they are by far better than decals for actually putting textures on parts. For example, if you want a sign that shows an advertisement, you should use a decal. If you want to put a brick texture on a wall, then you should a texture. Texture objects, like all other objects, including decals, can be found in the basic objects panel.
If you take a look back at the tower presented in the section about models, you notice it uses a lot of parts in its walls. While this isn't exactly bad, in order to make the game faster (by reducing the number of parts), it is usually better to use a texture of repeated bricks.
Terrain is a ROBLOX feature that can be used to create beautiful and complex landscapes without slowing down the game as much as using parts for that same landscape would. Terrain uses voxels, that is, cubes. These cubes can be put together and given a different appearance to.
Terrain cubes currently have a material, a shape and an orientation. Unlike parts, they are not objects, are not visible in the explorer and can not be grouped into models. However, you can have millions of them (which is not even conceivable with parts).
Terrain is currently created using the terrain toolbar, which is shown above. The first tool in that toolbar is the terrain generator, which is used to generate terrain. The two tools that follow are used to create and destroy individual terrain blocks. The next two are used to change the elevation of terrain in various ways. The following one is used to create craters. Then, the one that looks like an intersection of roads is used, precisely, to create roads. The one that follows is used to insert terrain blocks (and also other things), and, finally, the last one is used to fill an area with terrain (and it is really useful to create lakes with water). Each of these tools has its own built-in help, so they will not be described here.
Other tools 
In addition to all the toolbars, the studio also offers additional tools for building. In addition to some options available in the menu, there is an axis widget that can be used to quickly find the position of the X or of the Z axis, and there is a 3D grid that can be used to quickly find the height of the position zero and to build parts on it. These two tools are rarely used, but they can be useful to identify which axis is the X axis and which is the Z axis. All part customization and manipulation can also be done directly by editing the properties of the parts with the property panel after having selected them.
Help sources 
ROBLOX has many help sources where users can get help on various subjects. One of these is the forums, where users can ask questions. There are two help forums for game development:
Before posting in the forums, users can check many other online help sources. The first is Builderman's help, which can be found in the website's menu (the Help button). It contains information about the website, the rules and various other things.
The main information source, however, is the ROBLOX wiki. It can be found through some links hidden on the website or by pressing F1 in-game. The wiki, written by editors selected by ROBLOX staff, contains documentation about building and scripting. It is a very useful source of information and documentation for ROBLOX.