question

Nick Koufou avatar image
Nick Koufou asked

Clould Script access to Content

Hi,

I have a set of game metadata in JSON files that describe things like level information, character information etc. These over time will get rather large in size so it makes sense to use the Content API for access rather than Title Data.

Plan is for the client to download these and cache them locally until they are evicted from the cache for whatever reason.

Now what happens when cloud script needs access to the same information? (security, end of round arbitration etc). What would be an optimal way of making that information available to a script (should I be making a GET request? declaring as string constants?)

 

Thanks in advance

Nick

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

First, I should highlight that the Content service is a CDN (AWS CloudFront at the moment), so please bear in mind that it's not part of the free service. Not that it's expensive by any stretch of the imagination - have a look at the AWS CloudFront pricing for specifics (we pass on the cost with a 10% addition, to cover our costs). So if your data would fit in Title Data, that's probably a better option.

For use with Cloud Script, I would have to recommend using either Title Data or constants in the script itself. If you have a large amount of data that all needs to be available to each script, it may be that your needs are complex enough that you should be considering using custom game servers. Alternately, depending on your timeline, our upcoming Parse migration kit may provide additional options.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Koufou avatar image
Nick Koufou answered

Good point on CDN costs. How are you guys billing free tier for using this? (I don't have a credit card on file). Long term CDN will be unavoidable, especially when I start using binary/image data. 

Declaring as constants would probably be the most straight forward way, I would then need to figure out a neat way of injecting that information into the cloud script file without having to copy and paste all the time. BTW can you confirm if support for multiple cloud script files is available? It would be an epic mess otherwise if everything needs to be in the same file.

Thanks

Nick

 

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

For Content, we're sending out monthly billing statements right now - you're absolutely correct that we need to get that integrated into our billing system.

Multiple cloud script support isn't available right now - it's something we're targeting for post-GDC. We do have GitHub integration, which helps make things simpler, and our upcoming Game Manager refresh will provide some additional help with this, but our big changes for multi-file and local debugging are a little ways out.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Koufou avatar image
Nick Koufou answered

Ah ok, thanks for clarifying on the multi file support. Slapping 1000s of lines of JSON in a single file as well as code is probably not the best way to go at the moment. Cherry picking what I actually need and storing into Title Data is probably best.

Nick

 

 

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.