This (I would think) is a common scenario: Your code needs static data to do some calculations with. This data is not player specific or game specific, but is global and static (it only changes when you release an update). For example: the node graph of a game board.
What is the best place and method to store this data for cloud code?
You could embed the data in the module, but the docs say modules have a 10MB size limit. That’s tight.
Any other places where to store the data? And what does that do to egress/bandwidth costs when the cloud code loads this data on every involation?
Cloud Save via custom items (these should be called “global items” really).
Cloud Code can access Cloud Save storage.
Interesting. The documentation also refers to these as “Game data” which gave me the impression these are intended for data that changes during a game. Of course, you can also use this to store static data.
How does this affect the number of Cloud Save invocations that you pay for? Are Cloud Save invocations by Cloud Code included? (that would mean I pay double, since I also pay for the Cloud Code invocation)
Yep, unfortunately CloudCode calling CloudSave is metered.
You can do writes through CloudCode and reads directly from the client (at least, the web api allows it).
Do mind that this makes quite a bit of sense, because you dont want customers arbitrarily writing “game data”, and often also not “player data”.