Inventory Doc Review#103
Conversation
mhijaziB
commented
May 22, 2026
- updated inventory with code
- added inventory federated doc
- updated inventory with code
allister-beamable
left a comment
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
For tech writing, I am a big fan of "perform" in place of "do" -- makes it sound techy without being too professorial ;)
| 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" | ||
| } | ||
| } |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Whenever possible, using "the Beamable [thing]" instead of "our [thing]" lends it a nice tech-writing air.
| 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Generally prefer "for example" rather than "e.g." in prose, including bullet lists (reserving "e.g." for horizontally constrained spaces like table cells).
|
|
||
| {: style="height:auto;width:500px"} | ||
|
|
||
| ---------------------------------------------------------------------- |
There was a problem hiding this comment.
Totally not a big deal, but, could this be shortened to just a triple-dash? --- makes a horizontal rule in Markdown, right?
|
I will wait for the rest of the reviews, change based on feedback and then merge |