Difference between revisions of "Parts"
| Line 96: | Line 96: | ||
|- | |- | ||
| Black | | Black | ||
| − | | High | + | | Very High |
| * | | * | ||
|- | |- | ||
| Line 143: | Line 143: | ||
| * | | * | ||
|- | |- | ||
| − | | | + | | Copper |
| − | | | + | | Low |
| + | | * | ||
| + | |- | ||
| + | | Cloudy grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Daisy orange | ||
| + | | Almost impossible | ||
| + | | * | ||
| + | |- | ||
| + | | Dark green | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Dark grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Dark stone grey | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Dark taupe | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Dirt brown | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Earth blue | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Earth green | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Earth orange | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Earth yellow | ||
| + | | Low | ||
| + | | * | ||
| + | |- | ||
| + | | Fawn brown | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Faded green | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Flint | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Fog | ||
| + | | Low | ||
| + | | * | ||
| + | |- | ||
| + | | Fossil | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Ghost grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Grime | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Hurricane grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Insitutional white | ||
| + | | Very High | ||
| + | | * | ||
| + | |- | ||
| + | | Lavender | ||
| + | | Very Low | ||
| + | | * | ||
| + | |- | ||
| + | | Lily white | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Lilac | ||
| + | | Very Low | ||
| + | | * | ||
| + | |- | ||
| + | | Linen | ||
| + | | Medium | ||
| + | | * | ||
| + | |- | ||
| + | | Light bluish green | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Light grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Light lilac | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Light stone grey | ||
| + | | High | ||
| + | | * | ||
| + | |- | ||
| + | | Laurel green | ||
| + | | Low | ||
| + | | * | ||
| + | |- | ||
| + | | Med. reddish violet | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Medium bluish violet | ||
| + | | Very Low | ||
| + | | * | ||
| + | |- | ||
| + | | Medium green | ||
| + | | Extremely Low | ||
| + | | * | ||
| + | |- | ||
| + | | Medium lilac | ||
| + | | Very Low | ||
| * | | * | ||
|} | |} | ||
Revision as of 20:16, 19 May 2021
Parts are Roblox parts that spawn throughout the map. They can be picked up, welded, and cut by players. Parts come in a variety of colors, shapes and sizes. They are one of the core building materials of the game, the other being items.
Spawning
Upon server start, 4,800 parts are spawned around the map. Each part has a random position, size, material, shape and color. For positioning, the map has designated spawn areas for parts and items. An algorithm picks between these areas, giving each one a probability equal to its volume, then calculates a random position and rotation within the area. For shape, each part has a ~60% chance of being a block and a ~40% chance of being a cylinder.
Materials
For material, one is picked according to the probability table below.
| Material | Chance | Value |
|---|---|---|
| CorrodedMetal | 30.6% | 0.8 |
| Metal | 19.6% | 1 |
| SmoothPlastic | 19.6% | 1 |
| DiamondPlate | 13.6% | 1.2 |
| Glass | 13.6% | 1.2 |
| Foil | 3.1% | 2.5 |
Below is the code used to calculate that table, which can be run by any injector such as Synapse or Script-Ware. The reason for the (1 / v) ^ 2 formula is that the part spawning script uses that formula when choosing which material to pick. (confirmed by the developer)
local valuebook = require(game.ReplicatedStorage.ValueBook) local total = 0 for _, v in pairs(valuebook.MaterialValues) do total += (1 / v) ^ 2 end for _, v in pairs(valuebook.Materials) do local value = (1 / valuebook.MaterialValues[v])^2 print(v, tostring((value / total) * 100) .. '%', value) end
Sizing
For size, the value of the picked material is used as a bias. The bias skews the random distribution such that higher bias values cause lower random numbers to be more common. In practice this means that parts with rarer materials tend to spawn smaller, but all sizes are still possible. Then, the Y and Z values are randomly generated. Each component is calculated as math.random()^bias * 9 + 1, which means a random number from 1 to 10, skewed by the bias. Again, higher biases (such as foil's bias of 2.5) mean that the size will tend towards the 1, while lower biases (such as in the case of corroded metal) tend to skew towards 10.
The maximum value for the X component will be a value N such that Y * Z * N == 125. In order words the maximum volume of the part will be 125 studs squared. The minimum value of the X component is always 0.2. Then a random number is generated between those two values, skewed by the bias once again.
The full function is thusly:
function Part:RandomSize(bias) local y = math.random()^bias * 9 + 1 local z = math.random()^bias * 9 + 1 local x = math.min(math.random()^bias * (125 / (y * z) - 0.2) + 0.2, 10) return Vector3.new(x, y, z) end
Colors
Parts mainly spawn in dull and muted tones, with some greys and whites mixed in. Rather than a list of BrickColors, part colors are generated as Color3 values, so there is an entire spectrum of possible colors. Nonetheless, the spectrum is limited and is only a small fraction of the color space. Here is a graph showing the entire part color spectrum (click on it for a larger version):
On the left is the hue and lightness spectrum, and on the right is the saturation spectrum. The range of saturation values for a color depends on its lightness, which is why there is a separate saturation graph next to the main one. To pick a color from the spectrum, first the game chooses the hue and lightness from the graph on the left, and then it chooses a saturation from the graph on the right. As you can see, brighter colors have a smaller saturation range.
The color generation code is as follows:
local hue = math.random() local lightness = rand(0.1, 1, 0.75) local saturation = rand(0.1, 0.5 - (lightness^0.5 * 0.4), 5)
rand(min, max, bias) generates a random number between its two first arguments, biased by the third argument. Notice that lightnesses below 0.1 are impossible to spawn and so are saturations below 0.1, which are both reflected in the graph.
Colors Found In Game
| Color Name | Spawnrate | Rgb |
|---|---|---|
| Artichoke | Medium | * |
| Beige | Extremely Low | * |
| Black | Very High | * |
| Bright bluish violet | Very Low | * |
| Bright green | Extremely Low | * |
| Bright reddish lilac | Very Low | * |
| Bright reddish violet | Extremely low | * |
| Bright violet | Very Low | * |
| Bronze | Very Low | * |
| Brown | Low | * |
| Burlap | Extremely Low | * |
| Burgundy | Extremely Low | * |
| Cadet blue | Medium | * |
| Cocoa | Low | * |
| Copper | Low | * |
| Cloudy grey | High | * |
| Daisy orange | Almost impossible | * |
| Dark green | Extremely Low | * |
| Dark grey | High | * |
| Dark stone grey | Medium | * |
| Dark taupe | High | * |
| Dirt brown | High | * |
| Earth blue | Medium | * |
| Earth green | High | * |
| Earth orange | Extremely Low | * |
| Earth yellow | Low | * |
| Fawn brown | Extremely Low | * |
| Faded green | Medium | * |
| Flint | Medium | * |
| Fog | Low | * |
| Fossil | High | * |
| Ghost grey | High | * |
| Grey | High | * |
| Grime | Medium | * |
| Hurricane grey | High | * |
| Insitutional white | Very High | * |
| Lavender | Very Low | * |
| Lily white | Medium | * |
| Lilac | Very Low | * |
| Linen | Medium | * |
| Light bluish green | Extremely Low | * |
| Light grey | High | * |
| Light lilac | Extremely Low | * |
| Light stone grey | High | * |
| Laurel green | Low | * |
| Med. reddish violet | Extremely Low | * |
| Medium bluish violet | Very Low | * |
| Medium green | Extremely Low | * |
| Medium lilac | Very Low | * |
Debug Colors
Older versions of Grassy Landscape spawned random BrickColors instead of using a color spectrum. Colors outside the spawnable spectrum are referred to as "debug colors", since they used an unfinished algorithm for debugging purposes (i.e. to get the rest of the game working first). Since there is currently no save system, and all debug colors have been removed from the game, it is no longer possible to encounter a part color outside of the spectrum.
"Rare BrickColors"
When generating colors, the game will refuse to generate any color that happens to be a "rare BrickColor". The list of rare BrickColors is below:
| Name | Reason |
|---|---|
| Lig. Yellowich orange | Typo |
| Light green (mint) | Parenthesis |
| Phosph. White | Cool name |
| Transparent | Transparent |
| Tr. Red | Transparent |
| Tr. Lg blue | Transparent |
| Tr. Blue | Transparent |
| Tr. Yellow | Transparent |
| Tr. Flu. Reddish orange | Transparent |
| Tr. Green | Transparent |
| Tr. Flu. Green | Transparent |
| Tr. Brown | Transparent |
| Tr. Medi. reddish violet | Transparent |
| Tr. Bright bluish violet | Transparent |
| Tr. Flu. Blue | Transparent |
| Tr. Flu. Yellow | Transparent |
| Tr. Flu. Red | Transparent |
| Red flip/flop | Flip/flop |
| Yellow flip/flop | Flip/flop |
| Silver flip/flop | Flip/flop |
| Sand blue metallic | Metallic |
| Sand violet metallic | Metallic |
| Sand yellow metallic | Metallic |
| Dark grey metallic | Metallic |
| Black metallic | Metallic |
| Light grey metallic | Metallic |
| Gun metallic | Metallic |
| Lemon metalic | Bkerr's favorite color |
If the algorithm generates a color that is "rare", it will simply re-roll until it lands on one that isn't. Most likely, if someone has a part with one of these colors, it was obtained from an event or someone with the debug GUI.