question

Julien SEGERS avatar image
Julien SEGERS asked

Which way for monsters' data?

Hello,

I'm using Unity to build a monster-taming game, similar to Pokémon or Temtem.

The difference is that the tamer (player) also have statistics (e.g. strength, vitality, ...) and a level system.

I'm a bit confused about how I should handle the data in PlayFab. The game is mainly single player but 1v1 battles will take places online.

1) Should the tamer attributes be written in Player => Statistics?

2) Should I use Player Data or Characters for the tamer's monsters team (which also have levels, health, spells, etc...)? Something else?

3) Where should I save the Vector3 position and the scene the player is in or such informations so that it is loaded upon logging in?

Thank you for your precious help!

Kind regards

Player Dataunity3ddataCharacter DataCharacters
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

·
Seth Du avatar image
Seth Du answered
  1. PlayFab Statistics can do the job, but Player Read-Only Data is preferred based on the design purpose. PlayFab Statistic is aimed at recording scores, which will reflect on the leaderboard.
  2. I don’t think it is necessary to use the Character feature for monsters, because Character is a substitute of a player. To manage monsters' data easily, it is recommended to use items. You can use Custom Data in items to store strength, vitality values. Consider Catalog items as C# class while the inventory item is instance. The Custom Data isn’t inherited from Catalog items. This behavior matches the design of Pokémon – for example, the Charmander’s base stat is pre-defined (store in Catalog item Custom Data) while the one that the player catches will have different IVs (store in Inventory item Custom Data).
  3. I believe Player Data is able to store a Vecor3 data since it can be updated by the client. It depends on your requirement to use Player Data, Player Read-Only Data.
6 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.

Julien SEGERS avatar image Julien SEGERS commented ·

Thank you for your answer!

I'm trying to understand how to implement server authority with CloudScript.

For example, I want to send an input that the player choose an attack, but on the server, I want to make sure it's the correct attack/damage etc...

For now, I have:

- an Attack class (which stores the data about an attack: damage, precision, element, etc)

- a Monster class (which contains the monster's stats used to calculate the damage).

I'm wondering for example where should I store the monster's attack, as they are items?

Thank you for your help!

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Julien SEGERS commented ·

May I ask does the game contain PVP contents? There are many solutions for server authority, but it depends on the design of your game. Here is an example from external community: networking - Should damage calculation in a competitive multiplayer game be done client-sided or server-sided? - Game Development Stack Exchange

>>I'm wondering for example where should I store the monster's attack, as they are items?

Please check the 2nd paragraph of my previous answer.

0 Likes 0 ·
Julien SEGERS avatar image Julien SEGERS Seth Du ♦ commented ·

Thank you for your answer.

Indeed, it contains PVP. I will have a look at the link, thank you!

About my monster's attack, sorry I didn't mean the "attack" stat but instead I meant the "skills", "spells", etc... I should have been more precise, sorry!

Should this also be stored in Custom Data?

For now, I have a Monster class which has reference to a list of Spell (another class). I understand that I should use Playfab Items for my monster class, but I don't know where I should "store" my spells class.

0 Likes 0 ·
Show more comments
Show more comments

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.