Sign In Register

How can we help you today?

Start a new topic

Store game config

Hi!

 

For hero stats in my game I use NoSQL collection with several entries:

{

 "HeroName": "name1",

 "Helth": 100,

 "Damage": 10

}

{

 "HeroName": "name1",

 "Helth": 100,

 "Damage": 10

}

 

For data like "Level", "Enemies" I'm also use collection with many entries.

 

Now I need to store configuration for game. For example Default player or initial balance;

 

What the best approach to do that?

 

I read about Properties, but in documentations written that Propertyes uses for Virtual Goods, Achievements, and Leaderboards.

Now I store it in Collection with one entry, but a guess that isn't best solution.

 

Could you please clarify?


Hi Alexey,


You could store default stats in a metaCollection and then reference them when a player Authenticates. You could also place this default stat code in your AuthenticationResponse or RegistrationResponse, then check if the player is a new one and if they are, insert the default stats into the custom runtime collection for that player and update it from there on. Does that sound like it might work for you ? if you have any further questions just let me know.


Thanks,

Liam

Hi Liam!


Thanks for your answer.

Yes it works for me, and  I convinced what I'm on the right way.

Last question.... I have some config collections as well

For heroes:

HeroLevels

{

 "Lvl": 1,

 "RequiredExperience": 0,

}

 "Lvl": 2,

 "RequiredExperience": 200,

}

For Chests:

Chests

{

 "ChestType": 0,

 "Time": 1

}

{

 "ChestType": 1,

 "Time": 10

}

And three or five similar collections.

All of this has a small number of entries.

What the best approach:

1. Split it in one collection or

2. Separate by logical meaning to several metaCollection.


In other words, does Spark.metaCollection() request cost alot or I can use it in one script several times for each collection?

Login to post a comment