Coding Roblox Games Made Easy - Zander Brumbaugh - E-Book

Coding Roblox Games Made Easy E-Book

Zander Brumbaugh

0,0
21,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Roblox is a global virtual platform like no other for both playing and creating games. With well over 150 million monthly active users, Roblox hosts all genres of games that can be played by other members of the community using the Lua programming language. Not only can you create games for free, but you can also earn considerable sums of money if from the success of your games, and become part of the vast and supportive developer circle that provides excellent opportunities for networking in a tight-knit community.
With this practical book, you'll get hands-on experience working on the Roblox platform. You'll start with an overview of Roblox development and then understand how to use Roblox Studio. As you progress, you'll gradually learn everything you need from how to program in Roblox Lua to creating Obby and Battle Royale games. Finally, you'll delve into the logistics of game production, focusing on optimizing the performance of your game by implementing impressive mechanics, monetization, and marketing practices.
By the end of this Roblox book, you'll be able to lead or work with a team to bring your gaming world to life, and extend that experience to players around the world.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 308

Veröffentlichungsjahr: 2021

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Coding Roblox Games Made Easy

The ultimate guide to creating games with Roblox Studio and Lua programming

Zander Brumbaugh

BIRMINGHAM—MUMBAI

Coding Roblox Games Made Easy

Copyright © 2021 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Ashwin Nair

Publishing Product Manager: Ashitosh Gupta

Commissioning Editor: Jane D'Souza

Acquisition Editor: Ashitosh Gupta

Senior Editor: Sofi Rogers

Content Development Editor: Mrudgandha Kulkarni

Technical Editor: Saurabh Kadave

Copy Editor: Safis Editing

Project Coordinator: Kinjal Bari

Proofreader: Safis Editing

Indexer: Pratik Shirodkar

Production Designer: Jyoti Chauhan

First published: January 2021

Production reference: 2240821

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80056-199-1

www.packt.com

To my mother and father. You are both there to support me and you consistently inspire me to strive to be the best version of myself.

– Zander Brumbaugh

Packt.com

Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionalsImprove your learning with Skill Plans built especially for youGet a free eBook or video every monthFully searchable for easy access to vital informationCopy and paste, print, and bookmark content

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

Contributors

About the author

Zander Brumbaugh is an independent programmer, project manager, and game designer. The games he has made or contributed to have been played more than 200 million times. Zander works with members of the Roblox community and its developer relations team to promote and support the Roblox platform. He has created popular games, such as Power Simulator, Munching Masters, and Magician Simulator. With the games he has created, he has been able to put himself through college; he currently attends the University of Washington and is part of the Paul G. Allen School of Computer Science and Engineering. At the time of writing, Zander is 18 years old.

About the reviewers

Andrew Bereza is a deeply passionate strategist and problem-solver with a keen eye for identifying patterns and connections in abstract, interwoven systems. He is involved at all levels of game development, from creative direction and level design to the user interface and programming. He's a proven expert on the Roblox platform with over 10 years of experience developing on the site, including a 3-month accelerator (2017) and 5-month incubator (2018) hosted at Roblox's corporate headquarters in San Mateo, CA. His Roblox titles include 2PGFT, Miner's Haven, Azure Mines, War Games, Vesteria, and Build Island. He has a rich history of tinkering with games even before Roblox, including building custom Super Mario World ROM hacks and Minecraft mods.

Ian Hanf, also known as Hanfian on the Roblox platform, has been making games since 2012. He attended college at the University of the Pacific and pursued a 5-year master's degree in computer science with the intention of concentrating on graphics and simulations. In 2019, Ian worked on the front-page Roblox game Anime Fighting Simulator, which saw international success. Currently, Ian resides in California and is battling stage 4 brain cancer but hopes to continue making games in the future.

I am thankful to have been given the opportunity to work alongside Julius Quindipan, known as MarmDev on Roblox, and the entire crew that helped make Anime Fighting Simulator. Last but not least, I would like to thank my mom, whose career with computers inspired me to follow in her footsteps.

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Preface

Section 1: Introduction to Roblox Development

Chapter 1: Introducing Roblox Development

Technical requirements

Learning the benefits of Roblox development

Financial opportunities on Roblox

Improving professional skills

Benefits of networking

Discovering developer types

Programmers

Modelers

Builders

UI/UX designers

Gaining a perspective about your early projects

Summary

Chapter 2: Knowing Your Work Environment

Technical requirements

