Sign In Register

How can we help you today?

Start a new topic
Answered

Define game items in GameSparks

 We want to be able to define different equipment in our game though GameSparks. For instance, we want to define three different pair of boots, which all have different properties. I.e.:


Boot1

- Speed: 3

- Color: red

- IsLeather: false


Boot2

- Speed: 1

- Color: blue

- IsLeather: false


Boot3

- Speed: 2

- Color: brown

- IsLeather: true


I assume we should use properties for this, but I see a few problems with that, at least with the way I've understood properties in GameSparks so far. First of all, the items are going to have quite a lot of different properties. Maybe 50+. We could define a property for each item (one for each boot in the above example) and then add each of the properties there, making sure to type them all the same way, but that seems very error prone. Ideally we'd just want to define the items somewhere and then have a set of properties that we can tweak individually for each item. Is that possible and how? It would be really neat if we could even define 'base items', such as a 'base boot' item and then have other boots inherit certain properties from this one. This is not strictly necessary though, but we really want/need to be able to define these items in GameSparks, so we can change them post-release of the game and even be able to define new items.


Best Answer

Hi Heino, 


You could do it a few ways, first you could have some events setup for inputting this data and modifying it, the events themselves would take some values in and then your cloud code would process it and add it to the collection of choice. You'd use the Test Harness for this method. Another way you could do it is by building a custom Screen, you can read more about creating a custom Screen in our Dynamic Forms tutorial here. As an example of what they can do, you can navigate to the Manage Tab in your game and click on LeaderBoards or Players, these have both been built using our Dynamic Forms, so as you can see they are quite customisable. If you are defining the items in the collection as Virtual Goods, including the shortCode in the collection is a good idea. I can add you to an example game if you'd like to see the Test Harness method of storing and retrieving data in action. If you have any more questions just let me know.


Thanks,

Liam 


Hi Heino,


Your best bet here would be storing this info in a meta collection, if they are going to have a lot of properties, a collection would be easier to manage. You could even set up some custom events for management, adding new items and tweaking values of items already in the collection. You could do all this in preview and then push your changes to live by publishing the snapshot you're working on. If you need any more help with this just let me know.


Thanks,

Liam

Some example/pseudo code would be nice. If we store it in a meta collection, I assume it would mean we'd have to save it in Cloud Code, am I right? The reason we want to do it all in GameSparks is both to be able to change the parameters post-release, but also because it's easier for our client to change these parameters. While I guess we could make them change these things in code, it would just be nice to be able to use the convenient and more intuitive interface of the GameSparks portal. If that's not possible though, we can deal with Cloud Code.
Also, another thing that I forgot to add in my previous post is that all these items should also be defined as virtual goods, so they can be purchased. Again, we can do this manually by just adding virtual goods that has a short code corresponding to the items we define in the meta collection (or where ever we end up defining it), but it would of course be nice if this could be done automatically too.

 

would love some examples too

Answer

Hi Heino, 


You could do it a few ways, first you could have some events setup for inputting this data and modifying it, the events themselves would take some values in and then your cloud code would process it and add it to the collection of choice. You'd use the Test Harness for this method. Another way you could do it is by building a custom Screen, you can read more about creating a custom Screen in our Dynamic Forms tutorial here. As an example of what they can do, you can navigate to the Manage Tab in your game and click on LeaderBoards or Players, these have both been built using our Dynamic Forms, so as you can see they are quite customisable. If you are defining the items in the collection as Virtual Goods, including the shortCode in the collection is a good idea. I can add you to an example game if you'd like to see the Test Harness method of storing and retrieving data in action. If you have any more questions just let me know.


Thanks,

Liam 

You mentioned that you could add Heino to an example game so that he could see the Test Harness method of storing and retrieving data in action? Can you add me to that example game so I can take a look? Thanks!

Login to post a comment