Sign In Register

How can we help you today?

Start a new topic

Managing and retrieving game's custom data

Hello,


I have 3 technical questions regarding global data.

The game is essentially a simplified version of pokemon go + diablo 3.

There are monsters and gold spawning around the world and there are gyms to be fought and "own".


On the unity client end, I have a scriptable object that I reference from for my spawning algorithm.

The client will then use these information and spawn objects accordingly without needing anything from server.

However, when player tap on the gold they found on the map, I need the server to verify that the gold exist at that location at that time and how much gold did the player find in order to reward player properly and check for hackers at the same time. Or I have like a 100 list of equipments and I need the server to reference them in order to do the combat resolution on server I do that?


1) I want to be able to access a global data type (hopefully a scriptable object type) from cloud code in order to generate the algorithm

2) I wanna be able to maintain that data type from gamesparks itself, so I'll either need to check the version number and ask player to download these global variables or send it to player each time the player logs in or have a invalid request. Which one is better? and where can I find the resources to code it?

3) I have a pokemon gym related sort of feature, and each gym has their own ID how can I track the gym information (like the gym owner's ID and what's their information)


I have been looking through the documents for awhile and didnt quite find the solution..

I don't expect spoon feeding and it'll be great if you can just point to me where should I look for. 


Thanks alot!


Cheers,

KC

cs
(686 Bytes)

Hi, there.


As far as I know, you can't directly use Unity ScriptableObject in GameSparks and only way is unmanageable downloadables, if you insist to use the data type, but GameSparks downloadables storage is limited.


For versioning data, if you are thinking of using unchangeable data during service, go with Meta collection with version property. You can make event with taking current collection version as a parameter from client to check whether documents in collections is necessary to download.


If you want to use changeable data  during service, only way is probably with Runtime collection that can be updated during live and is perfect(and only as far as I know) to store shared data between users. I used to put timestamp for updating documents in Runtime collection to query to get updated document within required time period.


Last idea I can think is Properties. But it's also not editable in live.


Hope it can help you bit.


Danny

Hi Danny,


Thanks alot for the reply! Appreciate it sincerely.

You gave me an idea of the difference between meta collections runtime collections.

It's quite sad that gamesparks don't have tools to import or export scriptable objects, as they have become such an essential part of unity development.


Having said that, I'm sure they have a way to create data types and an easy way to store some design values right?

Take this for example:


Equipment [Randomed stats] contains:

1. Name (ID)

2. Attack (Ratio)

3. Attack Speed (Ratio)

4. Level


Equipment Design Variables [BLUEPRINT] contain:

1. Name (ID)

2. Base Attack Range

3. Attack Speed Range

4. Attack increment range per level

5. Rarity


Equipment Design list contain a list of Equipment Design Variables.

If player defeats a monster and sever needs to return a randomly dropped equipment, the server will need to randomize the stats and return to player accordingly.


Where can I create and store these data types?

How can retrieve these information?


I'm sorry if I seem to require alot of spoon feeding.. but this is my first time setting up a "server"..

I need to find an equivalent of scriptable object for the blueprints of different data type and manage them properly on both client and server and how to use them effectively..


Cheers,

KC

Not quit sure of your data types. 


But if you have default data from equipment, you definitely need to store it in meta collection. 

And when a equipment is created as a reward for defeating monsters, it can be created based on default data in meta collection. Then store the created equipment data for the player either in the document of runtime collection with noting ownership of the equipment by storing user id or something. Or add to the scriptData of the player document in System collections. 


Maybe you want to hybrid both which means only stores equipment ids in Player's scriptData and actual data in runtime collection.


It's just quick thought.

Alright I'll try it out.


Thanks alot!

i've created game data editor in Unity which stores data in scriptable cobjects/assets and creates JSON text to import in metacollection. on game connection to server it calls for event which send game data to game. game it appends clients scriptable objects with server data. so i have two collections of scriptable objects: one to edit and one to play. you can also fill a scriptable object with data generated on server... but then you shoul thing how to store that data on server: there are several ways to do it.

Cool Gregory, I ended up writing a scriptable objects exporter to export json into gamespark haha. The game is progressing very slowly so I haven't reach the state where I need to automate the importing to game process yet :). Thanks for replying though.. I wanted to ask the support about this but i ended up posting in the forum instead haha.

Login to post a comment