Skip to content

Inventory Doc Review#103

Open
mhijaziB wants to merge 2 commits into
unity/v5.0from
review/inventory
Open

Inventory Doc Review#103
mhijaziB wants to merge 2 commits into
unity/v5.0from
review/inventory

Conversation

@mhijaziB
Copy link
Copy Markdown
Contributor

  • updated inventory with code
  • added inventory federated doc
image

- updated inventory with code
@mhijaziB mhijaziB requested a review from cdhanna May 22, 2026 17:54
Copy link
Copy Markdown
Contributor

@allister-beamable allister-beamable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor questions and style suggestions, none major enough to prevent merging (though I guess deciding on "inventory-federated.md" vs. "federated-inventory.md" is worth choosing before going live, as that informs public facing URL paths)

From my perspective, I would be fine with any of the following:

  • you merge it exactly as it is
  • you fold in changes based on my feedback and merge it immediately
  • you adjust based on feedback and re-request review

Up to you! We can always massage stylistic stuff later.

@@ -0,0 +1,150 @@
# Inventory federated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phrasing/branding question: do we want to call this "Federated inventory" or "Inventory federation"? (in the latter case, I think "federation" reads slightly better than "federated")


## Overview

Beamable supports custom inventory federation using managed [microservices](../../cloud-services/microservices/microservice-framework.md). You can use this service to extend the Inventory system with items that are managed externally.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth mentioning NFTs here? I see that you have them in the bullet list below, so maybe not needed in the prose intro, but it might clarify "why federate inventory?" to lead with it as early as possible.


Some use cases:

- Crypto assets - use NFTs as inventory items and auto-mint new items
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there public connotations on the word "Crypto" that we could dodge by saying "Blockchain" instead? I am not super tapped into the scene, but I feel like I have heard "Crypto" spoken in the tones of a not-so-nice epithet. Probably not a big deal, either way.


public Promise<FederatedInventoryProxyState> GetInventoryState(string id)
{
throw new System.NotImplementedException();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the implementation of inventory-related stuff is the meat and potatoes of this article, so having a skeletonized version here is a bit of a distraction. Could the sections below stand on their own without this block of code?


### `GetInventoryState` implementation

You can do any custom logic here. For example, you could AI generate some items, load items from a smart contract, use microstorage, or do anything that satisfies your specific requirements.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tech writing, I am a big fan of "perform" in place of "do" -- makes it sound techy without being too professorial ;)

Comment on lines +80 to +112
new()
{
proxyId = "externalAvatarId1",
properties = new List<ItemProperty>
{
new()
{
name = "level",
value = "20"
},
new()
{
name = "color",
value = "blue"
}
}
},
new()
{
proxyId = "externalAvatarId2",
properties = new List<ItemProperty>
{
new()
{
name = "level",
value = "30"
},
new()
{
name = "color",
value = "red"
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to make this take less vertical space? My eyes kinda glaze over when I see long stretches of sparse vertical code 😇

}
```

The `transaction` argument is a unique transaction id generated in our Inventory service, and you can use it to guard against multiple submissions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever possible, using "the Beamable [thing]" instead of "our [thing]" lends it a nice tech-writing air.

Comment on lines +142 to +144
If your transaction processing is too slow to return a timely response, you can implement the async approach.
Process the transaction in the background and return the current state. Once the transaction finishes processing,
you can report back the new state like this:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What techniques should the game developer use for this? Simply omit the await keyword when invoking an async function? Use the Job Scheduler? Something else?

- Add/Remove inventory items to the active player during the course of gameplay. Ex. the player earns a new "Sword" inventory item based on in-game progress
- Add inventory items to the active player via the Beamable [Store](stores-overview.md). Ex. the player pays real money to buy a new "Sword" inventory item
- Add/Remove inventory items to the active player during gameplay. e.g., the player earns a new "Sword" inventory item based on in-game progress
- Add inventory items to the active player via the Beamable [Store](stores-overview.md). e.g., the player pays real money to buy a new "Sword" inventory item
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally prefer "for example" rather than "e.g." in prose, including bullet lists (reserving "e.g." for horizontally constrained spaces like table cells).


![Portal Inventory Overview](../../../../media/imgs/portal-inventory-overview.png){: style="height:auto;width:500px"}

----------------------------------------------------------------------
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally not a big deal, but, could this be shortened to just a triple-dash? --- makes a horizontal rule in Markdown, right?

@mhijaziB
Copy link
Copy Markdown
Contributor Author

I will wait for the rest of the reviews, change based on feedback and then merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants