question

Ben avatar image
Ben asked

Writing reasonably sized CloudScript

We have a game that relies heavily on CloudScript to handle metagame/economy logic. Over time, the CloudScript JavaScript file has gotten fairly large (3K lines) and we expect it to get significantly bigger over time. There are also a couple utility JavaScript libraries we would like to include (an advanced math library for example) that would also significantly increase the size.

Under normal circumstances, we expect about 4-8 CloudScript calls per minute, per player, while they are in the metagame.

Our entire metagame is also computed on the client for responsiveness, so execution times of 1-2 seconds are acceptable for us.

What we're wondering is, could this be a problem down the line? Does PlayFab have to do a lot of work to spin up huge javascript files for every CloudScript call?

Thanks

CloudScript
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The way the logic service (Cloud Script) works is that one or more servers are going to have your script loaded, depending on the concurrent user level and frequency with which they're calling into the script. The resource requirements for other titles are part of this as well, but for a popular title that has each player calling a script every minute, it's likely you won't have a period where there's no logic server that has your script loaded. So no, we wouldn't expect there to be any issues due to the size of the script.

1 comment
10 |1200

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

Ben avatar image Ben commented ·

That's great to know, thanks!

0 Likes 0 ·

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.