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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Change the game version within the game

Discussion in 'General Discussion' started by MessiasOF, Oct 29, 2020.

  1. MessiasOF

    MessiasOF

    Joined:
    May 4, 2017
    Posts:
    27
    Hi, I didn't know how to write a good title for this post, but here it is:
    I want to make it possible for players to play old versions of my project but without having to create a launcher for it (similar to what Minecraft does).

    An architecture similar to what Minecraft does:
    You select to play the desired version, then the game downloads the selected version that is stored on the server directly in the game directory on your machine, and you are ready to play.

    But the problem is that I don't want to make a launcher for this (and it wouldn't make sense to have a launcher if I wanted to recycle that idea for future larger projects that would be ported on platforms like consoles and streaming).

    Can you do that within the game itself? Basically at runtime?
    Sure, I know I could download all versions of the game and make them available to play at any time, but wouldn't that be detrimental to the size of the build?
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,325
    Not really.

    On windows platform a process cannot delete its own executable. Now, you could try to work around that, but you'll be fighting the engine you're using, and you'll need to figure out how to move the old files out of the way while the game is using them without breaking the update process.

    In my opinion, It isn't worth it.

    The best way to do it is via a launcher/updater program.
     
  3. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    How about using steam? Its not supported to downgrade (but you can do it with some skill) and you can have beta branches etc
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,582
    It can be done at run time to certain extent. But much easier would be, if game is designed to be modular and in moddable faction. Then just loading relevant modules.
    Or, having mini updater app, which executes when game launches, checks for updates and load them, before game starts. Alternatively updater app waits to close the game and then updates files.
    But informing player about the update within a game, would be first step. Give them link and allow to download manually, what requires. Downloading full game is often simplistic mouth, to implement.
     
    Last edited: Oct 29, 2020
  5. MessiasOF

    MessiasOF

    Joined:
    May 4, 2017
    Posts:
    27
    I even thought about using P.A.T.C.H and talked to the plugin developer, he says that "maybe it's possible in some way using the source code". I'm still thinking about it.

    I really wanted to avoid having to work with launchers.

    Wait, really? I didn't even know it was possible.

    Yeah, I am working to make my project modular, in some of my posts you can see my interest in making the game easy to be moddable and fully modular to facilitate various tasks. Also, to what extent could this be done at run time?
    Thanks, I will think about it and try to figure out how to implement.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,582
    To the point, you decided to update the core app, which will require replacing file and restart of the game.
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Any in app solution will be more difficult than doing so with a launcher. Though it would be pretty simple to design the launcher so it doesn't pop anything up (just launches the main app immediately) and you could add an interface to your main app to tell the launcher to upgrade/downgrade the main app. So it would function to the user as if the main app handles it, even though it is really the launcher doing it all.
     
    MadeFromPolygons likes this.
  8. MessiasOF

    MessiasOF

    Joined:
    May 4, 2017
    Posts:
    27
    Well, I think all of that clears up all my doubts
    Thank you all.