Skip to content

Commit 30ac739

Browse files
update Open Source Docs from Roblox internal teams
1 parent a0dcfe8 commit 30ac739

File tree

7 files changed

+113
-38
lines changed

7 files changed

+113
-38
lines changed
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

content/en-us/production/monetization/developer-products.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A **developer product** is an item or ability that a user can purchase more than
1111
For items or abilities that a user should only purchase **once**, such as a special weapon or a permanent power-up, see [Passes](../../production/monetization/game-passes.md).
1212
</Alert>
1313

14-
## Create developer products
14+
## Create a developer product
1515

1616
<Alert severity="warning">
1717
Before creating a developer product, make sure your experience has been [published](../../production/publishing/publish-experiences-and-places.md) and is accessible on Roblox.
@@ -28,10 +28,10 @@ To create a developer product:
2828
7. Click **Create Developer Product**.
2929

3030
<Alert severity="info">
31-
If you want to use the developer product as a randomized reward, review the [randomized virtual item policy](./randomized-virtual-items-policy.md).
31+
If you want to use the developer product as a randomized reward, review the [randomized virtual item policy](./virtual-items.md).
3232
</Alert>
3333

34-
## Get developer product IDs
34+
## Get the developer product ID
3535

3636
To use scripting, you need a developer product ID. To get the product ID:
3737

@@ -41,15 +41,29 @@ To use scripting, you need a developer product ID. To get the product ID:
4141

4242
<img src="../../assets/creator-dashboard/Developer-Product-Copy-Asset-ID.png" width="400" />
4343

44-
## Sell developer products
44+
## Sell a developer product
4545

4646
<Alert severity="info">
4747
If you're using [price optimization](./price-optimization.md), make sure to place the script inside a `Class.LocalScript` so that users see personalized product prices.
4848
</Alert>
4949

