Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Unity Game Foundation 0.6.0 is Released!

Discussion in 'Game Foundation' started by mingz-unity, Jul 2, 2020.

Thread Status:
Not open for further replies.
  1. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    59
    What's New:

    Static Property:


    upload_2020-7-2_0-48-4.png
    • Static Properties have been added to all catalog items. You can use them to define any data that won't change at runtime. In the case of Inventory Item definitions, a static property can be shared across all instances.

    Game Parameter:



    • The new Game Parameters feature provide a solution to store your game configuration. Editor can be found at: Unity→Window→Game Foundation→Game Parameters.
    • It will also allow GF to provide you with a/b testing capability in the next release.

    Code generator for catalog item constants:

    upload_2020-7-2_0-49-8.png
    • We included a code generator to help provide a strongly typed C# reference the concepts they defined in GF, without using string reference.
    • You can access that from the main menu: Assets -> Game Foundation -> Create Constants

    Initial Allocation:


    upload_2020-7-2_0-43-25.png
    • You now can define an initial allocation for any inventory item. Those items are instantiated when the player profile is created.

    Non-consumable IAP:
    • We now support non-consumable IAP in Transaction and the Store prefab.

    New Prefab for store promotional offers:

    • New prefab and component created for creating popups to surface a promotional offer, that's complementary to the store prefab we released earlier.

    Editor Public API:
    • We included a public API to allow users to generate the database programmatically. An example use case for this is to import data from external source (e.g. spreadsheet) to the database, to help you integrate Game Foundation to your project data workflow.

    Background IAP Queue:

    • We provided ways to let the dev process the "background" IAP queue (restoring purchases, delayed purchase successes, etc) on their own, instead of letting Game Foundation do it for them automatically.

    Property data type:

    upload_2020-7-2_0-59-50.png

    • Properties can now store long and double values, to allow developers to store larger values. Since int and float are covered by these types, they have been removed from the editor type dropdown but are still handled.
    • Properties can now also store bool and string values.

    What's Changed:
    • The code is now split into different assemblies.
      The local Catalog, formerly in the CatalogManager namespace is now in the DefaultCatalog assembly and DefaultCatalog namespace.
      The scripts of sample Prefabs also have their own assembly.
    • Category has been renamed Tag and now exists in a separate TagCatalog.
      All old FindItemsByCategory methods have been reimplemented as FindItemsByTag and behave as before.
      Tags can be added or removed to/from all of GameFoundation in Window\Game Foundation\Tag window.
      When tags are removed from Tag Catalog, they will be removed from all items throughout Game Foundation.
    • Status have been directly integrated inside Inventory Items instead of as a Detail: this means that StatCatalog, StatDefinition, StatDetail, StatManager and the Stat editor window no longer exist.
    • Mutable Properties are accessible directly through the items and definitions they are defined for. The IStatDataLayer has been merged into IInventoryDataLayer to match this change.
    • GameItem has been merged into InventoryItem since they are the only instantiable objects in Game Foundation systems at the moment. In the meanwhile, we introduced Game Parameters that can help you define global-level concepts such as Game, Player and Level. We're also looking into supporting such global-level concepts as instantiatable definitions as well.
    • We've removed IPurchasingAdapter, and UnityPurchasingAdapter is now internal. Use the TransactionManager class for anything related to IAP in Game Foundation
    • JsonDetail has been flagged Obsolete and we consider replacing it by Static Properties as soon as they handle lists and dictionaries.
    • We simplified the initialization of TransactionManager (UnityPurchasingAdapter is now internal and no longer decoupled).

    Notes on Migrating from earlier versions:
    • While the overall API and data model of Game Foundation is now maturing and we foresee more stability for developers in the near future, due to the various database format changes and some API breaking changes, upgrading a project using existing version of Game Foundation is not recommended. We suggest you start using this version on a new project.
    • If you're using Game Foundation in a real-production project and need our support to migrate your project to the newest release, please reach out to us (DM me directly) and we'll try to provide specific guidance. It'll be more complex than what we can provide in a migration guide, but we're willing to help and support our users.
     
    Last edited: Jul 2, 2020
    DemonFangZ, Lurking-Ninja and mk0a1a like this.
  2. mk0a1a

    mk0a1a

    Joined:
    Nov 24, 2018
    Posts:
    24
    Wow, this has really exceeded expectations. When can we expect a production release? I think it is mostly feature-complete now and only lacking the cloud/remote persistence.
     
    erika_d and GilbertoBitt like this.
  3. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    59
    Hi @mk0a1a - cloud / remote data persistence is already available, and works out of box for the reference data adapter we provide (using ChilliConnect). You can check out the samples on how to use it.

    We don't have a timeline for out of preview yet, but we do plan to hit GA at some point maybe later this year. One challenge we're facing is to continue providing more modules to our developers, while reaching a state where we can keep things stable. Thus we may have to split out a core package which can have the most mature components that we can make production ready for the users, while we continue to iterate on the new systems.
     
    erika_d and mk0a1a like this.
  4. Orlando_AGS

    Orlando_AGS

    Joined:
    Nov 28, 2016
    Posts:
    3
    Game Foundation is coming along great :)
    I really can't wait for you guys to stop using the resources folder though.
     
  5. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    59
    Hi @Orlando_AGS - can you share with us more specifically what's your concerns around the resources folder here?

    If you mean the way we currently reference assets (using resource path) - it's on our plan to add Addressable support, to allow both a better editor experience working with assets associated with item definitions, and to enable live asset update / download, just like what you can do with the rest of the Game Foundation content.
     
    mk0a1a and Orlando_AGS like this.
  6. mk0a1a

    mk0a1a

    Joined:
    Nov 24, 2018
    Posts:
    24
    Awesome, I didn't know it was already available. I just checked the sample code and read the docs but I can't seem to find a sample on how to make a custom data adapter. The docs mention to use IDataPersistence and IDataSerializer so the necessary interfaces should already be there. I'll probably do more digging later on. Ideally, I'd like to make a backend using AWS services.

    Wow, GA later this year is earlier than I expected. I can't wait to use this!

    Yes, I think splitting out the new features into separate release would be right. Maybe a version 2 preview or something? The Inventory, Currency, and others already seem stable enough for a production release.
     
    erika_d likes this.
  7. Orlando_AGS

    Orlando_AGS

    Joined:
    Nov 28, 2016
    Posts:
    3
    Its kind of a hassle when working with spritesheet icons but its good to know we'll have addressable support in the future.
     
    erika_d, mk0a1a and GilbertoBitt like this.
  8. lorddesu

    lorddesu

    Joined:
    Aug 20, 2014
    Posts:
    28
    How should I implement upgradable Player Stats or Current Game Level which are changeable in runtime and needs to be saved? It would be better if we can use Game Foundation for all data that needs to be saved. For now it looks like I can use Game Foundation for currencies and shops but for every thing else I have to use Player Prefs or other solutions. Also there are no API to change Game Parameters in runtime.
     
  9. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    59
    Hi @lorddesu - thanks for the feedbacks. There are a couple of suggestions you brought up, so let me get back to you on each of these with some clarifying questions:

    1) An 'upgradable' player stats:

    Here by player stats I assume you're referring to things like Player XP, Lv, and things like HP? And by 'upgradable' do you mean those the Max limit of those numeric stats can be upgraded at higher tiers, or just the value of that can change at runtime?

    Mainly I'd like to clarify two aspects to help us figure out what solution we can provide to you:
    • Whether the stats you refer to are global stats (e.g. globally there's only one player level and you can refer to it as a global stat) vs. item-Instance level (e.g. per item instance such as the damage point of a sword)
    • Whether the 'upgradable' nature of that stat is a Static Property (e.g. the Limit of health) vs. a mutable property (e.g. the Current value of player health). Conventionally for upgradable stats we tend to look at the first scenario, so just to confirm if here's also what we're referring to.
    2) Current game level that's changeable:

    It looks like this one could also be similar to the Player Stats, e.g. the current game level of a player, in which case it can be a "global stat" as I mentioned earlier. Or are you thinking of it as a different concept than the 'player stats' one above?

    3) Using Game Parameter:

    While the naming and use case of this feature is quite open ended, we do design this feature mainly for static configuration only, meaning that you can't use that to persist runtime gameplay states such as the ones you refer to. But by confirming your needs, we can see what solution would work the best for you.

    4) Extending the data persistence benefit beyond Currencies etc. that we provide:

    This is a very common ask and we definitely recognize the value. While Game Parameter is not the right fit, we are looking into some other ways to allow developers to leverage the systems + data layer we provide. Now to help us fully understand your needs, two clarifying questions:
    • What other concepts of your game would you like to use GF to persist data with (besides the ones you mentioned above)? e.g. Are those mainly in terms of in-game items, or could be other things?
    • In terms of how you would like to use GF for such data persistence needs, are you mainly looking to use them the same way like the built-in concepts we provide (i.e. for currency etc. we ask that you define those concepts in GF database and those are sand-boxed item definitions at runtime that you want GF to manage for you), or you want to use your own c# native classes, and only want us to persist the runtime data for these custom classes?
    Thanks,
     
    erika_d likes this.
  10. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,739
    Hey, I'm already using Chilli Connect and I'm about to get started with a store, virtual currency and item system. Would you recommend me using Game Foundation now? It's still in preview so i'm a little apprehensive, but based off what i've seen and read the API for these functions is fairly stable at this point?

    Another use case for me game is that I'd like some limited features to be available and some IAP items (non consumable) if owned by the player to be available when offline. If I integrate GF with Chilli Connect is this an option?

    Thanks in advance for the info.
     
    Last edited: Aug 13, 2020
  11. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    12,081
    During a preview release, some features may not be always be 100% backwards compatible with previous builds, although we always make the effort. The releases themselves are quite stable. We do persist the purchases locally and we will follow up with more detail with regard to your offline scenario.
     
    Antony-Blackett and erika_d like this.
  12. KEM4

    KEM4

    Joined:
    Nov 22, 2017
    Posts:
    8
    I am a bit late to the party and have been playing around with the "Game Foundation" package. It is very difficult at some point to see what will be in the release package and what will not be in there. The documentation with each preview changes. It becomes more readable but at the same time, things are removed.

    First issue

    Immutable prefab cannot be saved. I understand this is a preview package but been facing this issue with 2019 LTS version and 2020 version (latest stable). This occurs when I click on the prefab in the Packages/ directory. But also only when I add some items in the inventory and start working with the package.

    Second issue

    World prefab for the item
    Well, I cannot see this option. In one of the Unity "Unite", 2019 videos the package was presented and I saw in the demo that there is an option for prefab detail. By my understanding, it still was available in the 0.3.0 version but has been removed later on. Is this something that will come back later or there is another way that I can associate prefab with my item in the definition? Using the 0.6.0-2 version only allows me primitive values such as string, integer, boolean, float.

    Besides facing other random errors, JsonAsset being unusable (throws errors), but I understand its obsolete and will be removed soon, the package seems great.

    My suggestion would be to give more details on how to write some sort of extensions for the component scripts or anything else within the package. I figured out the way to allow only 1 item to be purchased (disable it after the purchase or so) but it seems very ugly version in the code.

    P.S. Within all this information I would like to understand how I could achieve the option to assign prefab to the item.

    Thanks
     
    erika_d likes this.
  13. KEM4

    KEM4

    Joined:
    Nov 22, 2017
    Posts:
    8
    Cracked the idea behind this. Everything related to prefabs and so on is moved to "AssetDetail" as a more generic approach. This means that you have to use the Resources folder and then within the code you get the asset details and from that object, I was able to extract the reference to it.

    storeItem in this case is InventoryItemDefinition object.
    Code (CSharp):
    1.  
    2. AssetsDetail assetDetail = storeItem.GetDetail<AssetsDetail>();
    3.  
    4.             if (assetDetail != null)
    5.             {
    6.                 GameObject prefab = storeItem.GetDetail<AssetsDetail>().GetAsset<GameObject>("Prefab");
    7.  
    8.                 if (prefab != null)
    9.                 {
    10.                     Debug.Log("Found world prefab " + prefab.gameObject.name);
    11.                 }
    12.             }
    13.  
     
    erika_d likes this.
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    12,081
    Have you had a chance to follow the GF tutorials? I'm going through them now, and they are pretty good, but cover just the basics.
     
  15. KEM4

    KEM4

    Joined:
    Nov 22, 2017
    Posts:
    8
    @JeffDUnity3D Thank you for taking the time to answer me.
    Indeed going over and over again I spot something new - https://docs.unity3d.com/Packages/com.unity.game.foundation@0.6/manual/Details/AssetsDetail.html
    This does explain the concept of using AssetDetail. I became confused about changes within the packages, unite demos, and the stuff the fact that until today a lot of people disregard using the Resources directory and it became some sort of bad practice to approach, that is why this kinda fell off as an option to store it in there and reference it as a path within the AssetDetail.
    One thing that I fail at is to provide a boilerplate of assets (default) that must be given/assigned. It makes it a bit difficult to not have some basic inheritance. Imagine having 15 asset details and each time you would have to create 15 them instead of inheriting the names and just assign the values, that would come in very handy.

    In the answer after I mentioned that I cracked the idea and it does work, although the usual approach where I would give it a name and then reference it as the game object would be more oriented towards what people usually do (by not using the Resource folder)

    Regarding the errors, they still do persist.

    http://prntscr.com/u9puu8 here would be a screenshot of what happened.

    I tried this on the 2019 LTS version and 2020 version and the same issue persisted. This does not happen on every prefab but on some after I set up some items in the database.
    The issue takes place both in Editor mode and Game mode.

    Please do let me know if you need additional information, I`ll be more than happy to provide them.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    12,081
    Sorry I was asking if you had a chance to review the tutorials, This one mentions Asset Details https://docs.unity3d.com/Packages/c...ual/Tutorials/14-WorkingWithStorePrefabs.html. Probably best to start a new thread for a particular topic like this, thanks.
     
    Last edited: Sep 1, 2020
Thread Status:
Not open for further replies.
unityunity