About Erik Cassel

Co-Founder & Chief Scientist of ROBLOX. @CasselErik on Twitter

Using “Wait” Wisely

Stop WatchMany scripts want to run little bits of code at frequent intervals. For example, a script might update the behavior of a zombie. It needs to update conditions repeatedly, like checking the location of the nearest player. 

Today, ROBLOX’s Chief Scientist, Erik Cassel, discusses proper use of the wait function.

Continue reading

Speeding ROBLOX Development with Continuous Testing

No bugsWe’ve been talking a lot lately about the new features and engine improvements coming to ROBLOX. But behind the development is a relatively unseen – and extensive – process that ensures the changes don’t break the game for players: Testing.

ROBLOX undergoes constant, rigorous, automated tests. Every time a developer “checks in” a new line of code, our testing system creates a trial version of ROBLOX and runs it through a battery of automated tests. This not only ensures the new code works, but also that it didn’t inadvertently introduce new bugs somewhere else.

Continue reading

An Optimization for Lua Scripts

Lua is a powerful, lightweight, scripting language, and is often used in video games due to fast execution and a short learning curve. World of Warcraft, Angry Birds and Mafia II all use Lua script. Today, Chief Scientist at ROBLOX, Erik Cassel, discusses a way to optimize Lua.

A Short Lesson

Any programming language has its little tricks for squeezing out better performance. Today, we will show you a way to make some Lua code faster. This guide is intended for more advanced scripting. I’ll also discuss the pro’s and con’s of code optimization.

Continue reading

Missive from the Pixel Mines

Our interns have toiled in the Pixel Mines all summer long. They’ve helped bring out new features like Facebook Connect and they have done essential behind-the-scenes work to keep the programmers sane. Late Wednesday night we released an update with truly awesome graphics features that the interns created:

Twinkle Twinkle Little Stars

The Roblox sky got a full makeover. The sky looks beautiful, the sun and the moon are more realistic, the transitions between day and night look better, and the night-time stars twinkle! For you programmers and high-end world creators out there, notice that the Sky’s StarCount property lets you change how many stars fill the night-time sky.

Five New Materials

This is sooooo exciting! We have stunning new materials:

  • Concrete
  • Corroded Metal
  • Diamond Plate
  • Aluminum
  • Ice

Roblox Studio has a new Material toolbar – look for the little symbol of an atom.

Textures

Use the materials to spruce up your world. Imagine a concrete bunker embedded on an icy cliff with rusty pylons and diamond plated walkways guarded by men in Mylar hazmat suites. There: I managed to get all the new materials in one sentence, but you can imagine something better, I’m sure! That’s why we leave the creativity to all you great Robloxians out there.

-Erik

Continue reading

Good-bye camelCase, Hello delay()

Note: This is one of those highly technical articles. If you want something lighter then go here.

The latest build is primarily bug-fix release. However, we’ve added a couple of small scripting enhancements recently.

First, you may have noticed that most object members are now capitalized rather than “camelCase”. We’re supporting old scripts that call member functions that start in lower-case, but all new members will start with an upper-case character. (We’ve decided to standardize on the ‘.NET’ style with regards to capitalization)

Second, there’s a new global function called “delay”. It complements the wait() function that many of you use. delay takes 2 arguments: The first is a time to wait in seconds, the second is the function to call after the wait time has elapsed. delay continues executing, unlike wait, which blocks.

You’ll find delay is a very useful way to spawn a thread. You might use it in place of connecting to a Heartbeat event and then disconnecting later on. For example, the following code will print “Hello” and “world” followed by “!” a second later:

local c

function exclamation()
   c:disconnect()
   wait(1)
   print("!")
end

print("Hello")
c = game:GetService("RunService").Heartbeat:connect(exclamation)
print("world")

Here is the same functionality written with delay:

function exclamation()
   print("!")
end

print("Hello")
delay(1,exclamation)
print("world")

-Erik

Continue reading

RocketPropulsion

There’s a new “RocketPropulsion” object in town. It works similarly to the BodyGyro and BodyPosition objects, but this one moves a part around in a manner not unlike a rocket.  For a sample of this new feature, visit my place.

Disclaimer: This is a preliminary feature and it may change in the future.  Also, this feature is for advanced users who understand a little physics.

Here are the most important members:

Target – a Part that the rocket will fly towards
Fire() – causes the rocket to fly towards Target

Other members:

Abort() – causes the rocket to fall down
MaxSpeed – the maximum speed that the rocket will travel at
CartoonFactor – A real rocket (factor=0) will point slightly upwards as it counters gravity. An ACME rocket (factor=1) favored by Wily Coyote points its nose straight at its target. CartoonFactor must lie between 0 and 1, otherwise I don’t know what will happen.
TargetRadius – A distance from the Target at which the ReachedTarget event is fired
ReachedTarget – This event is fired when the Rocket comes within TargetRadius of the target

Tuning:

MaxThrust – The maximum thrust the rocket will exert. Heavy rockets need more thrust to remain airborne and to track the target
MaxTorque – The maximum torque the rocket will use to rotate itself.
ThrustP – The P in the PD controller that governs the motion of the Rocket. The higher the number, the more aggressively the rocket will move towards the Target.
ThrustD – The D in the PD controller that governs the motion of the Rocket. Dampens the motion of the Rocket, preventing it from overshooting.
TurnP – The P in the PD controller that governs the rotation of the Rocket. The higher the number, the more aggressively the rocket will turn towards the Target.
TurnD – The D in the PD controller that governs the rotation of the Rocket. Dampens the rotation of the Rocket, preventing it from overshooting.

-Erik

Continue reading

“Report Abuse!!!”

Every regular Robloxian has by now noticed the ubiquitous “Report Abuse” button.  As of this week it has crept into the game itself in the guise of a rather surprised looking yellow smiley.

Report Abuse

ROBLOX is a kid-friendly site. We work hard to make our community reasonably safe for young and old alike. That is why we don’t tolerate profanity, threatening behavior, phishing for passwords, impersonating an administrator, spamming, advertising, etc.

Each time you submit an abuse report using our automated system we review the report and take appropriate action. We will read the forum post, view a user’s profile, or comb through a transcript of in-game chat to see what is going on. We will then take appropriate action, such as a reminder to be nice, a warning, a temporary ban, or account deletion.

Questions, Questions

Hey Builderman! Which words are naughty? Can I say “¥αβ©π®@!”?

If you are asking these questions and thinking about the consequences of your actions, then there is a good chance you’re behavior is just fine. There are clearly utterances that are bad, some that are OK, and many things in the vast gray area in-between. We will make the call.

When does good-natured competition turn into a mean-spirited threat?

Think of Roblox as a vast neighborhood street. Kids play together, argue, make up rules, and learn how to get along by resolving conflicts. Be sensitive to how what you say will make others feel.

The Boy Who Cried “Wolf!”

Like nearly everything else in ROBLOX, the moderation system is in its infancy. But spamming the moderation system with repeated, bogus abuse reports won’t get you anywhere. In fact, it’ll soon put your abuse reports on the bottom of our priority list. So, only submit an abuse report if you feel somebody is doing something inappropriate.

Finally, we can’t do much about somebody who annoys you by breaking up your house in the Community Construction Site. But watch out: some day that annoying noob might find himself ostracized from the community. You’ve seen the first taste of that with the “Friends-Only” feature.

‘nuff said. Let’s play!
 

Continue reading