question

Steve Cawood avatar image
Steve Cawood asked

Allowing players to name characters?

Hi, I'd like to allow players to name characters in my game when they're the first player to discover them in game.

Is there any features of Playfab I could use for this purpose? I was looking at Title Data but it seems I cannot allow a player to update the information?

Thanks

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

·
pfnathan avatar image
pfnathan answered

Please take a look at the discussion on Changing Character Name here: https://community.playfab.com/idea/642/208256098-Changing-CharacterName.html

5 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.

Steve Cawood avatar image Steve Cawood commented ·

Hi, thanks for your reply but I'm not talking about the players own characters I'm talking about random characters in the game world. I was thinking of having some json with the characters referencing the keys and the player can enter a name for the character once he/she meets it. Then the other players load the data when the game starts:

Something like this?

{"char01":"User name here"}

0 Likes 0 ·
pfnathan avatar image pfnathan ♦ Steve Cawood commented ·

The characters are owned by players and we don't let other players modify properties of another player currently without some sort of "Shared" store like leaderboards... and since characters are just related to players you can't really do anything with someone else's player with that in mind, in your case, using Title Data via CloudScript is probably the only acceptable option. Will get more on this and get back to you.

0 Likes 0 ·
pfnathan avatar image pfnathan ♦ pfnathan ♦ commented ·

Update: To manage concurrency control so you can actually see who "won" in a naming race you should use title entity objects and use the version number argument to verify that only one update is being made at a time.

0 Likes 0 ·
Steve Cawood avatar image Steve Cawood commented ·

OK, thanks. I guess i have some reading to do!

0 Likes 0 ·
brendan avatar image brendan Steve Cawood commented ·

Allow me to clarify. What you are describing is having NPCs in your game which are not owned by any player, and you want to let the players update those characters. Please do not use Title Data for this, as that will not work. Title Data is a sharded and cached resource, so that all players in your game can query it quickly. It must never be updated by a client-driven action, as that could result in many attempted updated of the Title Data at the same time - which it is not designed for. Title Data should only be updated occasionally, and only by a title-level operation. The ability to update Title Data via the Server API is specifically to enable non-segment Scheduled Tasks to update Title Data to start or stop events or make other configuration changes to the game using a title-level task.

The Entity data model Nathan pointed you to is the one to look at using, for your use case. Each NPC would be an Entity in the service, and the players could attempt to update them that way.

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.