I'm very new to BaaS and Game Sparks entirely, but I've searched the forums and am only getting glimpses of the proper way to handle this.
In my scenario, I have approximately 16000 tiles that can be edited by the players. So of course, in the first time a player plays, I want to set these tiles to a certain default value. This should call some initialized data set that gets sent to the client to initialize the types of tiles. Then every time the player changes something, I want to update those values on the server. Then just load the newest one every subsequent play.
Tiles only need a few details:
int id;
int terrainType;
int tileType;
bool locked;
What is the proper way to store 16000 sets of this type of data structure?
Best Answer
C
Customer Support
said
almost 4 years ago
Hey Jon,
There isnt too much wrong with with method, but i would keep aware that the size of the response is limited to 4MB so you might have to paginate the request.
You also do have a recommended limit to the data-per-player you can store based on our fair-use policy.
Other than that, its easy. Just create an event to request the data and store the data in a document with the playerID so it looks something like this....
Is this 16000 tiles per player ? So a players stored data would amount to these 16000 documents associated with their account and they edit these over time during gameplay ? Or do you mean 16000 shared between the entire player base ?
Thanks,
Liam
J
Jon West
said
almost 4 years ago
The map is unique to each player. Basically, imagine a game like Township where you can change the maps tiles from grass to dirt or add a street etc. that map is unique to that client. A 2d array of a struct would work but that's a lot of data on the device plus I want it to persist, not to mention trying to keep it off the client so locked tiles that shouldn't be edited need a final say from the sever.
What's the proper way to handle this?
Customer Support
said
almost 4 years ago
Answer
Hey Jon,
There isnt too much wrong with with method, but i would keep aware that the size of the response is limited to 4MB so you might have to paginate the request.
You also do have a recommended limit to the data-per-player you can store based on our fair-use policy.
Other than that, its easy. Just create an event to request the data and store the data in a document with the playerID so it looks something like this....
Jon West
I'm very new to BaaS and Game Sparks entirely, but I've searched the forums and am only getting glimpses of the proper way to handle this.
In my scenario, I have approximately 16000 tiles that can be edited by the players. So of course, in the first time a player plays, I want to set these tiles to a certain default value. This should call some initialized data set that gets sent to the client to initialize the types of tiles. Then every time the player changes something, I want to update those values on the server. Then just load the newest one every subsequent play.
Tiles only need a few details:
int id;
int terrainType;
int tileType;
bool locked;
What is the proper way to store 16000 sets of this type of data structure?
Hey Jon,
There isnt too much wrong with with method, but i would keep aware that the size of the response is limited to 4MB so you might have to paginate the request.
You also do have a recommended limit to the data-per-player you can store based on our fair-use policy.
Other than that, its easy.
Just create an event to request the data and store the data in a document with the playerID so it looks something like this....
This way you can query for the player's maps and get the tiles down to the client in whatever order you want.
Does that help?
Sean
- Oldest First
- Popular
- Newest First
Sorted by PopularJon West
Customer Support
Hi Jon,
Is this 16000 tiles per player ? So a players stored data would amount to these 16000 documents associated with their account and they edit these over time during gameplay ? Or do you mean 16000 shared between the entire player base ?
Thanks,
Liam
Jon West
Customer Support
Hey Jon,
There isnt too much wrong with with method, but i would keep aware that the size of the response is limited to 4MB so you might have to paginate the request.
You also do have a recommended limit to the data-per-player you can store based on our fair-use policy.
Other than that, its easy.
Just create an event to request the data and store the data in a document with the playerID so it looks something like this....
This way you can query for the player's maps and get the tiles down to the client in whatever order you want.
Does that help?
Sean
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics