February 26th 2007

Dear Telamon…

This morning is a momentous occasion. I am emptying my Inbox. Often people send me messages like “… so-and-so was calling me names, please do something…” or “yo dude, give me a custom character plz…”. However, occasionally I get some interesting questions to which I send a thoughtful response. I’m going to start posting some of these. The first is from MrDoomBringer, with whom I exchange several messages a week.

MrDoomBringer writes:

Hey, I just had one of those brain zap things, an “idea”.

We keep talking about having new meshes, but, why not just allow new brick models?

As for that matter, how are the brick collisions calculated? The head mesh throws it off a bit, I know that, but how do you calculate the collision between a brick and a cylinder? If the code for the collisions could be edited to just look at the outside edges of the model, then it would be easy to make a sloped brick, or a curved one.

Of course… I have no clue how to do this, I’m speculating on other code that I have worked with…

Your question touches on two issues: parametric/custom parts and simulation efficiency.

The Roblox team has been thinking about adding additional parts to Roblox for a long time. The obvious way to do it would be to add a 3d modeler tool to Roblox Studio that would let you build your own meshes and then create parts out of them. This is probably not a great idea, since 3d modeling is very hard and writing 3d modeling software is not my idea of fun. The way we would introduce new parts would probably be to make parametric parts. For instance, we might make a Window part that you could resize however you wanted, and Roblox would automatically make a nice Window mesh for you, of any size or style that you chose.

But to answer your question more directly, we don’t do general-purpose mesh collision detection by default because it is very slow. The only shapes the Roblox physics engine has to worry about right now are boxes and spheres. That means we have to be able to detect 3 types of collisions: Sphere-Sphere, Box-Box, and Box-Sphere. All of these tests are relatively quick to compute - in particular a Sphere-Sphere test is a trivial application of the distance formula.

To do general-purpose (often called “Triangle Soup”) collision detection between two objects is very slow. Say I have two user-made meshes that both contain 1000 triangles. I basically have to do 1000^2 tests to see if the two soups are colliding. You can do a little better if you enforce the constraint that the meshes have to be “water-tight” - meaning that there is no path that can be drawn from the inside of the mesh to the outside of the mesh without passing through a face of the mesh.

The best way to test for collisions between two “water-tight” meshes is to break the meshes up into convex hulls (if the mesh is not already convex). This can be done once, at resource load time, so does not hurt performance. But then you have to do convex hull collision tests. With various gnarly optimizations you can do these in O(lg n) time against Spheres and Boxes, and O(n lg n) time against other hulls. In comparison, all current collision tests can be done in O(1) - constant time.

The bottom line is that we will need to add convex hull collision to the engine someday, but that in order to get good performance we need to be very judicious in choosing when to do the more expensive collision test and when a simple sphere will serve to approximate an object’s geometry. If we did convex hull collision by default and a user makes a pile of 100 rocket launchers, the result is not going to be good. It’s a bigger problem that it seems, which is why it was not thrown into the physics engine when BM first wrote it.

If you are interested in learning more about collision detection in games, here are two excellent sources of information:

Collision Detection Article on WikiPedia

Intro to the SAT (Separation of Axes Theorem)

- Telamon

AddThis Social Bookmark Button

February 23rd 2007

Where are they now?

The Roblox Team just shipped a fabulous release last week and are celebrating their achievements by living it up on Builderman’s yacht in the Key West, while catching up with some other 49er alumns. Hot tubbin’ it (on the yacht, ‘natch) after a long day of scuba diving, we were discussing the features we are each working on for the next big release.

Matt has been working on DB caching to improve website speed and has been working on backend stuff for customized characters.

Erik has been working on webpage GUI stuff for customized characters, while kicking back pina coladas and reading through all the dump files that people have been sending him when Roblox crashes. Since the last deploy, we’ve been getting 60% fewer of these.

Builderman was busy waterskiing backwards, and so missed most of the team meeting. Though he did shout to us about characters and humanoids and something about slowing down the boat.

I’ve been continuing my valiant crusade towards making Capture the Flag games a reality. Next step: Player Spawn Locations.

The most exciting feature for scripters in the next release? It’s a little something called a DHTMLWindow. At least I’m excited about it.

- Telamon

AddThis Social Bookmark Button

February 20th 2007

Badges, Statistically Speaking

Have you ever wondered what the most rare badge on Roblox is? Or which is harder to get: the Bloxxer Badge or the Bricksmith? I was wondering the same thing myself on Friday and I found some interesting numbers out of our database. I put together this table (data from February 16th):

badgetable.png

What does this show? Well first, the Count column tells us how many accounts have earned a particular badge. For example, we can see that, as of Friday, there are 103 Bloxxers on Roblox, but only 25 Bricksmiths. This means it is roughly 4 times harder to get a Bricksmith badge than a Bloxxer. Even more interesting is that almost no one has earned the Inviter badge - it is the rarest badge on Roblox. There are more Admin badges out there than Inviters!

badgegraph.pngSince Roblox now has more than 15,000 users, and only a fraction of those have been playing since we have added badges, in order to get a feel for the distribution of different badges amongest active players, I also computed the prevalence of each badge. This figure it relative to the number of players who have earned any badge. For example, of all the people who have any badge, 9 in 10 of them have a Combat Initiation Badge - by far the easiest badge to get.

- Telamon

AddThis Social Bookmark Button

February 17th 2007

Place Protection - quick update

Many people have requested a way to prevent others from “copying” their place.  At lunch today we decided to give an owner control over when his or her place can be duplicated.

If you go to the “Configure My Place” area on your home page you’ll see the new feature.

We also appreciate everyone who has sent us bug reports - we fixed four potential client crash bugs as part of the release we pushed out about 30 minutes ago.

Thanks!

                                                                          - Builderman

AddThis Social Bookmark Button

February 16th 2007

Code Bomb

We’ve just pushed a major release out the door! What’s in it?

  • Tools. These are items that can be picked up, dropped (press backspace), and appear in your hand when you use them. They use Meshes and look cool.
  • Teams. Team games now have engine support. This means a custom leaderboard and player names are printed in team colors above the chacter.
  • New map. The team map BrickBattle: Glass Houses.
  • Website made faster.
  • Stats now appear in drop-down panel.
  • New default starting place for new users.
  • A large number of crash bugs fixed.
  • A number of Studio annoyances fixed.

Tools and Teams are both highly experimental and have only been minimally tested. In addition, we may be changing how Tools and Teams work from Lua. Scripts written against Tools or Teams will probably break in a future release. So if you are thinking about adding them to your map, you have been warned.

Some initial Tools and Team docs have been published to the wiki - I may write some articles soon that show how to use them in your maps.

Post any bugs you find to the Support forum - we will be working through these Friday and early next week for the next release.

- Telamon

AddThis Social Bookmark Button

Next Page »