Traversing the Create page

Configuring Game and Place settings

The Configure Game menu

Configuring Start Place menu

Other Place options

The Library and Avatar Shop

Getting Started with Roblox studio

The File menu and settings

Movement and camera manipulation

Utilizing the Explorer

Using Studio tools

Managing the Game Settings menu

The View tab

The Test tab

Customizing Studio to aid your workflow

Taking advantage of Roblox's resources

Tutorials and resources

The Developer Forum

Summary

Section 2: Programming in Roblox

Chapter 3: Introduction to Roblox Lua

Technical requirements

Creating variables and conditionals

Data types

Setting and manipulating variables

Numbers

Booleans

Strings

Tables

Dictionaries

Vectors

CFrames

Instances

Conditional statements

Declaring and using loops

For loops

While loops

Repeat loops

Learning functions and events

Functions in programming

Recursion

Events and methods of instances

Demonstrating programming style and efficiency

General style rules

Roblox-specific rules

Summary

Chapter 4: Roblox Programming Scenarios

Technical requirements

Different script types

The Script Menu tab

Filtering Enabled

RemoteEvents

RemoteFunctions

BindableEvents and BindableFunctions

Using Roblox services

Players service

ReplicatedStorage and ServerStorage

StarterGui

StarterPack and StarterPlayer

PhysicsService

UserInputService

Working with physics

Constraints

Body movers

Adding peripheral game aspects

Sound

Lighting

Other effects

Chapter 5: Creating an Obby

Technical requirements

Setting up the backend

Managing player data

Managing collisions and player characters

Making Obby stages

Creating part behaviors

Creating rewards

Shops and purchases

Robux premium purchases

Making in-game currency shops

Preventing exploits

Setting up the frontend

Creating effects

Testing and publication

Summary

Chapter 6: Creating a Battle Royale Game

Technical requirements

Setting up the backend

Managing player data

Setting up the round system

Creating weapons

Local replication

Spawning loot

Setting up the frontend

Working with the UI

Summary

Section 3: The Logistics of Game Production

Chapter 7: The Three Ms

Technical requirements

Mechanics

Simulators

RP games

Tycoons

Minigames

Monetization

Marketing

Roblox promotion system

YouTubers

Reviewing what you've learned

Summary

Other Books You May Enjoy

Section 1: Introduction to Roblox Development

This section will introduce you to the basic concepts of Roblox development. Then we will move on to understand Roblox Studio, the type of development opportunities that exist, and what to expect from the initial projects.

This section comprises the following chapters:

Chapter 1, Welcome to Roblox DevelopmentChapter 2, Knowing Your Work Environment

Chapter 1: Introducing Roblox Development

Roblox is a massive entertainment platform like no other for both playing and creating games. With over 100 million monthly active users, Roblox has enabled both new and experienced developers to create successful games that can be played globally at no cost. With a plethora of resources and a vast and supportive community of developers from around the world to connect with, entering the Roblox game development scene is an opportunity that cannot be found anywhere else.

Before covering the technical details of working with Roblox Studio and programming in Lua, it is important that you are first familiar with what developing games on Roblox can offer you and what the day-to-day interactions with the platform typically consist of. By the end of this chapter, you will have a more comprehensive understanding of the different types of roles developers can fulfill in game projects, how becoming a Roblox developer can benefit you monetarily, and what to expect as you develop and publish your first games.

In this chapter, we're going to cover the following main topics:

Learning about the benefits of Roblox developmentDiscovering developer typesGaining a perspective on your early projects

Technical requirements

You will not need any software or additional materials for this section as it is mostly informative theory. You may find it beneficial to have access to a computer to visit some of the websites or applications discussed in this chapter.

Learning the benefits of Roblox development

Roblox has been a consistently growing platform since its creation in 2006, and in recent years, its growth has accelerated tremendously. As of 2020, more than 100 million unique users play Roblox monthly. Because of this, there has never been a better time to become a Roblox developer as there is an abundance of new players looking for an increasingly diverse variety of games from new creators.

Financial opportunities on Roblox

Perhaps one of the greatest contributing factors to Roblox's overall rise in popularity with developers is the monetary benefits that are offered. These benefits may have been one of your primary motivations to learn more about the platform, and that is to be expected. The top games on the Roblox platform are currently making tens of millions of US dollars from in-game purchases annually.

