Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

dynamic DLC (Down-Loaded-Content) to enhance existing game.

Discussion in 'Game Design' started by RestlessSwords, Jul 2, 2021.

  1. RestlessSwords

    RestlessSwords

    Joined:
    May 9, 2021
    Posts:
    26
    I want to have a (Unity built) game that i can ship, and then have IAPs and/or DLCs to enhance it without downloading an entirely new version of the game. For example, say it comes as a free-to-play minimal game with a car the player drives around a course. I would like to be able to have IAPs or DLCs of: new cars, new courses, perhaps even new types of vehicles (motorcycles, tanks, whatever). From what i can tell (perhaps mistakenly), this is what is possible/practical:
    1) can have asset/resource bundles containing new materials and textures and even new scenes
    2) can have new versions of existing prefabs (and ?perhaps? entirely new prefabs?
    3) cannot easily have new scripts unless they are specially precompiled c# scripts into a DLL (so a new car could not require a new C# script, it would have to work with only the existing shipped C# scripts.

    I would appreciate any generic architectural insights into the above, and generally what i can have in DLCs and also what i CANNOT have in DLCs (and hence what ways i cannot extend a prebuilt and shipped game).

    Basically i am looking for guidance on what is currently known as the common ways of extending existing games and what are dead-end roads i should avoid wasting time chasing. This is critical for me to correctly architect/design a good extendable game.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You are correct on the above.

    The only way around the limitation of not changing the code, is to use a runtime scripting language such as MiniScript. I know of at least one developer who is doing exactly that: he has a core engine written in Unity, but individual games within it are written in MiniScript, so that he can add new games/features (or update existing ones) at runtime. I've tried an early pre-release version of this and it seems to be working well.

    However, this does require a lot of planning up front; it's not something you can easily bolt onto an existing game. (Though you could add on a more limited modding functionality, e.g. adding new races or events to a strategy game, etc.)

    In general to make your game moddable/updateable, you want to make it data-driven as much as possible. Obviously it's easy to send new data files. Using a scripting language is really just the extreme endpoint of data-driven, where even the game logic itself (or parts thereof) is in simple text files as well.
     
    adamgolden likes this.
  3. RestlessSwords

    RestlessSwords

    Joined:
    May 9, 2021
    Posts:
    26
    My game is very heavily data-driven, there are no constants scattered throughout the code so I can easily change various numbers (speeds, etc.). But the hard (?impossible?) part is adding new behaviors that requires new code.
     
    JoeStrout likes this.
  4. RestlessSwords

    RestlessSwords

    Joined:
    May 9, 2021
    Posts:
    26
    1) As additional clarification to my original question, I am assuming (from the IAP tutorials I have seen) that a given Unity IAP for some feature "XYZ" (only for Android and iOS I believe, not for Windows nor XBox) ends up doing a callback to "OnPurchaseOf_XYZ_Completed()" inside the existing game executable, so the game designer/coder must have decided on all the possible IAPs and put in code to be enabled by the IAP *BEFORE* the game ships -- so new features/behaviors are not actually IAP added, their code is just enabled.

    2) Is there a way that an IAP can somehow purchase a full new game download and receive it without having to go to the store and purchase the new DLC?
     
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    What an IAP does is up to you. It can unlock built-in functionality, as you said, but it can also go download something from a website you control. That can include new assets, data, and runtime scripts (e.g. MiniScript) but not new compiled code (e.g. Unity C# scripts).
     
  6. Zenithin

    Zenithin

    Joined:
    Jun 7, 2016
    Posts:
    35
    Yes,
    1) can have asset/resource bundles containing new materials and textures and even new scenes
    2) can have new versions of existing prefabs (and ?perhaps? entirely new prefabs?
    3) cannot easily have new scripts unless they are specially precompiled c# scripts into a DLL (so a new car could not require a new C# script, it would have to work with only the existing shipped C# scripts.

    You could make it in a way so that basic game is just has interface and it actually downloads the c# dll or miniscript files to run the game. Then for a update you can replace the dll hence the cars and everything would use your new scripts.

    The trick to make extendable moddable games is your first game itself should be built as a mod over a basic framework.
     
  7. RestlessSwords

    RestlessSwords

    Joined:
    May 9, 2021
    Posts:
    26
    I had already decided my development journey would be:
    1) continue getting reasonable base functionality developed and running
    2) stop, and split prefabs +resources into resource bundles and learn how to scripted download and use them
    3) have several large drinks, move scripts into studio-built DLL, and struggle till I can scripted download and use them

    It should be an 'interesting' journey.
     
    JoeStrout likes this.