50+
Before selling developer products, make sure you are properly processing sales receipts and granting users their purchased products. To do so, you must:
51+
52+
- Use the `Class.MarketplaceService.ProcessReceipt|ProcessReceipt` API to check purchase receipts. `ProcessReceipt` automatically reads and acknowledges that a user has purchased a product outside of the experience.
53+
- Validate each receipt for `User ID`, `Developer Product ID`, and the receipt status.
54+
- If the receipt has a status of **Open**, grant the user the developer items they have purchased.
55+
- Respond to the `ProcessReceipt` API with a message acknowledging the receipt and validating that the purchased items were granted.
56+
57+
You can sell developer products in two ways:
58+
59+
- [Inside your experience](#inside-your-experience)
60+
- [Outside your experience](#outside-your-experience)
61+
62+
### Inside your experience
63+
5064
To implement and sell a developer product inside an experience, call `Class.MarketplaceService|MarketplaceService` functions.
5165

52-
Use `Class.MarketplaceService:GetProductInfo()|GetProductInfo()` to retrieve information about a developer product, like name and price, and then to display that product to users. You can sell the product inside your experience's marketplace, for example. For developer products, the second parameter must be `Enum.InfoType.Product`.
66+
Use `Class.MarketplaceService:GetProductInfo()|GetProductInfo` to retrieve information about a developer product, like name and price, and then to display that product to users. You can sell the product inside your experience's marketplace, for example. For developer products, the second parameter must be `Enum.InfoType.Product`.
5367

5468
```lua
5569
local MarketplaceService = game:GetService("MarketplaceService")
@@ -70,7 +84,7 @@ if success and productInfo then
7084
end
7185
```
7286

73-
Use `Class.MarketplaceService:GetDeveloperProductsAsync()|GetDeveloperProductsAsync()` to retrieve all developer products associated with your experience. This function returns a `Class.Pages|Pages` object that you can inspect and filter to build things like an in-experience store or product list GUI.
87+
Use `Class.MarketplaceService:GetDeveloperProductsAsync()|GetDeveloperProductsAsync` to retrieve all developer products associated with your experience. This function returns a `Class.Pages|Pages` object that you can inspect and filter to build things like an in-experience store or product list GUI.
7488

7589
```lua
7690
local MarketplaceService = game:GetService("MarketplaceService")
@@ -88,7 +102,7 @@ if success and developerProducts then
88102
end
89103
```
90104

91-
Use `Class.MarketplaceService:PromptProductPurchase()|PromptProductPurchase()` to prompt product purchases inside your experience. You can call this function when a user performs actions like pressing a button or talking to a vendor NPC.
105+
Use `Class.MarketplaceService:PromptProductPurchase()|PromptProductPurchase` to prompt product purchases inside your experience. You can call this function when a user performs actions like pressing a button or talking to a vendor NPC.
92106

93107
```lua
94108
local MarketplaceService = game:GetService("MarketplaceService")
@@ -143,9 +157,57 @@ button.MouseButton1Click:Connect(function()
143157
end)
144158
```
145159

146-
## Handle developer product purchases
160+
### Outside your experience
161+
162+
To enable developer product purchases outside your experience, you must work with the `Class.MarketplaceService.ProcessReceipt|ProcessReceipt` API. After a user makes a purchase in the Store tab of your experience details page, you must use `ProcessReceipt` to confirm their purchase and grant them their items once they enter your experience.
163+
164+
<Alert severity="warning">
165+
Do **not** use the `Class.MarketplaceService:PromptProductPurchaseFinished|PromptProductPurchaseFinished` event to process purchases. You must use the `ProcessReceipt` callback instead.
166+
167+
The firing of `PromptProductPurchaseFinished` does not mean that a user has successfully purchased an item.
168+
</Alert>
169+
170+
#### Test mode
171+
172+
The **test mode** feature helps you validate your purchase flow by simulating a developer product purchase outside your experience. You should use test mode to make sure that you have implemented `ProcessReceipt` correctly before enabling external developer product sales.
173+
174+
The developer products you put up for sale in test mode can only be seen by you and by members of your group. They are not visible to users.
175+
176+
To test your implementation:
177+
178+
1. In the **Creator Hub**, go to **Monetization** > **Developer Products**.
179+
2. Click the **&vellip;** menu and select **External Purchase Settings**.
180+
3. In the **External Purchase Settings** page, click **Enable test mode**.
181+
4. Once test mode is active, return to the **Developer Products** page and select a product to test.
182+
5. In the **Basic Settings** page, select the **Allow external purchases** checkbox and save your changes.
183+
6. Go to the **Store** tab of the experience details page and purchase the product you made available for sale.
184+
7. Enter the experience and confirm that you have received the product you purchased. The receipt status of the `ProcessReceipt` API should update to **Closed**.
185+
186+
After you test your implemention, Roblox verifies that the test has been successfully completed and allows you to fully activate the feature to sell developer products outside your experiences.
187+
188+
For more information about the `ProcessReceipt` API and its implementation, see the `Class.MarketplaceService.ProcessReceipt|ProcessReceipt` page.
189+
190+
#### Enable external sales
191+
192+
<Alert severity="info">
193+
You can only enable external sales after you have used test mode to validate your purchase flow.
194+
</Alert>
195+
196+
To enable external sales:
197+
198+
1. Go to the **External Purchase Settings** page.
199+
2. Turn on **External Purchases**.
200+
3. Return to the **Developer Products** page and select the products you want to sell outside of your experience.
201+
4. In the **Basic Settings** page, select the **Allow external purchases** checkbox and save your changes.
202+
5. Confirm that the products are now available for purchase in the **Store** tab of the experience details page.
203+
204+
To disable the external sale of a developer product, select the product on the **Developer Products** page and clear the **Allow external purchases** checkbox.
205+
206+
## Handle a developer product purchase
207+
208+
After a user purchases a developer product, you must handle and record the transaction. To do this, use a `Class.Script` within `Class.ServerScriptService` using the `ProcessReceipt` function.
147209

148-
After a user purchases a developer product, you must handle and record the transaction. To do this, use a `Class.Script` within `Class.ServerScriptService` using the `Class.MarketplaceService.ProcessReceipt()|ProcessReceipt()` function.
210+
For more information about the `ProcessReceipt` API and its implementation, see the `Class.MarketplaceService.ProcessReceipt|ProcessReceipt` page.
149211

150212
```lua
151213
local MarketplaceService = game:GetService("MarketplaceService")
@@ -218,7 +280,7 @@ The functions for handling each product ID must return `true` for the transactio
218280
Although Roblox itself does **not** record the purchase history of developer products by specific users, you can request to [download sales data](../../production/analytics/analytics-dashboard.md#sales-data). If you want to track user-specific purchase history, it's your responsibility to [store the data](../../cloud-services/data-stores/index.md).
219281
</Alert>
220282

221-
## Developer Product analytics
283+
## Developer product analytics
222284

223285
Use developer product analytics to analyze the success of individual products, identify trends, and forecast potential future earnings.
224286

content/en-us/production/monetization/game-passes.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Passes let you charge users a one-time Robux fee to access privileg
99
For items that a player might purchase multiple times, such as potions, temporary power-ups, or in-experience currency, see [Developer Products](../../production/monetization/developer-products.md).
1010
</Alert>
1111

12-
## Create passes
12+
## Create a pass
1313

1414
<Alert severity="warning">
1515
Before creating a pass, make sure your experience has been [published](../../production/publishing/publish-experiences-and-places.md) and is accessible on Roblox.
@@ -40,10 +40,10 @@ To create a pass:
4040
</GridContainer>
4141

4242
<Alert severity="info">
43-
If you want to use the pass as a randomized reward, review the [Randomized Virtual Item Policy](./randomized-virtual-items-policy.md).
43+
If you want to use the pass as a randomized reward, review the [Randomized Virtual Item Policy](./virtual-items.md).
4444
</Alert>
4545

46-
## Get pass IDs
46+
## Get the pass ID
4747

4848
To use scripting, you need a pass ID. To get the pass ID:
4949

@@ -53,27 +53,18 @@ To use scripting, you need a pass ID. To get the pass ID:
5353

5454
<img src="../../assets/creator-dashboard/Pass-Copy-Asset-ID.png" width="400" />
5555

56-
## Sell passes
56+
## Sell a pass
5757

5858
<Alert severity="info">
5959
If you're using [price optimization](./price-optimization.md), make sure to place the script inside a `Class.LocalScript` so that users see personalized pass prices.
6060
</Alert>
6161

62-
You can sell passes outside or inside an experience.
62+
You can sell passes in two ways:
6363

64-
### Outside an experience
64+
- [Inside your experience](#inside-your-experience)
65+
- [Outside your experience](#outside-your-experience)
6566

66-
To sell a pass in an experience's **Store** page:
67-
68-
1. Go to **Monetization** &rang; **Passes**.
69-
2. Hover over the pass and click the **&ctdot;** menu.
70-
3. Select the pass you want to sell.
71-
4. Select **Sales**.
72-
5. Enable to **Item for Sale** toggle.
73-
6. In the **Price in Robux** field, enter the amount of Robux you want to charge users for the pass. The price you enter affects how much Robux you earn per sale. The price you enter affects how much Robux you earn per sale. The minimum price is 1 Robux, and the maximum price is 1 billion Robux.
74-
7. Click **Save Changes**. The pass populates in the experience's **Store** page.
75-
76-
### Inside an experience
67+
### Inside your experience
7768

7869
To implement and sell a pass inside an experience, call `Class.MarketplaceService|MarketplaceService` functions.
7970

@@ -162,6 +153,18 @@ MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptPurchaseFinish
162153
Although Roblox itself does **not** record the purchase history of developer products by specific users, you can request to [download sales data](../../production/analytics/analytics-dashboard.md#sales-data). If you want to track user-specific purchase history, it's your responsibility to [store the data](../../cloud-services/data-stores/index.md).
163154
</Alert>
164155

156+
### Outside your experience
157+
158+
To sell a pass on the **Store** tab of the experience details page:
159+
160+
1. Go to **Monetization** > **Passes**.
161+
2. Hover over the pass and click the **&ctdot;** menu.
162+
3. Select the pass you want to sell.
163+
4. Select **Sales**.
164+
5. Enable to **Item for Sale** toggle.
165+
6. In the **Price in Robux** field, enter the amount of Robux you want to charge users for the pass. The price you enter affects how much Robux you earn per sale. The price you enter affects how much Robux you earn per sale. The minimum price is 1 Robux, and the maximum price is 1 billion Robux.
166+
7. Click **Save Changes**. The pass populates in the **Store** tab of the experience details page.
167+
165168
## Assign pass privileges
166169

167170
You must manually assign pass privileges to users that purchase your passes. To do this, use `Class.Players.PlayerAdded|PlayerAdded` when a user joins your experience to check if they already own the pass and to assign them the pass privileges.
@@ -212,7 +215,7 @@ With analytics, you can:
212215
To access pass analytics:
213216

214217
1. Go to [Creations](https://create.roblox.com/dashboard/creations) and select an experience.
215-
2. Go to **Monetization** &rang; **Passes**.
218+
2. Go to **Monetization** > **Passes**.
216219
3. Select the **Analytics** tab.
217220

218221
<img src="../../assets/monetization/game-passes/passes-analytics-2.png" width="100%" />

content/en-us/studio/microprofiler/index.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: MicroProfiler
33
description: The MicroProfiler is a Studio and client tool for optimizing your experience.
44
---
55

6-
The **MicroProfiler** is an optimization tool available in Roblox Studio and the Roblox client that provides detailed timing information for [task scheduler](../../studio/microprofiler/task-scheduler.md) tasks called **tags**.
6+
The **MicroProfiler** is a performance optimization and troubleshooting tool available in Roblox Studio and the Roblox client. It provides detailed timing information for [task scheduler](../../studio/microprofiler/task-scheduler.md) tasks called **tags**.
77

88
- For a list of common tasks, refer to the [tag reference](../../studio/microprofiler/tag-table.md).
99
- For a step-by-step example of using the MicroProfiler to identify a performance issue, see the [MicroProfiler walkthrough](../../studio/microprofiler/use-microprofiler.md).
@@ -16,7 +16,7 @@ When open, a menu bar is visible at the top of the 3D viewport. In the default m
1616

1717
<img alt="The Microprofiler frame graph, showing blue frames and detailed frame information." src="../../assets/optimization/microprofiler/micro-frame.png" width="440px" />
1818

19-
Bars should generally be around the middle of the graph, but you might see sudden spikes (rapid increases in value). Spikes indicate that more time was taken to perform some task, usually because of an increased workload. For instance, creating a lot of moving parts requires more work from the physics simulation, which then needs more time to process motion and part contacts. The following image shows an example of a spike:
19+
Bars should generally be around the middle of the graph, but you might see sudden spikes (rapid increases in values). Spikes indicate that more time was taken to perform some task, usually because of an increased workload. For instance, creating a lot of moving parts requires more work from the physics simulation, which then needs more time to process motion and part contacts. The following image shows an example of a spike:
2020

2121
<img alt="The Microprofiler with several bars higher than others." src="../../assets/optimization/microprofiler/micro-spike.png" width="300px" />
2222

@@ -34,7 +34,7 @@ There are three main thread types:
3434

3535
- **Main/Render**: Perhaps unintuitively, runs on the CPU. Processes input, `Class.Humanoid|Humanoids`, animations/tweening, physics ownership, sound, and waiting script resumes. Also updates Studio interfaces and coordinates the other threads.
3636

37-
- **Worker** ("RBX Worker"): Helps the main thread with networking, physics, and pathfinding. Due to the number of cores in modern CPUs, you likely have many worker threads.
37+
- **Worker** ("RBX Worker"): Helps the main thread with networking, physics, and pathfinding. Due to the number of cores in modern CPUs, you likely have many worker threads, most of which are in a sleep state at any given time.
3838

3939
- **Render** ("GPU"): Follows a "prepare, perform, present" logic. Communicates with the graphics processing unit (GPU) of the device.
4040

@@ -48,7 +48,7 @@ If your scripts are running complicated tasks, you can profile critical portions
4848

4949
```lua title="HardWorkScript"
5050
debug.profilebegin("Hard Work")
51-
-- Here is where the code to be profiled should be
51+
-- Code to be profiled
5252
debug.profileend()
5353
```
5454

@@ -135,9 +135,13 @@ In general, the MicroProfiler web UI works similarly to [detailed mode](./modes.
135135
- Lighter portions of the preview bar and lighter labels on the timeline indicate portions of the frame with higher memory allocation.
136136
- In X-ray mode, press <kbd>C</kbd> to show the total size of the memory allocations rather than the number of allocations.
137137

138-
- Use the **Export** menu to export a CPU or memory flame graph, a specialized visualization that aggregates all of the call stacks included in the dump. The flame graph is especially useful for identifying tasks that don't take particularly long to run (and are therefore hard to notice), but run so often that their processing time becomes significant.
138+
- Use the **Export** menu to export a CPU or memory flame graph, a specialized visualization that aggregates all of the call stacks included in the dump, maintains the parent-child hierarchy, and sizes them based on duration. Flame graphs are especially useful for identifying tasks that don't take particularly long to run (and are therefore hard to notice), but run so often that their processing time becomes significant.
139139

140-
<img alt="The MicroProfiler flame graph." src="../../assets/optimization/microprofiler/micro-flame.png" />
140+
<img alt="The MicroProfiler flame graph in the web UI." src="../../assets/optimization/microprofiler/micro-flame.png" />
141+
142+
You can also create flame graphs in Studio, although only for scripts (execution time and memory allocations). Compared to the web-based flame graphs, the ones in Studio are top-down rather than bottom-up and support dramatically longer capture times.
143+
144+
<img alt="The MicroProfiler flame graph in Studio." src="../../assets/optimization/microprofiler/micro-studio-flame.png" />
141145

142146
- Drag and drop a second dump file into the web UI to generate a diff flame graph, which can help you identify improvements or regressions to your experience's performance over time. Click **Combine & Compare** to export a new HTML file.
143147

content/en-us/studio/microprofiler/tag-table.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ description: A list of tags for the MicroProfiler.
55

66
The following is a list of common tags in the MicroProfiler, grouped by category. Understanding these tags can help you identify problematic code in your experience. The tables contain tag label, descriptions and performance advice for improving performance and optimizing your experience.
77

8+
## Sleep
9+
10+
When threads aren't actively performing tasks, they enter a sleep state, with tags to indicate how long the thread was sleeping. At any given time, it's extremely common for most worker threads to be in a sleep state.
11+
812
## AI/navigation
913

1014
<table>

content/en-us/studio/microprofiler/task-scheduler.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ The most direct way to add frame-by-frame game tasks is through the following me
3131

3232
The task scheduler categorizes and completes tasks in the following order. Some tasks may not perform work in a frame, while others may run multiple times.
3333

34-
<img src="../../assets/optimization/task-scheduler/scheduler-priority.png"
35-
width="80%" />
34+
<img src="../../assets/optimization/task-scheduler/scheduler-priority.png" />
3635

3736
## Best practices
3837

0 commit comments

Comments
 (0)