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. Dismiss Notice

[ Help/Question ] Loading new game logics and content from backends via internet on runtime

Discussion in 'General Discussion' started by harryblack, Apr 25, 2018.

  1. harryblack

    harryblack

    Joined:
    Dec 26, 2016
    Posts:
    19
    Hi,
    We have a situation where we want to release our game for Android and IOS but need to carry on working on adding more content for our game.

    These contents could be completely new functionality.

    In order to do this what we are intending is to create more prefabs and functionality after the game is released but so far we could not find a way to port our new scripts associated with our newly created prefabs into our game at runtime.

    The Asset Bundles functionality does not support new scripts.

    Is there a way that we can get this to work?

    I believe a lot of games must have already solved this. Looking for solutions. Help to find a suitable solution to this problem.

    We are ready to purchase an asset if it does the same.

    Regards
     
  2. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,058
    Indeed new code via assetbundles is not possible. Else you could inject malicious code any given time.

    An alternative would be something like Lua. Lua is a text asset so it can be updated via assetbundles.

    If lua is not an option you update the content with assetbundles. If there needs to be a bugfix you require to update the app with a new binary.
     
    TonyLi and harryblack like this.
  3. harryblack

    harryblack

    Joined:
    Dec 26, 2016
    Posts:
    19
    Thanks MaskedMouse.. Will check Lua first.. and then it seems we can also add scripts to our core binary that would be needed by our prefabs and then update the binary and after that get the prefab from the assetbundle..
    Thanks for your response.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Both the Apple App Store and the Google Play Store include functionality for upgrading apps to new versions. Is there a reason you don't want to do it that way?
     
    harryblack likes this.
  5. harryblack

    harryblack

    Joined:
    Dec 26, 2016
    Posts:
    19
    What we were looking for was to create new prefabs after the game has been launched and keep extending our inventory that way, without making any changes to our APKs (for android) but this required that we can also add new scripts to our new prefabs as their functionalities can be almost anything. While I knew we cannot add scripts that way I thought there may be some other way by which without sending any updates we can do that.. instead of updates to the actual APK the game just checks that some new prefab is available and downloads it (that already happens with the asset bundles.) If all this makes any sense :)

    But now we are going for the same way you are referring. We will be adding our scripts and then send them with the updates and then let the prefabs get downloaded from the asset bundles.
     
  6. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    8,969
    There two ways we approached this in the past, 1) plan ahead, often new compenents can be created well ahead of art content, so that you can include the code part of well in advance of the the content releases. And 2) try, when possible, to make script components more general purpose and configurable, so that new content can rely on existing components with settings changes. Easier said than done, but doable with enough planning.
     
    Ryiah, TonyLi and harryblack like this.
  7. harryblack

    harryblack

    Joined:
    Dec 26, 2016
    Posts:
    19
    Thanks Zombiegorilla.. Will keep this in mind for future projects.