Author Topic: Game file format specification/layout  (Read 133 times)

Game file format specification/layout
« on: 21 Mar 2020, 02:33 »
Where can I find a specification or diagram for the AGS game file format (that is the file or set of files the engine loads)?

I'm looking to develop my own tools and workflow to develop AGS games on Linux without needing to run the editor in Wine (and if there's enough interest, it could become a publicly-released cross-platform editor). I've been going through the source code at the github site and looking at the project files for the editor running in Wine, but is there a diagram or document laying out the format for the AGS game file?

To clarify, I'm not trying to make my own version of the engine (like MonoAGS). I'm making an alternative way of creating a game to run on the standard AGS engine without having to use the Windows-only AGS editor.

Any advice on this will be much appreciated. Also, if this already exists (and is reasonably functional) I'd be happy to hear it.

Note: I don't know if this should go in "Other Engine & Editor Development", but the main topic of the thread is the file format, not the tools I'm working on.

Re: Game file format specification/layout
« Reply #1 on: 22 Mar 2020, 14:35 »
Hello.

Building a cross-platform tools has been a request for a while, and there is a number of tasks planned currently to make this easier by splitting certain processes from existing editor into stand-alone tools (like moving compiler out, in which case it may also be made a cross-platform program). From what I know, there's currently on an on-going attempt to change source room file format into XML instead of a binary blob it is now (and only create binary data when compiling the game), which may also help making editing process more transparent and easier to hook alternate tools up.
A lot may have to be said about this, so I won't go into much detail now. Just thought I'd mention this, in case you may be interested to participate in that too.


Regarding your question, I am not aware if anyone ever created a specification for this format, so everything has to be uncovered from the code.

AGS engine reads data either from the package or directly from disk. In any case, there are various files of data, which have to be named properly, found either on disk or inside a "library" pack.

Library format is dealt with in the following code:
https://github.com/adventuregamestudio/ags/blob/master/Common/util/multifilelib.h
https://github.com/adventuregamestudio/ags/blob/master/Common/util/mutifilelib.cpp

The start is a "main game data" file, which is dealt with in this code:
https://github.com/adventuregamestudio/ags/blob/master/Common/game/main_game_file.h
https://github.com/adventuregamestudio/ags/blob/master/Common/game/main_game_file.cpp
This is also where Editor is writing "main game data" (in C#):
https://github.com/adventuregamestudio/ags/blob/master/Editor/AGS.Editor/DataFileWriter.cs

The room file code:
https://github.com/adventuregamestudio/ags/blob/master/Common/game/room_file.h
https://github.com/adventuregamestudio/ags/blob/master/Common/game/room_file.cpp

There are few additional ones, which I could've forgotten, but above is a main thing.
« Last Edit: 22 Mar 2020, 16:49 by Crimson Wizard »

Re: Game file format specification/layout
« Reply #2 on: 24 Mar 2020, 02:11 »
Thank you for the detailed response, Crimson Wizard. I had found the main_game_file.* in the engine code, but I hadn't gotten to DataFileWriters.cs yet. Hopefully the work I do here will be helpful in other projects. I'll post my progress as I go.