Import an older AGS Game

Started by Ghostlady, Mon 24/07/2023 04:59:42

Previous topic - Next topic

Ghostlady

Hello, I created a game in 2006. Is there a way to import those files into the current AGS version? I'm thinking of doing a redo of this game.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Are you speaking of a project source, or compiled game? Do you remember which version of AGS was it made with?

Project source may be imported.

Compiled game may be unpacked using a tool, and parts of it imported into the newly created project. If your game is made with AGS 2.70 or earlier, then there's a chance that room scripts will be intact, because they were saved into the compiled rooms for some reason. But the global script and script modules cannot be, because currently there's no known script decompiler.

Ghostlady

It is a compiled game created with AGS 2.70
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#3
Here's an archive containing some tools that we develop along the engine (they are not distributed along with AGS yet, but they are built on our build server):
https://www.dropbox.com/s/6wfl3foo3jb9iyu/agstools-360.zip?dl=0

Among them there's a program called "agsunpak.exe". It's run from command line (windows console) simply as "agsunpak path_to_compiled_game path_to_unpack_folder".

For example:
Code: ags
agsunpak myoldgame.exe myoldgame_files
will unpackage myoldgame.exe into the folder myoldgame_files (I think you have to create this folder yourself).

After you unpackaged your game, open the editor, choose to open an existing game, and select unpacked file called "ac2game.dta". AGS will start an "import old game" process.

If that does not work:
- Download AGS 2.72, and use it to open ac2game.dta instead.
- save the project in 2.72.
- open modern editor and try importing this project again.

You likely will have compilation errors because global script won't be recovered (as i mentioned), but other things may be more or less intact.


UPDATE

I experimented with some very old game myself, and found that there theoretically may be an error in the 2.72 AGS Editor when you open the game for the first time, because it cannot arrange all the sprites in the "Main folder" in sprite manager.
The error message looks like:
QuoteSome orphaned sprites were found, but the Main folder doesn't have free space to recover them all. Remove some sprites from your Main folder, then try again.
I don't know what's the deal with that, and whether that will be a problem with your game.

But if you have this, to solve this problem do the following:
- Open the Sprite manager
- Create a number of subfolders
- Move all the sprites from the main folder into the first subfolder. (drag to select sprites, drag to move them to any subfolder)
- Save and close the editor.
- Open project again.

Repeat this process until it stops complaining.

Ghostlady

I still have the original folder with everything in it including the compiled folder. The ac2game.dta file is available.  The new AGS recognized this game and pulled it up in the list to "Continue an Existing Game" and "Continue a Recently Edited Game".  Continue an existing game will put me into the new AGS folder (do I need to copy all the files to there?) and the other will ask for an import but I am getting errors that it doesn't have access.  I don't know how to add an image with the errors.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Quote from: Ghostlady on Tue 25/07/2023 21:27:08I still have the original folder with everything in it including the compiled folder. The ac2game.dta file is available.

Alright, so you do have the project source, so unpacking the compiled game is not necessary.

Quote from: Ghostlady on Tue 25/07/2023 21:27:08The new AGS recognized this game and pulled it up in the list to "Continue an Existing Game" and "Continue a Recently Edited Game".  Continue an existing game will put me into the new AGS folder (do I need to copy all the files to there?) and the other will ask for an import but I am getting errors that it doesn't have access.  I don't know how to add an image with the errors.

I'm sorry, I could not really understand what did you do. What do you mean by "Continue an existing game will put me into the new AGS folder", is it AGS program files? If so, then no of course you should not put any files there by hand...

If you're getting access errors, then likely your project is located in a directory where you do not have a write permissions. Prior to AGS 3 the old editors would store the game projects inside their own program folder by default, but this is not the case now. You should normally store your projects in "User Documents", or anywhere else on disk where you have write access (can create folders and files).

Khris

#6
First, make sure you have properly unpacked downloaded AGS Editor files. I for instance use D:\AGS\AGS_XXX for each editor version. This way I will never get any issues with disk access or read only errors or the like.

Next you should definitely make a backup copy of the main game source folder. Simply copy the folder, then paste it into the AGS 2.72 folder.

Next, open AGS 2.72, select "Load an existing game", then open the game folder and select the ac2game.dta file.
The game should open. Save and exit.

Now move the folder into a modern version's folder, like AGS 3.2.1 and try to open it there (same basic process, "open existing game", select the main game file)
And so on.

Ghostlady

I can open the game with AGS 2.70 but when I try to save I get a write error. I never used to get this but have changed OS a couple of times since the game was created.  How do I get past this?  I think the import will work if I get past this also.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#9
Quote from: Ghostlady on Tue 25/07/2023 22:50:41I can open the game with AGS 2.70 but when I try to save I get a write error.

You mention AGS 2.70, but the error screenshot indicates it happens in AGS 3.*, and that it happens during not saving, but an import process.
Could you please clarify what are you doing?


In regards to error itself, do you have this project open in more than one program at the same time, maybe? (like - the old editor and the new editor)

If not, do you actually have an access to that folder? Like, what happens if you try to create a file there by hand?
What if you run the Editor "as administrator"? Or try to put the game files in some another place?

Ghostlady

