Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Nishuthan on Sun 22/10/2017 08:05:22

Title: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Nishuthan on Sun 22/10/2017 08:05:22
HI

I WOULD REALY LIKE TO INCLUDE A AUTOUPDATE FUNCTION FOR MY GAME IS THERE ANY WAY TO DO THIS ? OR ANY SOFTWARE AVAILABLE TO DO THIS ? OR IS IT IMPOSSIBLE ?


THANK YOU
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Slasher on Sun 22/10/2017 08:31:46
Well, for one: you do not need to SHOUT (known as flaming I believe)...

What exactly is it you are looking to update?

Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Nishuthan on Sun 22/10/2017 13:54:32
The whole Game. Like the New Things i included


Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: eri0o on Sun 22/10/2017 14:01:24
The distribution platform you are making your game available can usually handle this, but you are probably going to need to implement your own save module since the save game as is usually breaks when you update an existing room.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Nishuthan on Sun 22/10/2017 14:36:12
Quote from: eri0o on Sun 22/10/2017 14:01:24
The distribution platform you are making your game available can usually handle this, but you are probably going to need to implement your own save module since the save game as is usually breaks when you update an existing room.

How do i do it any link i can refer to ?
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: eri0o on Sun 22/10/2017 15:42:58
For which part, the save or the distrbution platform? If you are going for Steam as distribution platform read the Steam Developer documentation. For the save part I advise you to ask around since I haven't tried it myself.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Monsieur OUXX on Mon 23/10/2017 10:18:16
Allow me to reprhase the answer : It is close to impossible. (if you want the player to continue using his/her previous saved games without starting the entire game again)
When I write "close", I mean "unless you can program in C++ and are able to dig deeply into the game's engine code".

Here is why :
- Let's suppose you overcome the non-neglectible difficulty of creating an online repository for updates, managing versions, etc. It wouldn't be too hard if you did an external download tool (like a game launcher) written in C# for example, that would download any new version of the game that you would put in your online repository, and install it in place of the current game version. If you're a pro you can even push this solution further by making patches available -- which would save the trouble of re-downloading the entire game. Side note: it's probably impossible to implement that directly in your AGS game, because even if you managed to download the update material (using the Sockets plugin for example), then the game still could not overwrite its own files I believe.

- But then another terrible problem would arise : all the saved games would be lost. Indeed, downloading a new complied version of the game makes all the previous saved games incompatible. So the player would have to start over the entire game. You might consider this a minor issue, or a major one. This is the reason why eri0o said "you need to implement your own save module". He makes it sound like it's totally casual. Maybe it is for him, but from my perspecive it's an unbelievably complex task.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Cassiebsg on Mon 23/10/2017 16:55:49
Quote from: Monsieur OUXX on Mon 23/10/2017 10:18:16
all the saved games would be lost. Indeed, downloading a new complied version of the game makes all the previous saved games incompatible.

This is not 100% true.
If you just do some "minor" changes in code, it won't break the savegames. However if you add/delete any assets like variables, sprites, objects, rooms, characters, etc. It will break the savegame. You can though take some precautions to avoid it breaking if you add dummy assets to your game, that you can use later on in case of an update.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Monsieur OUXX on Tue 24/10/2017 00:06:32
Quote from: Cassiebsg on Mon 23/10/2017 16:55:49
If you just do some "minor" changes in code, it won't break the savegames. However if you add/delete any assets like variables, sprites, objects, rooms, characters, etc. It will break the savegame. You can though take some precautions to avoid it breaking if you add dummy assets to your game, that you can use later on in case of an update.

Good to know! What are the "minor" changes? Is it if you only modify modules scripts? When you said "variables" did you only mean AGS built-in "global" variables?
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Crimson Wizard on Tue 24/10/2017 00:26:45
Quote from: Monsieur OUXX on Tue 24/10/2017 00:06:32
Quote from: Cassiebsg on Mon 23/10/2017 16:55:49
If you just do some "minor" changes in code, it won't break the savegames. However if you add/delete any assets like variables, sprites, objects, rooms, characters, etc. It will break the savegame. You can though take some precautions to avoid it breaking if you add dummy assets to your game, that you can use later on in case of an update.

Good to know! What are the "minor" changes? Is it if you only modify modules scripts? When you said "variables" did you only mean AGS built-in "global" variables?


Any variables, except local function variables, because latter not saved (you cannot save while script function is run).

One of the ways to give you some leeway here is to put an array of, say, 1000 ints in your script, then you will have 4000 bytes of data you can later replace with something meaningful if you need to patch your game without breaking saves.
But even order of variables is important here, so new variables must precede or follow this dummy array as you decrease its size.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Dave Gilbert on Wed 25/10/2017 14:35:29
If your game is on Steam than your game will update automatically, yes. GOG does the same thing, I believe. But as others have said, it is risky. The save game issue is, sadly, a thing.

Some things to keep in mind when updating your game after launch:
The save issue can be really difficult, but not totally insurmountable (aside from the last one). Anyway, good luck!

-Dave
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Crimson Wizard on Wed 25/10/2017 14:40:41
Quote from: Dave Gilbert on Wed 25/10/2017 14:35:29
Updating your game to a newer version of AGS will completely break your save files. It's the one reason I haven't updated a lot of our games yet.

That depends, for example AGS 3.4.1 can still read saves from AGS 3.2.1. (Unless we broke it by mistake, but no one reported anything in past few years)
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Dave Gilbert on Wed 25/10/2017 14:55:28
It... can? 8-0 What about later versions? Most of our games were written in 3.3x.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: Crimson Wizard on Wed 25/10/2017 15:15:45
Quote from: Dave Gilbert on Wed 25/10/2017 14:55:28
It... can? 8-0 What about later versions? Most of our games were written in 3.3x.
Saves from 3.2.1 to 3.4.1 are generally of same format and supposed to be read by higher versions. When savegame is parsed, engine checks for original game version to know which data to skip (if it only appeared in later versions).
There were certain mistakes during the course of 3.3 development, but I believe they were long fixed.
Title: Re: [AUTO UPDATE]IS IT POSSIBLE IN AGS ?
Post by: eri0o on Thu 26/10/2017 02:56:51
@Monsieur OUXX, I have no idea of how hard this is, I just stated that for updating the game (without taking all the cares listed in this thread), the only way around I saw was to implement something.

I started a discussion thread with some code here (http://www.adventuregamestudio.co.uk/forums/index.php?topic=55398.0), maybe someone who has done this can shed a light.