Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Game Foundation 0.7.0 is Released!

Discussion in 'Game Foundation' started by UnityManuJack, Oct 27, 2020.

  1. UnityManuJack

    UnityManuJack

    Unity Technologies

    Joined:
    May 30, 2019
    Posts:
    5
    What's New:
    Multiple Inventory Support

    GF now supports multiple inventories.

    • IItemCollection: An interface for grouping items created by the InventoryManager into either ItemLists or ItemMaps for easier management, searching, iteration, etc.

    • Item List: A list (very similar to List<InventoryItem>) which Game Foundation manages to ensure all items are valid and have not been removed from Game Foundation system.

    • Item Map: A map (very similar to Dictionary<string, InventoryItem>) which Game Foundation manages to ensure all items are valid and have not been removed from Game Foundation system.
    Stackable Inventory Item
    StackableInventoryItem now exists (derived from InventoryItem), along with corresponding StackableInventoryItemDefinition to expose a quantity member that can be used to store multiple items in one InventoryItem to improve performance and reduce Game Foundation memory usage.



    Reward System
    The Reward System lets you customize rewards by type (for example, coins or other in-game items), frequency of payout, and Availability properties relating to reward cooldown and expiration. The settings you choose for these properties determine how a player can interact and claim a reward in the game.





    Reward prefabs allow devs to build Reward Popup UI without writing code.


    ResourcesAsset Static Property
    Static Property has a new type: ResourcesAsset. It stores the path of an asset.



    Game Foundation Initialize Component
    A component that allows developers to initialize Game Foundation. This component can be added to the scene by using the menu item “Game Foundation/Create Game Foundation Init GameObject”.



    IExternalValueProvider
    The IExternalValueProvider gives you the possibility of overriding some data from your local catalog (i.e. `GameFoundationDatabase`) with any third party you want. This is particularly helpful if you want to conduct some A/B testing in your local catalog.

    Changed
    Core
    • The package was renamed from com.unity.game.foundation to com.unity.game-foundation.

    • GameFoundation was renamed to GameFoundationSdk. It removes the ambiguity with the namespace.

    • GameFoundationSdk.Initialize doesn't take callbacks anymore. It returns a deferred instead.

    • InventoryManager class is obsolete. Replaced by GameFoundationSdk.inventory.

    • WalletManager class is obsolete. Replaced by GameFoundationSdk.wallet.

    • RewardManager class is obsolete. Replaced by GameFoundationSdk.rewards.

    • TransactionManager class is obsolete. Replaced by GameFoundationSdk.transactions.

    Transaction System
    • TransactionRewards has been renamed to Payout.

    • BaseTransaction.rewards has been renamed to BaseTransaction.payout. This also affects VirtualTransaction and IAPTransaction.

    • Currency and InventoryItemDefinition now have a common parent TradableDefinition to ease working with them when handling transactions. For the same reason: `InventoryItem` and CurrencyExchange both extend ITradable`; CurrencyExchangeDefinition and ItemExchangeDefinition have been merged into ExchangeDefinition (including there related config and serializable objects). This means that costs and payouts in the existing database will be erased and need to be recreated.

    Catalog
    • GameFoundationDatabase class is now Catalog and the file that was called GameFoundationDatabase.asset is now called GameFoundationCatalog.asset.

    • GameFoundationDatabaseSettings class is now CatalogSettings and the file that was called GameFoundationDatabaseSettings.asset is now called GameFoundationCatalogSettings.asset.

    • GameFoundation.catalogs.tagCatalog is now GameFoundationSdk.tags.

    • GameFoundation.catalogs.tagCatalog.FindTag()` is now GameFoundationSdk.tags.Find().

    • GameFoundation.catalogs.tagCatalog.ContainsTag() is now GameFoundationSdk.tags.Contains().

    • All catalogs (besides tags) have been consolidated into one. For example, GameFoundation.catalogs.inventoryCatalog.FindItem(someKey) is now GamefoundationSdk.catalog.Find<InventoryItemDefinition>(someKey).

    • CatalogBuilder.CreateTag(string) is obsolete. Replaced by CatalogBuilder.GetTag(string, bool).

    Prefabs
    • All static property text fields on component's custom inspector windows have been changed to dropdown menus.


    • All the fields on custom inspector windows of components have been regrouped.

    • Prefabs and their sample scenes have been moved into a `.unitypackage` file within this package. It can be installed into your project's Assets folder by using the menu item "Game Foundation/Import Prefabs and Sample Scenes".


    • Store View prefab (and other prefabs) now update their content display when being re-enabled using SetActive(true).
     
    Djayp and mk0a1a like this.
  2. Djayp

    Djayp

    Joined:
    Feb 16, 2015
    Posts:
    114
    It looks better and better ! It seems much more easy to implement Addressables from here, so I'll start to take a look. Any tips ?
     
  3. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    33
    Hi @mk0a1a,

    We're glad you're enjoying our latest update!

    We had originally intended to move to GA in the near future because we believe the current feature set is relatively stable, however we've adapted our roadmap a bit to include more robust back end support, as well as a few other features that could slightly effect the API, and so we made the decision to hold off on a GA release for a while longer. We hope to minimize disruption to the current API going forward while continuing to build more great features on top of it.

    Best of luck and please keep us informed of your progress, questions and/or suggestions!
     
    Last edited: Oct 27, 2020
    mk0a1a likes this.
  4. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    33
    Hi @Djayp,

    Thank you for your feedback; we're all very excited about the new release!

    We definitely consider addressables a high priority and are looking into potential ways of utilizing static string properties to make a workaround possible. We've had several internal discussions this morning about possible solutions; you might start there to see if static properties of type 'String' could be used with addressables at runtime.

    We also hope to add addressables support when possible, however we are currently focused on empowering Game Foundation with richer backend support as quickly as possible so may not have time to add official support for addressables in the near term.

    Thank you again for reaching out!
     
    Djayp likes this.
  5. Game_Rulez

    Game_Rulez

    Joined:
    May 28, 2019
    Posts:
    6
    1) I would very much like the filtering function when choosing "Item" in transactions and rewards. (By name and by tag)

    2) The API lacks the ability to create more complex "Properties", with a custom graphical interface.

    3) Or it is a mistake in the code or "Rewards" cannot be taken more than 1 time. For example, I have a wheel of fortune, the prizes of which I choose from rewards by tag. And after 2 collecting the reward when starting the game, he invokes exception that there is already a reward with this id.

    4) Wanted "Item created" event before adding it to inventory. So that you could configure it. And after having received the "Item added" can link it with the game logic.
     
  6. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    33
    Hi @Game_Rulez,

    Thanks for all your feedback and suggestions! It's always great to see people using what we've created to help us find new ways of utilizing Game Foundation and to help find any holes in our implementation.

    I've studied your comments, done some research and even reached out to other members of the team, but wanted to give you some preliminary info to get you started while I wait on clarification:

    1) We haven't considered that, believing the tag filter would be sufficient, but will add it to our growing pool of ideas! In the meantime, have you considered adding additional, more-specific tags to obtain a more-effective filter? You could, for example, add additional tags based on key words in the transactions/rewards you might want to filter by thus allowing a more-restrictive filtering, when needed. As an example, if you already have a tag 'coins' on several of your transactions, you could add 'coin-discount', 'coin-small-packs', 'coin-holiday-special', etc. to quickly select only the transactions/rewards you will need.

    2) Normally these properties are intended to describe minor changes to prefabs (either yours our the ones we provide as part of Game Foundation). Another option might be to use the string property as key or path to your custom graphical interface so you can implement more detailed interface behaviors as needed.

    3) I'm checking with the team; hope to have more info for you later today.

    4) For the item-created event, do you mean when item is granted as a purchase or reward, or at other times (i.e. when created from script, initial allocation, etc.)?

    Thanks again for your inquiry and happy Friday!
     
  7. Game_Rulez

    Game_Rulez

    Joined:
    May 28, 2019
    Posts:
    6
    1) No, I mean in the Reward window, for example, in order to attach a payout with an item to a reward, it will show all inventory items in the drop-down list. The more items in the inventory, the more difficult it becomes to link the item and the reward/transaction

    2) As an example, I would like to have, for example, a property link to an atlas texture or load a resource from bundles. And to allow the community to expand the tool for their needs seems to be a good idea.

    4) Yes, I think not only I often wanted to be able to reconfigure an item before it goes into inventory.
     
  8. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    33
    Hi again @Game_Rulez,

    I've gotten some feedback and added an internal ticket to ensure your suggestions are not 'lost in the shuffle.' To be more specific about your queries,

    1) Sorry for the confusion. That's a great idea--I've added an internal ticket so we can track the idea and try to work it into a future release.

    2) We definitely intend to add more property types in the future and we'll add your requests to the potentials list.

    3) I apologize but our Rewards expert is unavailable today--he should return on Monday. I'll pass along your request, but it may be helpful if we can get a copy of your catalog and which reward your using for reference. I'll be sure to raise the issue with him; hopefully he'll have more details for you then.

    4) If you can describe the exact instances where you'd like a callback, that would help. For example, I think it might be helpful to send a pre-reward and pre-purchase-reward event with all the items being granted to permit organizing the items into collections, if needed. Is that what you were thinking too? Were there other events you'd like to track as well? What kind of control would you find useful (if any) to go along with the events (i.e. would it be useful to be able to assign them to collections such as ItemMaps or ItemLists when they're created)? The more specific you can be the better. By the way, it may be more useful to receive an after-the-fact event so the items have already been created and you just need to assign them collections or rearrange stackable item quantities and such. Would that be more or less useful? Please describe your specific use cases to ensure proper coverage.

    Thanks for following up and all your great feedback. Have a great weekend!
     
    Djayp likes this.
  9. Game_Rulez

    Game_Rulez

    Joined:
    May 28, 2019
    Posts:
    6
    Thank you for your answers and attention to a very promising tool in my opinion.

    4) Game Foundation for me is a tool that allows you to create an inventory skeleton, describe objects at the model level. Then I prefer to wrap these models in more specific entities and adapt them to the project. And the moment when the item enters the inventory, I see it as a signal that the model of the item is completely ready and can be wrapped. You can, of course, get an event in the inventory "Item added" inside your system to modify the item, but it seems to me that this breaks the "model -> project entity" cycle

    Possible situations when needed.

    A store of used items. The player buys an item that is described as defective. There is a system that randomizes a random defect and when a player buys, he spoils the model of the item by accident. In the case when there are events before "itemAdded" and the randomization system is subscribed to it, we can turn this system on and off without touching the rest of the project.

    Also a random item with a random number of uses. The player knows the interval of the number of uses, but he will know the exact number only after receiving the reward.

    In all my cases, the goal of adding an additional event is to make it possible to change information about an item independently of the rest of the game logic.
     
  10. Game_Rulez

    Game_Rulez

    Joined:
    May 28, 2019
    Posts:
    6
    3) it will be somewhat difficult, due to the fact that due to an error, I have already significantly changed the logic, saving information about the item in the Rewards, but adding them myself.
     
  11. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    38
    If I understand your intent, then I think the current reward system won't work the way you want yet, unfortunately. There isn't a facility for randomizing rewards, nor claiming the same Reward Item more than once (except after the Reward has been reset). In the current rewards system, each Reward is meant to be a forward-incrementing sequence of preconfigured Reward Items.
     
  12. floriancourgey

    floriancourgey

    Joined:
    Oct 18, 2016
    Posts:
    1
    Hey,
    Thanks for the update!
    In the editor, I'm unable to drag n drop my Sprites into a Resource Path static property of an Inventory Item. Is there any specific settings for the sprites?

    The Sprite is not added, it goes back to the Project View. When I try with a Sprite from the Samples (Assets/Game Foundation Prefabs/Samples/Common Files/Resources/Sprites/gem_icon.png), it works and the mouse cursor has a Green "plus" icon.

    Thank you

    Edit: Saving my sprites in /Assets/Resources works. It looks like the "Resources Asset" option can only use Sprites in "allowed" folders such as:
    - /Assets/Resources
    - /Assets/Game Foundation/Resources
    - [...]
    Why? Are they marked as "Resource enabled" in any way?
     
    Last edited: Nov 8, 2020
  13. U_AdrienPDB

    U_AdrienPDB

    Unity Technologies

    Joined:
    Aug 14, 2019
    Posts:
    7
    Hi, I'm not sure to understand what you mean by "Resource enabled" but the only accepted assets in "Resources Asset" properties are assets loadable through the Resources API. This includes any assets located under a Resources folder.
    This also means that sub-assets, like sprites from an atlas, are not handled since the API doesn't support this level of detail.

    I hope this precision will help you.
     
    erika_d likes this.
unityunity