adventuregamestudio / ags

AGS editor and engine source code
Other
701 stars 160 forks source link

Discussion: Status of the master branch #35

Closed tobihan closed 11 years ago

tobihan commented 11 years ago

Hi,

I did some testing with the master branch on 64 bit and it seems like some games don't crash anymore at all. There still seem to be some regressions though, especially with older games, see issues 33 and 34.

The detection of game files when only providing the folder does not work reliably yet, for instance when the folder name is given in quotes because it contains spaces. Barn Runner 1 Eclair 1 is not found even when the full path does not contain spaces and no quotes are used.

ghost commented 11 years ago

Regarding game detection. The AGS does it in a bit messy way IMO, and there is this part about looking for *.exes, which runs on linux, but not on Windows.

I want to suggest make a strict specification here about how the engine should look for game on any platform, in order of priority. Then improve the code.

Like:

  1. Use command line parameter to set a data file.
  2. Use command line parameter to set a data file's folder; 2.1. Look up for game.exe; 2.2. Look up for ac2game.dat; 2.2. Look up for ac2game.ags; (or maybe better just any *.ags?)
  3. Look for attached data in current running exe.
  4. Use current (active) dir to set a data file's folder; 4.+ Repeat 2.+ steps in this folder.
tobihan commented 11 years ago

On 12/03/2012 11:37 AM, Ivan Mogilko wrote:

  1. Use command line parameter to set a data file's folder;

2.1. Look up for game.exe;

With 2.1 you mean look into every .exe file and detect if it is an AGS game or just look into the file game.exe?

ghost commented 11 years ago

Erm, I missed a space there :). I mean game *.exe.

rofl0r commented 11 years ago

this may come in handy: https://github.com/rofl0r/agsutils (can extract and repack games, so you can get rid of the .exe stub, saves about 500KB per game)

jjsat commented 11 years ago

I think it is unexpected behaviour to search for the datafile in the current directory if a different directory is specified on the command line. If the data cannot be found in the specified directory the data loading should fail.

The current directory should only be searched if no datafile argument is given.

As for the implementation: The current code is tailored to Linux in that it uses opendir() etc. There are alternate functions from Allegro (al_findirst, al_findnext) though.

The PE reading code is in C and changing that temporarily breaks the PSP launcher. Because of that it doesn't use engine headers yet (like core/types.h) and is not bigendian compatible. The idea behind it is to read the version information from the PE file and compare the original filename with "acwin.exe", also the version string can be compared.

ghost commented 11 years ago

@rofl0r

this may come in handy: https://github.com/rofl0r/agsutils (can extract and repack games, so you can get rid of the .exe stub, saves about 500KB per game)

That would be nice, I think. Perhaps agsarchives.com could feature separate game *.dat downloads. The future versions of Editor could have a simple option to produce raw dat instead of win exe.

@jjsat

The current directory should only be searched if no datafile argument is given.

Yes, I see this point; agreed.

The PE reading code is in C and changing that temporarily breaks the PSP launcher.

Apparently I haven't paid enough attention to how psp works, so I did not quite understand what you mean. Is it broken already, or it may be broken if we change something? Or, it compares the game's exe header to engine's header, and that no longer matches? I better check more in the code...

jjsat commented 11 years ago

Sorry, I didn't explain this very well. The PE reading code is currently C code and works perfectly fine.

I just wanted to explain why it is not following the engine code style and why it doesn't use other engine headers.

ghost commented 11 years ago

There's also data file path read from config file. What priority should it have in relation to command line?

tobihan commented 11 years ago

Lower than command line.

jjsat commented 11 years ago

It should probably have the highest priority after the command line. That means before "attached to exe".

e: ^^^ I think we mean the same.