question

tombatsford avatar image
tombatsford asked

Questions regarding characters, player_added_title play stream event, same characters for multiple users and shared inventory across player account.

Hi, in the game i am working on currently, all players have access to all of our characters at any time and all of our items are potentially shared across all of those characters. I have three questions about characters relating to this.

1. Because our characters are not user created is it possible to add our characters to each players account as a rule that triggers on the player_added_title play stream event? I intend to use characters to track stats and inventories.

2. Is it possible for the same characters to be added to each users account? same name etc but of course their own instance of each character

3. Is it possible to have a shared inventory across a players account? If i move an item to a characters inventory i am assuming that it removes that item from the users inventory and moves it to the characters? What id like to achieve is using the characters inventories as a record of what they have equipped but still pull all items a user has by using "GetUserInventory" API call.

Thanks!

Player InventoryCharactersPlayStream
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

All instances of characters are unique to the players they belong to, so yes, you can indeed add the same type of character to many players. They won't be sharing a single character record, obviously, but you can certainly use the same definition information for setting up all of them.

For shared inventory across the player account, we would recommend just using the player inventory, rather than having the inventory items belong to the characters.

For item 1 though, the question is, how many characters do you need to create? If it's only two or three, that's not a problem. But if you need to create a lot of characters on first sign-in, you'll need to drive that from the client, rather than a PlayStream action-driven Cloud Script call.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tombatsford avatar image tombatsford commented ·

Ok great, yeah i will be needing to create upwards of 10-15 characters and i am currently trying to do that using a play stream cloud script event, should i be doing this from the client api instead and in that case i will need to add client character creation items?

0 Likes 0 ·
brendan avatar image brendan tombatsford commented ·

Well first, what are all the characters for, exactly? How does the game use characters, and are there other characters the player account might have later? The reason I ask is, that's a lot of characters - and given that the total inventory for the player is the player inventory + all character inventories, having so many does limit how many items each can have.

What I would recommend, if that many is required, would be to do so from Cloud Script - possibly more than one, as part of setup. Key to having effective Cloud Script handlers is doing solid testing and reviewing the time each takes to complete. If they're exceeding 80% of the total time limit, you should really be looking at splitting the logic up.

To be clear, Cloud Script is meant for relatively lightweight operations. If you have a need for frequent calls to run server authoritative actions, you may need to consider moving that logic to a custom game server. There, you could have any level of interaction with the client, with the server periodically updating the service (every minute or so, and at the end of a game session).

0 Likes 0 ·
tombatsford avatar image tombatsford commented ·

My intention is to use characters to record character specific stats as well as keep a record of what items a player has equipped on that character. Equipped items will be stored in the character data and the player inventory used to hold all of a players items, i do not intend to use the character inventory api. If more characters are added it will be to all players when we release a DLC for example.

Thanks

0 Likes 0 ·
brendan avatar image brendan tombatsford commented ·

The character system was originally designed to support the common MMO model where you create one character at a time, hence the reason the API calls are set up that way (that, and the fact that bulk creation of characters would be a fairly expensive operation). If you're using a custom game server, you could do all the setup for the player's characters the first time they connect. Otherwise, you'll want to do that via Cloud Script, and only do some of the work on each pass. One possibility would be to simply show the player all the characters as if they were set up on the account, but only truly "instance" them in the player account when the player clicks into one for the first time.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.