Hi. In my case I need to store images of the levels of the game on the server in order to validate the player movements. I would also need to store the players positions and share them with each other. I know that I could use a metadata/runtime collection with 2D Indexes for these purposes, but storing images encoded with base64 seems incredibly wasteful and expensive to me. Same with updating dozens of JSON documents every second or so.
So are there plans to support inserting and manipulating binary array's into the database?
There are several studios using the platform to manage much of their game's binary data and there are a few different patterns depending on what you are trying to do. In order to recommend the best approach to you we do unfortunately need to know a little more about what you are trying to do so am happy to take offline if you prefer?
We need to get a better understanding of what visibility players have of other players. For example, can all players see all other players location or will you limit to sub-groups within the game? If the entire game is open then I can understand why you are thinking of using an array.
So sorry I can't be more helpful at this point. If you send me more details (firstname.lastname@example.org) I will get our team to look at it and recommend an approach.
Ahh okay I'm trying to be more specific. The above was just an example. Maybe this is just a fail on my part, if so please move this to a more fitting sub-forum like Q&A.
Lets assume I'm trying to build a game where all players move in a 2D world. They should see each other but only if they are relatively close to each other. Enemies should appear based how close a player is to them. The type of enemy is determined by the environment of the map. Pretty much like old JRPG's, but multiplayer.
Sending the media files to the clients is handled somehow externally.
So technically upon a player requesting a new enemy to be spawned I would lookup his position in a metadata collection containing tiles of the game world. The tiles are 2D indexed documents in the nosql db. These would need to store information in which areas of this tile which enemies spawn. I only need to know the information about one specific point on the tile at a time. I need represent this information using a 2D array of values.
I would also store the players positions in tiles of the map. These would be structured like a simple list containing the players position, name, level ...
My problem is now that that in both cases I do not know how I should efficiently store and
retrieve the binary array for each tile. As I understand using a JSON
array containing the values would not store the array but rather a
string expressing the array. I could encode this array somehow using
algorithms like base64, but this still is really wasteful and increases
computation time needed for a read operation.
Given relatively small maps these those performance considerations do not really matter, but in my case my map currently consists of a few million tiles. This is why i would like to have some more efficient way to represent data in collections. especially for the first problem with static data. I do not know however if this is even possible with the underlying windows azure system.
Thank you very much for your quick answer. I hope this post was less confusing.
The underlying database we use is Mongo and it stores and manages all its documents in binary so we are not completely sure what the issue is? You won't need to do any additional encoding.
If you give me an example of the data you want to store and retrieve I will have one of the team put together an example for you. Can do offline if you prefer.