As a developer, you can earn money from your games through a process called the Developer Exchange, or more commonly called DevEx. Roblox has a virtual currency called Robux, which can only be purchased with real currency. After a player purchases Robux, the balance on their account is updated and then they can spend them freely on any game they want. When a player spends Robux on one of your in-game purchases, 70% of the Robux from that purchase will go to you, as Roblox takes a 30% marketplace fee.

The two types of in-game purchases are as follows:

Game passes: Single-time purchasesDeveloper products (more commonly called dev products): Purchased multiple times, for something such as in-game currency

You must accumulate a total of 100,000 Robux and be 13 years old or older in order to be eligible for the Developer Exchange program. In addition to sales you make directly, players of your games that have a Roblox Premium membership grant you additional Robux based on how much time they spend playing your game, though this amount is typically just a fraction of what sales amount to. Furthermore, there are some invite-only programs that allow you to sell character accessories, plugins, and more for Robux, but it is expected that these will become open to the public with time.

When working with a development team in a Roblox group, developers can be paid with Robux either directly or through a percentage of game revenue. Direct pay-outs are a simple action that can be done through the tabs of the Configure Group page and are not a recurring payment. Giving developers a percentage of the game's earnings automatically deposits that amount into their account after it pends for verification. Remember, this can only be done when a game is hosted in a group, not on an individual's profile.

Important note

It may be valuable to remember that after a player makes an in-game purchase, Roblox has a 3-day wait period before those Robux are deposited into a group or personal account in order to verify that the purchase was a legitimate sale.

More information about the Developer Exchange program can be found here: https://www.roblox.com/developer-exchange/help.

Improving professional skills

Aside from the monetary benefits of being a Roblox developer, you are uniquely enabled to enhance other skills that you may find applicable in other professional environments. Whether you fulfill the role of project manager or just an additional programmer, you are poised to develop efficient team coordination and communication skills. One of the most sought-after qualities employers look for, especially in STEM, where most work is team-based, is being able to coordinate your work in a team with clear communication. Roblox development is, in my opinion, one of the best places for prospective computer science students to get their start and learn the fundamentals of collaboration. The platform helps develop not only greater programming abilities but also a strong foundation in leadership and eventually fiscal management skills.

Benefits of networking

While working with other people is not always necessary and there have been popular titles established by single-member teams, the social nature of Roblox strongly encourages developers to coordinate with each other to create games, with each developer fulfilling one or more roles in a project. Currently, almost every game at the top of the Popular sort has been created by a team of two or more individuals. With the great success and subsequent growth of some top games on the platform, the development teams of those games have expanded to more than 20 people, though teams of that size are not yet typical.

The best way to get involved with the community and find other developers to collaborate with is through Twitter, as well as the communication application Discord. By having a Twitter account dedicated to your development work, you can post the creations you are most proud of while communicating with other, more popular developers. These new connections with other developers in the Roblox Twitter Community (RTC) may give you the opportunity to collaborate with more well-known individuals and grow your name the more you work. Discord is a communication app that could be compared to Slack. There are a variety of Discord servers that are oriented around Roblox development and are, consequently, an excellent place to show off creations, discuss your work with other members of the community, and find new individuals to direct your efforts with.

Another important type of community for developers is Roblox YouTubers. As YouTubers create content showcasing your games, an impression is made upon their audiences and, as a result, your player count will likely increase from the new publicity. Forming firm connections with these individuals may secure future promotion for your projects while also creating advocates for your work in the process. While there is not always an easy way to connect with these content creators, they often have a Discord or Twitter presence in addition to business emails where they may respond to your inquiries.

Overall, the type of networking described here is the same in many fields of work. Expanding your image and developing your identity and reputation are the most vital elements of your career. Conducting your work legitimately and professionally will have effects that may not be immediately recognized but will certainly be of benefit to you in the future. With better networking abilities, you will become more easily connected with new people who can benefit both your work and reputation.

Discovering developer types

As previously mentioned, the Roblox developer community is quite diverse; each developer brings their own unique style and technique to the platform. In game development, there are a variety of roles that a developer can fulfill. Most commonly on Roblox, each developer typically has one primary skill that they utilize for a project. The most common types of developers on Roblox are programmers, builders, 3D modelers, UI/UX designers, and other various artists. Each developer that holds their respective role is equally important to creating a well-refined finished product.

Programmers

Programmers are responsible for creating the core of any game. From storing player data, creating working weapons, or any other game functionality that does not occur by default, a programmer is the one producing it. On Roblox, programmers use an adaptation of Lua, a fast, C-based procedural language that is commonly found in the game development industry. You will find that the syntax of Lua is less complex than others and seems even more human-oriented than most high-level languages. Because of this, many programmers find the learning curve to be quite shallow and if Lua is your first language, you may find that the transition to other languages is quite easy as common syntax from multiple programming languages is utilized.

Modelers

3D modelers create the individual items that you see in a game, from furniture, pets, food items, to any other visual pieces that are typically small to medium in size. While these models can be made inside of Roblox Studio, most 3D modelers have become skilled in using the free 3D modeling application Blender to create their meshes. There are many reasons for doing this, in particular that the parts used for creating objects inside of Roblox Studio are quite blocky and you cannot easily achieve smooth or complex shapes, while it is considerably easier to do so in modeling software.

Builders

Builders fulfill the role of creating the worlds that exist in your game. Whether it be a cold corridor in a spaceship stuck adrift or a hot, arid desert with an oasis at its center, builders are developers that ultimately create the first impression of a game when players join. With this in mind, it is important that the builder for a project is skilled enough to create the desired vision. While intuitively, you may think that builders and modelers are one and the same, they are not. Builders focus more on the overall map and world design for projects, though they often use Blender and simultaneously fulfill the role of 3D modeling for various assets in the world.

UI/UX designers

UI/UX designers create the pages and screens that players interact with inside your game. Some good examples of something a UI designer would be responsible for making include a player's inventory screen, a health bar, or any other designed visual interface. Oftentimes, the UI is the first thing a player will notice in addition to the map of your game; therefore, it would be optimal that the designer is capable of creating a visually appealing set of UI that matches the style of the game itself.

Some more peripheral developer types include animators, music producers, graphic designers, and other artists. All the different types of developers mentioned are important for creating a strong, finished product and it is important that they all are equally competent in being able to accomplish the goals of a project. You should be sure to identify which of the preceding roles interest you the most so that you can focus your time on learning more about them and developing those skills for future use.

Gaining a perspective about your early projects

Though the beginning of your development career may vary, one thing is typically standard: your first game project will not be number one on the popular page, and that's okay! As frustrating as it may be that you are not granted the instant gratification everyone craves, this is the best outcome. Speaking from personal experience, maintaining a popular game that is played by tens of thousands of players concurrently (or more) is quite stressful. It is best that new developers have time to gain additional experience in order to first acclimatize to the platform before producing popular titles. Figure 1.1 depicts the thumbnail of my first game, Endure; it almost immediately tells an onlooker that the project was made by an amateur:

Figure 1.1 – Endure was one of my first titles and lacked refinement

Many new developers often run into what I've coined the Roadblocks on Roblox, where they begin to create a project that they have a passionate but loosely defined vision for and are forced to abandon it as they struggle to accomplish everything that they had originally imagined. The best way to move past these issues is to lay out a development plan and solidify the features and mechanics that should be included in your project. With this, you can review and restructure your vision as needed, keeping in mind what is popular with Roblox consumers, as well as what can be realistically accomplished with your personal abilities and that of your team for a project.

Ultimately, motivation and dedication are key; without these, projects simply do not come to fruition. It is important to remember that games are not often enjoyable to players if they were not enjoyable for the developers to create. If you are collaborating with other people, make sure that everyone on the team is on the same page for the direction and rough roadmap for the development of the game. The optimal goal, for both your mental health and the quality of your projects, is simply to make each new game better than your last. You may spend months developing a game only to have it perform at a mediocre level, but this is part of building your foundation. From each project, you gain a bit more experience and recognition. Figure 1.2 shows a direct result of following these practices; Power Simulator has been played more than 100 million times and its thumbnail is much more engaging to potential players due to its professional level of design:

Figure 1.2 – Power Simulator is my most successful title to date, a result of 2 years of experience

No matter what becomes of your early projects, always look forward to the future and try to improve the gaming experience for your players while improving the development process for yourself; only with repeated effort will you find success.

Summary

The key points to remember from this chapter are what opportunities exist on the Roblox platform, what different developer types do and what interests you, as well as finding a collection of people in the community with which to create more well-founded projects.

After combining what you have learned about networking, what to expect from early development, as well as how to build your overall experience as a developer, I believe that you too will be able to accomplish amazing feats on the platform while strengthening skills that will benefit you in any professional environment.

In the following chapter, you will begin familiarizing yourself with Roblox Studio, the program with which you will create your games. Knowing all the features of your work environment, including those that may not be immediately noticeable, will help to increase your development efficiency and overall productivity on future projects.