Let's take 2.70 out of the picture.  I pulled the game into the new version of AGS.  It started as an import.  It failed due to access reasons as above.  I had to get out of the import without it finishing.  I've tried numerous times to run it again and I get the same error.  I did not have the project open in multiple places.  For curiosity sake, I tried creating a "new" game and it got created and saved with no problem to the exact same documents folder that the import is having problems with. 
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Please tell which version of AGS you are using now?

Also when importing, did you choose to "Backup files"?

Ghostlady

Version 3.6
Yes I did select backup files.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

I am not really certain about this case, but there are another 2 known reasons why AGS may not be accessing files:
* Anti-virus does not like AGS for some reason, and is blocking its attempts to write or move files;
* Windows explorer may sometimes block the changes to compiled files, if you have the folder opened while AGS is working. But this usually happens with Compiled folder only, during game compilation.

Besides that, I've been testing the old game import process in 3.6.0, and apparently 3.6.0 has some error where it cannot save the imported game properly. I may suggest trying to import into an older version first, like 3.5.1, or even 3.2.1 (the latter may be got from here), and then proceed with the 3.6.0.

I do recommend making manual copies of the old project of course, just in case, before doing any import or upgrade to a newer version.

Ghostlady

Ok I'll try that and let you know.  Thank you for all the help.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

I downloaded both of these versions of AGS and they do not recognize the game in AGS.  It should be finding Oakhaven.

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

Ok, I got it figured out.  When I went into the latest version, 3.6.0, I had to create a new game to get past the opening menu.  Once I was in the new game I went to file and then did an "open" which let me navigate to the folder where I have the old game and it pulled in in!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#17
Quote from: Ghostlady on Wed 26/07/2023 22:02:58I downloaded both of these versions of AGS and they do not recognize the game in AGS.  It should be finding Oakhaven.

The Recent game list contains games that you have opened in this particular version or earlier versions. If you have opened a game in AGS 3.6.0, then it won't be mentioned, for example, in AGS 3.5.1 or 3.2.1.

If it is not there, then simply use "Continue an existing game" and point to where the game is. You do not have to create a new game for that.

Ghostlady

I did try that but it wouldn't let me past that menu screen. 
Maybe you can help me with some of this conversion stuff.

// room script file

// total number of objects (including object number 0 which isn't used)
#define _THE_NUMBER_OF_OBJECTS_YOU_HAVE_ 15

// called when the puzzle is solved:
function on_puzzle_solved() {
  SetGlobalInt(10,  GetGlobalInt(10) + 1);
  SetGlobalInt(30,  GetGlobalInt(30) + 1);
  PlaySound(18);
    gGui7.Visible = true;
    gGui7.Centre();
    string herscore;
    StrFormat(herscore,"Puzzles: %d",GetGlobalInt(10)); 
  ScoreHer.SetText(herscore);
  ScoreHer.TextColor = cWoman.SpeechColor;
  Wait(120);
    gGui7.Visible = false;
  GiveScore(1);
  gGui3.Visible = true;
  cWoman.ChangeRoom (3);
}

int button_pressed=0, ob=-1;
int correct = 0;

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: Repeatedly execute
  if (IsButtonDown(LEFT)) {
    if (button_pressed==0) {
      button_pressed = 1;
      ob = GetObjectAt(mouse.x, mouse.y);
     
      if (ob!=-1) {
          int width  = GetGameParameter(GP_SPRITEWIDTH, GetObjectGraphic(ob), 0, 0);
          int height = GetGameParameter(GP_SPRITEHEIGHT, GetObjectGraphic(ob), 0, 0);
         
          //MoveObjectDirect(ob, mouse.x-width/2, mouse.y+height/2, 7);
          //while (IsObjectMoving(ob)) Wait(1);
      }
    }
  } else {
    button_pressed=0;
    if (ob!=-1) {
      SetObjectBaseline(ob, 0);   
      ob=-1;
     
      int i = 1; correct = 1;
      while (i < _THE_NUMBER_OF_OBJECTS_YOU_HAVE_) {
        int width  = GetGameParameter(GP_SPRITEWIDTH, GetObjectGraphic(i), 0, 0);
        int height = GetGameParameter(GP_SPRITEHEIGHT, GetObjectGraphic(i), 0, 0);
        correct=correct*(GetHotspotAt(GetObjectX(i)+width/2, GetObjectY(i)-height/2)==i);
        //Display("object number %d (correct=%d)", i, correct); //debug
        i++;
      }
   
      if (correct == 1) {
        on_puzzle_solved(); //call an event function
      }
    }
  }

This doesn't work anymore, getting an error - room5.asc(50): Error (line 50): undefined symbol '_THE_NUMBER_OF_OBJECTS_YOU_HAVE_'
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

#19
Quote from: Ghostlady on Thu 27/07/2023 01:35:50I did try that but it wouldn't let me past that menu screen. 

Why not, what had happened?

Quote from: Ghostlady on Thu 27/07/2023 01:35:50Maybe you can help me with some of this conversion stuff.

There's something weird about this, the macro name does not work in the contemporary versions of AGS if it starts with underscore.
Changing the name to "THE_NUMBER_OF_OBJECTS_YOU_HAVE" makes that work.

SMF spam blocked by CleanTalk