Search Unity

Official Unite Now - Using Game Foundation to Quickly Build Common Game Systems

Discussion in 'Game Foundation' started by AskCarol, Jun 23, 2020.

  1. AskCarol

    AskCarol

    Joined:
    Nov 12, 2019
    Posts:
    234
    Unite Now Session
    Readymade economy systems that are flexible and extensible can really speed up your game development. In this demo, learn how to use Game Foundation to integrate an item store in less than 30 minutes.


    When
    Thu, July 2, 10:00 AM PT


    Where
    You can watch the session here!
    Make sure to sign up to get access to all Unite Now content.


    ______________________


    A team of product experts from across Unity will be available during and after the session. Our Community team will continue to field questions to foster an ongoing discussion with the community. Please feel free to ask your questions in this thread.


    Some basic rules

    • Only questions related to the topics of the session are permitted.


    • All questions will be fielded by our Community Managers (@LeonhardP and @AskCarol)
      • Replies will have to be approved by the moderators to show up in the thread.


      • Once approved, the questions will be forwarded to the relevant experts.

    We really look forward to hearing from the community.

    Thank you!
     
    Last edited: Jul 2, 2020
    erika_d and mingz-unity like this.
  2. bghnoodles

    bghnoodles

    Joined:
    Apr 12, 2020
    Posts:
    1
    Hello! This is amazing.

    I was wondering if it's also possible to set this up without Chilli Connect? (I'd like to avoid $49/month). Is there an alternative to that?

    Thank you very much!
     
    P_Jong and AskCarol like this.
  3. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    Hi there, great video. Looks really fun to use. One question I have though; is this meant to be able to function as a stand alone item database? I ask as all items seem to be defined in inventory. Yet in most games there usually have multiple ways to add items to your inventory (killing enemies, completing stages for example). Am I missing something, or do these items need to be coded into whatever "drops" them to then add them to the Game Foundation inventory Dynamically at run time?
     
    AskCarol likes this.
  4. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Hi @bghnoodles - thanks for reaching out to us with your questions. Today we provide ChilliConnect adapter as an out-of-box implementation of the backend support capabilities that Game Foundation can provide.

    Depending on the backend / cloud options you want to go with, you can use the ChilliConnect adapter as a reference implementation to adapt it to your own needs, for the cloud / backend choice you want to go with. The overall design of the data layer in Game Foundation is flexible, so it won't prevent you from supporting another backend, but the overall amount of work may be non-trivial, depending on how familiar you are with backend development.

    We understand that this service (while now being owned by Unity) doesn't have a free tier yet, and we do have a better option for developers that's coming very soon, once we're ready to announce it. In the meanwhile, if there's anything specific we can come help you, please let us know. Thanks again for checking out Game Foundation.
     
    P_Jong and erika_d like this.
  5. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    @ItzChris92 thanks for your question -

    I'd need to understand a bit more what you have in mind and what you mean by 'standalone item database' more, but for your comments, yes there could be many parts of your game system that the inventory system we provide would have to interact with. Most can continue to be implemented as is, and for things that you want Game Foundation to help manage, we currently ask you to define those item concepts inside Game Foundation, as some type of database, so that our system can manage those concepts completely.

    Then at runtime, if in your game there're multiple ways to change the inventory, you can then simply use the API we provide to add / remove items, and to subscribe to item updates too. Do you feel that there're any specific limitations you run into with such integration workflow?

    To your later part of the question, you don't necessarily need to define the 'sources' of those item 'drops' in the game foundation database, if those concepts don't need to be managed inside the inventory system we provide. These can continue to live inside your own custom gameplay logic, and interact with the API we provide to make changes to the inventory system at runtime.

    Does this explain how you can fit Game Foundation into your project better? If there's any specific challenges you run into we're happy to understand a bit more and see how we can help. Thanks.
     
    erika_d likes this.
  6. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    Thanks for the reply. You've kind of scraped on what I was getting at, but allow me to explain further. Apologies if I was unclear in my last post. My main question is how does an item exist outside of the players inventory if that is where it gets defined? Or is it the case that all items get defined in the inventory but they aren't actually "in" the inventory until you add them (either via a store or by other means)? I hope this was a little clearer.
     
    erika_d likes this.
  7. ShawnFeatherly

    ShawnFeatherly

    Joined:
    Feb 22, 2013
    Posts:
    57
    It sounds like Game Parameters does everything https://unity.com/remote-config does, plus more. Does Game Foundation use the same framework as Remote Config?

    Remote Config does not allow local config. Understandably so. Does Game Parameters allow local config? In other words, can Game Parameters also replace PlayerPrefs? Cloud-sync would likely have to be turned off for that to work. Maybe I'm thinking about Game Parameters the wrong way?
     
  8. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Thanks for the additional explanation @ItzChris92 -

    Yes today the inventory items you defined are managed inside Game Foundation, and they are not supposed to live outside of that, i.e. the item instance once removed from inventory should be discarded.

    Of course when an item is not granted to the player yet, it may not exist at all at runtime, and the instance can be created by the inventory system as well when you reward them.

    So let's focus on the scenario when the item exists during gameplay but could be outside of the inventory container: depending on your use case, you can flag items as being in one state vs. anther (e.g. inside player inventory vs. on the ground to be picked up), so that they can continue to be managed by Game Foundation for all the data persistence benefits. For flagging that state, you can use tags to label them if it's just a simple categorization of different locations for these items, or use mutable properties if you need additional runtime meta data to indicate their location, etc.

    Either way this should allow you to continue having access to that item, even if conceptually in your game the item is 'out' of inventory while from the Game Foundation perspective it's still 'in' the inventory.

    Hope this helps. We do recognize there's scenarios like this that could use a more flexible system that goes beyond a specific player inventory management, and the lifecycle of such items living outside of inventory system. A new Collection API is being designed for that purpose. In the meanwhile, let us know if the above approach could work with your need, or you need some more help. Thanks.
     
    erika_d likes this.
  9. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    @ShawnFeatherly Thanks for your questions -

    Yes with Game Parameters today you can use it for a lot of the remote config use cases already, while we also plan to leverage that for the built-in configuration of Game Foundation itself. Today there're still some advanced features you can do with Remote Config that Game Parameter is not addressing, for things like a/b testing and conditional settings. So if you need those features, remote config may still be a better option.

    The gap between Game Parameter and Remote Config may be narrowing, as the team is currently working on the integration of DeltaDNA that will bring a lot more power to Game Parameter, allowing experimentation and arbitrarily complex rules for setting personalized values for a given set of players. With that, it may be a matter of your personal preference which solution to go to. Over the mid/long term, we are also looking into plan to support Remote Config Service as a backend target option, so these solution could ultimately converge as well.

    Also to your second part of the question: yes Game Foundation supports local settings and offline projects like you said. Cloud sync and catalog live update (remote config) are a bit different though, and here's how you can think about these:
    - cloud save (or cloud save, remote data persistence) is for storing game state at runtime that need persisting, for things like the quantity of items, any progress the players have made, etc.
    - catalog sync (including Game Parameter but also other catalogs you create in Game Foundation) are more 'static' content that doesn't necessarily change during runtime, but developers may want to push updates to the client remotely, for example changing the price, or introducing a new item.

    So these two are a bit different. Game Foundation today support both scenarios, and the Game Parameter feature is more related to the second scenario (catalog sync, since whatever you define are static settings, just like what you would store in a ScriptableObject but it's remote updatable).

    Hope that answers your questions.
     
    erika_d likes this.
  10. Flynn_Prime

    Flynn_Prime

    Joined:
    Apr 26, 2017
    Posts:
    387
    Thanks for the reply. I'm glad you mentioned collections are being worked on. I think it is just terminology throwing me off. If someone says inventory I automatically assume this contains all of the items the player actually has, rather than definitions for all the items the player could have.
     
    erika_d likes this.
  11. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Thanks @ItzChris92 for your feedback on naming as well - sounds like us calling it Inventory could be a bit limiting on the use case then what the system could be capable of handling.
     
    erika_d and Flynn_Prime like this.
  12. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
    Are there plans to have a Firebase adapter?
     
  13. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Hi @Thygrrr - we don't have an adapter for Firebase at the moment. What are the use cases you are looking at for potentially using GF and firebase together?
     
  14. BetaMark

    BetaMark

    Joined:
    Sep 27, 2014
    Posts:
    229
    Thank you so much for the videos and the answers to people's questions here already.

    What is the "Ecosystem" mentioned right under the Game Foundation system in the attached slide?

    Will Unity be directly building their future "Game Systems" in that ecosystem (along side inventory manager, wallet manager, etc), or is the Ecosystem meant for developers creating assets for the asset store to be able to be compatible with Game Foundation's architecture and underlying data models?

    (edit: fixed my broken image)
     

    Attached Files:

    Last edited: Aug 2, 2020
    erika_d likes this.
  15. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Hi @mccorkle - thanks for reaching out.

    Here by 'ecosystem' we mean more broadly, i.e. outside of the direct contribution of the Game Foundation team, but could be other unity teams we collaborate with, and third party contributions including the asset store you mentioned.

    And to your question on the future 'game systems' - the Game Foundation team will introduce more systems in the future aiming at the common use cases, while we also open for ecosystem contributions to fill in the gaps as well by providing more interoperability into basic concepts like inventory, wallet, etc.
     
    erika_d and BetaMark like this.
  16. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    700
    All usecases that make Developers choose Firebase, really. (this is my personal account, not my studio account, but I will boil both interest sets together). :)
    - authoritative transactions that work with Firebase cloud transactions (so GF shop uses Firebase cloud functions and receipt verification)

    - player state / inventory state mirrored in Firebase, state merging across multiple devices

    Reasons for "why Firebase" over anything, including Gamesparks, PlayFab, etc.:
    - Google cloud console for billing, IAM access management, etc.,
    - very affordable, good cost control features
    - Firebase has powerful yet stable cloud APIs, ready for production,
    - pretty decent Google analytics integration
    - seamless Bigquery integration, then into Data Studio for custom reporting
    - easy API to write admin dashboards for GMs and first line support (super valuable!)
    - authentication against a great many oauth services (super important!)
    - anonymous authentication (actually firebase's killer feature!)
     
    Last edited: Aug 5, 2020
    evilzeppelin and erika_d like this.
  17. Reshima

    Reshima

    Joined:
    Dec 10, 2012
    Posts:
    51
    Is Game Foundation production ready? If not, when do you guys plan to move it out of preview? What's the roadmap?
     
  18. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Hi @Reshima - Game Foundation is currently still in preview, which means we cannot guarantee there won't be API breaking changes, etc.

    That said, we're currently on track to reach a state where we are able to stabilize the API and database schema, as well as adequate reliability validation to be production ready, which is planned to arrive in version 1.0 at the end of Sept (so quite soon).

    After that, we'll work on turning the package to be 'verified' which could be a long process but will eventually arrive for 2020.2 or a later version, while in the meanwhile, the version 1.0 and all minor versions after that will be considered production ready as a preview package still.

    Hope that helps.
     
    P_Jong, erika_d and saskenergy like this.
  19. FurionTheGreatest

    FurionTheGreatest

    Joined:
    Jun 12, 2017
    Posts:
    9
    I saw that package include prefabs on vid

    but i cant find it in package, is it removed?
     
  20. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    63
    Hi @FurionTheGreatest - yes we include prefabs in the release, but it's inside the package cache folder instead of the project asset folder if that's where you were looking for them.

    An easier way to get them is by installing our sample content, which you can find under the Package Manager UI where you installed the Game Foundation package initially. That will add the sample scenes which will reference the prefabs we used.

    Hope this helps.
     
  21. gavroch707

    gavroch707

    Joined:
    Mar 22, 2020
    Posts:
    1
    Hi, does this system can be used in steam?avoid purchase with steam?
     
  22. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @gavroch707

    The IAP/purchase related parts of Game Foundation currently only support iOS and Google Play, although elements of Game Foundation like the Inventory System would likely work in games built for Steam (although it is untested).

    However even in the case of iOS and Google Play, the purchases are still made in the iOS and Google Play stores, Unity IAP and by extension Game Foundation only act as a way to make communicating with those stores easier (you don't have to write special case code depending on whether you're building your game on iOS or Android, for example).

    I hope that helps answer your question?
     
  23. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @erika_d ,

    Hi - really interested in Game Foundation and I'm working on several RPGs. Principally an ARPG. But they are all fairly well along in terms of game systems already.

    Looking at the vids, I was wondering about a few things:-

    - multiple inventories (so with a party-based game)?
    - multiple (soft) currencies - so all perhaps relating back to a base currency ie. bronze pieces, 10 of them = 1 iron piece, etc?
    - stats - can these cope with buffs/debuffs/over time with a base value?
     
  24. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @Duffer123,

    Thanks for your interest in Game Foundation!

    - Stay tuned for our next release, coming soon, which will have some new features related to supporting multiple inventories.

    - For multiple currencies, you can create as many currencies as you want in the Currency editor window. For relating them together, check out the transactions window, where you could create a virtual transaction that takes 10 bronze pieces as a cost and distributes 1 iron piece as a payout, per your example. Another way you could relate currency is a more manual approach, but perhaps more flexible depending on how you want to use it. You could add as a static property to each Currency a key something like baseValue or something and then for the value it could be whatever it's rate of conversion is to your base currency. So say Gold is your base currency, its baseValue would be 1, it takes 5 iron to make 1 gold its baseValue would be 5 and then it takes 10 bronze to make 1 iron (and therefore 50 bronze to make 1 gold) it's baseValue would be 50. Then you could use that baseValue static property to make any conversions you need to when your player wants to exchange 20 bronze for iron, for example.

    - Stats. Our current implementation no longer has stats, the codebase as a whole was going through a refactor to prepare it for further growth and the stats system wasn't able to be supported in its current state. The properties that can be attached to the various Game Foundation item types can be used to solve many of the same problems as Stats though. You can add mutable properties to Inventory Items which can be changed at runtime. You can also get the original value of those mutable properties in code by using GetDefaultProperty(). I think you could probably get a buff/debuff setup by having a mutable property with the base value as the default value of the property, which you then change as necessary at runtime. You can see an example of how this might work in the Properties sample scene, where we modify a sword's durability based on when it takes damage. You could imagine an expansion of that scene where how much the durability decreases is based on the damage property of the other sword that hit it, for example.

    I hope that helps answer your questions! Let us know if you have any others :)
     
    Last edited: Oct 20, 2020
    Duffer123 likes this.
  25. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @erika_d , thanks for your response. I am hoping GF can implement some form of Stats in its next integration that can carry and track an array or list of buffs/debuffs? Thanks again.
     
    erika_d likes this.
  26. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    35
    Thanks for your suggestion @Duffer123!

    We've been thinking about Stats off and on for the past year or so, but have been focusing more on back end support lately so Stats probably won't be available in the near term.

    As a workaround, have you considered using Inventory Mutable Properties as pseudo-Stats? Game Foundation supports both Integer and Real number Mutable Properties on all Inventory Items so you could use them to store and retrieve realtime values attached to Inventory Items. They can be added to Inventory Item Definitions through the Inventory tab then any Items created using Inventory Items with Mutable Properties added will have the properties attached with default values (as set in the Inventory tab of Game Foundation). Those properties can then be modified at runtime to store current state information, similar to Stats, as needed.

    If you need more information, please don't hesitate to reach out. Hope this helps.
     
    erika_d and Duffer123 like this.
  27. nareshbishtasus

    nareshbishtasus

    Joined:
    Jun 11, 2018
    Posts:
    36
    Hello, is it possible to make an upgradable item using Game Foundation?
    For example - I have a gun item and it has stats such as Damage, Fire Rate, Reload Speed, Capacity. When a user starts the game, the shop menu shows a gun with some stats but the user will be able to upgrade the guns multiple times using the in-app currency and after each upgrade of the guns the shop menu will show the newly upgraded gun stats.

    Also, is there any function I have to call or anything I have to do in order to save the game or the values changed during the runtime are saved automatically?
     
    erika_d likes this.
  28. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Hi @nareshbishtasus,

    There is a "mutable properties" concept you can use for upgrading items at runtime. There's a bit about it at the bottom of this page, and then a tutorial here (editor) and here (runtime).

    For saving the game state, you'll want to initialize Game Foundation using Local Persistence. Then you would have to call the Save method (it's not automatic). There is a "Data Persistence" sample you can import from Package Manager.
     
    nareshbishtasus and erika_d like this.
  29. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    dead end? unity quits more projects thn i do
     
    Eristen, Lurking-Ninja and PutridEx like this.
  30. To be honest, the Game Foundation story makes me sad. It had so much potential to help countless future projects by unifying the whole item-database-economy-inventory systems so we wouldn't have to rewrite these all the time or rely on various third-party assets. Anyway.
     
  31. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    35
    Thank you both for your comments. We feel the same way and really wish we could work on everything. The team put a lot of effort into ensuring the code base was left in a clean, usable state, but other priorities have surfaced which needed to be addressed first. If we have time, we'd like to return to add additional features, but, in the meantime, you're welcome to utilize Game Foundation in its current state. Best of luck in your projects!
     
  32. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    I wanted to create my own inventory prefab like the store prefab with editor scripts which dynamically pick up references, when i tried to use the store scripts it resulted in errors because many members of game foundations can't be accessed from outside. I think it should be created inside the package. Hope you guys add an inventory prefab to next version.
     
  33. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    I'll see if I can help. Can you give more details about which members were not accessible that you wanted to use? And what do you mean by "dynamically pick up references"?
     
  34. metiscoda

    metiscoda

    Joined:
    Nov 18, 2013
    Posts:
    41
  35. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    i meant custom inspector script with a dropdown for references, in store prefab there is a dropdown for selection of store type. Inventory prefab should have that too for selection of inventory.
    Also there is another issue with GF when IAP is not initialized due to no internet game foundation not work properly. Stores show no items, which may cause rejection of game on ios or android store because they test IAP in different conditions.
     
  36. jeffbruma

    jeffbruma

    Joined:
    May 12, 2021
    Posts:
    2
    Can I have this on 2021.3?
     
  37. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @jeffbruma

    Are you asking whether Game Foundation can be installed in 2021.3? If you are, I guess the answer would be that I believe it's still possible to download Game Foundation as an experimental package, however the project has been closed and is no longer actively supported, so it may not be compatible. Unity Gaming Services offers some similar functionality to Game Foundation (with a more in depth focus on backend support) and is actively being developed and supported, so you may want to check it out and see if it would be a better fit for you. https://create.unity3d.com/gaming-services
     
  38. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    well honestly game foundation an old package has defeated the gaming services