Chapter 2: Knowing Your Work Environment

Fully knowing your work environment allows you, as a developer, to make progress on your projects more efficiently. Familiarizing yourself with the interfaces that Roblox developers work with on a daily basis in order to produce expansive, high-quality games will set you on a path to make your own.

From this chapter, you will be able to create new places for games on your profile, change external game settings, learn how to navigate and use Roblox Studio, and make use of the additional resources Roblox offers. You will also be able to manipulate some of the smaller, yet convenient, features it provides.

In this chapter, we're going to cover the following main topics:

Traversing the Create pageGetting started with Roblox StudioExploring plugins and the Toolbox

Technical requirements

For this chapter, you will need access to a computer that meets the requirements to run Roblox Studio. In order to utilize most of the features of Roblox Studio, you will also need a stable internet connection. More information on the system requirements of Roblox can be found here:

https://en.help.roblox.com/hc/en-us/articles/203312800

Traversing the Create page

The Create tab of the Roblox website displays all of your created games and uploaded assets, showing the most recently created first, in the tab related to the asset's category. Additionally, many of the actions that can be taken to change different overall settings of your game can be completed here. To access the Create page, navigate to https://www.roblox.com/develop, and you will be brought to the page depicted in Figure 2.1:

Figure 2.1 – The Create page shows everything related to development

To continue with this chapter, you need to navigate to the Create tab. Once there, find the default game that was created when your account was activated. If for some reason no games are shown in a list under the Create tab, click the Create New Game button, scroll down, and click Create Game. At this point, you can return to the Create page and continue. Now you are set to learn how to configure the external settings of your game and make use of the other resources that the Create page offers.

Configuring Game and Place settings

Perhaps it has occurred to you that there are certain settings you want to change for your game, such as how many players can fit into a server or even what platforms the game can be played on. For settings such as these, no programming is necessary; the changes can, and in most cases should, be done through different options that are accessible through the Create page.

Once you are under the Games section of the Create page, which is selectable on the left side of your screen, click on the gear icon on the right side of your game, as seen in Figure 2.2. By clicking this icon, you will be presented with a drop-down menu that lists a variety of choices:

Figure 2.2 – A default view of a game's gear icon menu on the Roblox website

For this section, however, the focus will be on the Configure Game and Configure Start Place options, as there is an abundance of important information to cover.

The Configure Game menu

By clicking Configure Game, you will be able to change a number of aspects regarding your game. You will notice the ability to change your game between a Public and Private privacy status, as shown in Figure 2.3:

Figure 2.3 – The Configure Game menu is one page where external game settings are changed

Let's look at the difference between the Private and Public settings:

When a game is set to Private, no players except yourself and those you manually set permissions for will be able to play your game.When a game is set to Public, all Roblox users will have the ability to play your game. We will discuss how to change these permissions for specific users once we get to the topic of Roblox Studio.

Both the Configure Game and Configure Start Place pages have a tab where dev products can be created and configured. While the process is straightforward enough to be self-explanatory, not that you can add a name, price, description, and image for your dev products. They will appear as you have configured them in all of your game servers, updating in real time. When we cover creating your own game, we will discuss how to link the purchase of both game passes and dev products to your scripts, in order to make them function properly.

Further down the list of tabs for the Configure Game page, Roblox allows you to place links to different social media accounts. This is the only place where you should include social media links, as Roblox dictates in its terms of service that it shows or hides certain social media links based on the age indicated by a user's account in order to protect younger players. As has been demonstrated by many unfortunate developers before, a violation of this clause may lead to moderation action against your account or game.

Configuring Start Place menu

Now, if you navigate to Configure Start Place, you will find many more options that are relevant to the appearance and settings of your game as a whole; some of these settings are visible in Figure 2.4. You are immediately presented with the Basic Settings tab, which allows you to change the name of your game and the description that is shown beneath it:

Figure 2.4 – The Configure Place page is like the Configure Game page but has different settings

The second tab, titled Game Icon, allows you to change the icon of your game. An icon is a square image that typically serves as the first impression players have of your game when seeing it on the game's page or on a profile. Similarly, the Thumbnails tab allows you to upload images that represent your game and serve as the second and final impression before a user clicks the play button of your game. For 500 Robux, you can also upload a video up to 30 seconds in length; this feature allows you to show your game in action, which is often more engaging to potential players.

The Access