question

Dave W avatar image
Dave W asked

Development workflow within PlayFab

Hi,

I was looking for some information on how we can better integrate our development flow within PlayFab. For reference, we've used PlayFab before for a game and it worked fine but it was a single server developer and a single client developer on that team. In our last project that we launched with GameSparks, we had 2-3 server devs and 5-6 client developers and the normal workflow was very error prone and difficult to make changes with that size of team.

For that process, we developed the following flow:

  1. We had 3 main GameSparks instances, development, QA and Production.
  2. Development would be our current sprint workload while QA would be under testing (and fixes for bugs found) while Prod would be essentially what's on our "master" or "release" branch.
  3. If a feature was to be developed, we'd create a branch off of development, and we'd also spin up a "branch" GameSparks instance. Once the feature was tested and validated, it'd be merged back into the main code then pushed to our GS Development instance for client side work.
  4. Everything that made up our GameSparks instances (IAP, Vgoods, Cloud Code, etc) was all in JSON configuration files that we kept in version control, and all our cloud code was written in TypeScript. This allowed us to maintain and monitor our server development process through pull requests and merging, not accidentally changing live code via the cloud code process.
  5. What enabled this was a CLI tool I created to dynamically spin up new instances and configure via their REST API, in addition to compiling the cloud code to their JS compliant code and upload.
  6. Additionally, we built in a testing system to allow us to run unit and end to end tests on our server side API.

    The questions I have specifically are:

    Does PlayFab have the ability to emulate this sort of process? I know we can manage cloud code, title data, virtual currencies, create scheduled tasks all programmatically, but is there a full coverage to do these things via the admin API? The things I see that may be missing right now are the ability to add rules, adding / changing segments, etc.

    Are there mechanisms for end to end or unit testing? Specifically something to emulate a setup and tear down process around the game data.

    Is there the ability to automate spinning up a new PlayFab instance with a REST API or something like that?

    The process we used while developing with GameSparks dramatically improved our server dev speed and reduced errors, and I'd love to be able to make the same thing work within PlayFab for future games.

    Thanks!
    Dave

    apisCloudScriptdata
    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

    Sure thing. Here are the recommendations for your specific questions (and this is the blog post I'm referring to below - https://blog.playfab.com/blog/upcoming-roadmap-2019-q1-jan-march-edition):

    In general, developers use separate Title IDs for dev, test, and live. If you want complete separation between them (not sharing the Master Player Account), create separate Studios for each.

    One feature we're working on right now (called out in the blog) is the ability for you to create a "snapshot" of a game - all its configuration data, including catalog, title data, etc. - so that you can copy/paste that onto another title you have (or use it to rollback to a previous, known-good configuration). That configuration will be something you'll be able to download, and will also be in a standard format (JSON), so that you can use it the same way you describe.

    Much of your title in PlayFab is configurable via the Admin API. The exception would be some of the PlayStream components (the items you called out). We're working on providing API endpoints that will allow you to manage all of that as well, but for now you would need to update those via the Game Manager.

    For testing, there's a pretty fundamental difference between the way our services were designed. In PlayFab, you do not control the queries directly. You have API endpoints that allow you to query and update data, using queries we designed and maintain (we've updated a few times over the years, to optimize for performance as the MAU level has increased steadily). So in general, the concept of unit testing is really only applicable to the client or server code you own. The one exception would be Cloud Script, for which we do not have robust tools for test and debugging, currently. We are working on an update to provide you with the ability to use Azure Functions in PlayFab however, which will provide for this.

    The fundamental design of PlayFab also means there's no such thing as a "new PlayFab instance". PlayFab is a single instance for which we are your DevOps team. We manage the service health centrally, with the service supporting literally thousands of live titles at far over 100 M MAU. The titles are securely separated so that no title has access to another title's data (except where you specifically enable it within your studio, via something like player publisher data). That's how we're able to keep our pricing low, and provide a free tier - everyone gets the advantage of economy of scale.

    10 |1200

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

    Hernando avatar image
    Hernando answered
    • Does PlayFab have the ability to emulate this sort of process?

    Yes, most of the data in the title can be manually exported as a JSON file via Game Manager. You can try to create multiple titles and implement the workflow as you said by exporting and importing the configuration file. Besides, you can also use some tools, such as UB_Uploader project within our PlayFab Official Demo – UnicornBattle, to help you upload configuration files to the title.

    • I know we can manage cloud code, title data, virtual currencies, create scheduled tasks all programmatically, but is there a full coverage to do these things via the admin API?

    Admin API covers most PlayFab features and keeps updating. If you have any needs, but PlayFab has not yet provided a solution, you can send a thread on Feature Requests forum, and more votes from other users with the same demand can help with the priority. I would also recommend checking PlayFab Blog for features.

    • Are there mechanisms for end to end or unit testing?

    PlayFab offers a complete Postman collection for use in testing the PlayFab APIs. You can call API in this tool that shows you the specific response data and any error messages is a powerful way to debug those calls. For more information please see this: https://api.playfab.com/docs/tutorials/execute-playfab-api-via-postman

    For unit testing, in client development, PlayFab has no restrictions on it, you can choose any unit-testing framework on your platform (e.g. NUnit on all .Net languages).

    • Is there the ability to automate spinning up a new PlayFab instance with a REST API or something like that?

    If you mean want to setup a new title, you can refer to the first paragraph and UB_Uploader.

    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.