
Description
First of all, sorry for the long post below, but I thought this has to be written to document what we are trying to do and why.
This is a continuation of #403, but the old thread became way too cludged with all the heated discussions, and options.
Preword
From the early days this open source project suffered from mixed goals and purposes. On one hand, the game making community desired AGS to improve and get additional functionality, on the other hand there was a significant number of game players, who wanted to play both modern and old AGS games using same engine and its ports. There had been an attempt to make AGS port for ScummVM, but it was not complete at that time, and so this engine was the only way to run majority of games.
When we just started, this problem was never properly discussed (in my memory at least, but I've joined late) and no concrete decisions made regarding solving it.
As a result, all the subsequent development was largely complicated by the need of maintaining backwards compatibility. It was not only supporting legacy features in the engine, to be able running old games without conversion, but also supporting loading old games into the editor in case game developer would like to import and continue their ancient project.
This was further aggravated by the very low number of contributors involved. (For example, initially my primary goal was to refactor the code, but I soon had to suspend that work in favor of doing other tasks.)
Current situation
Today the project development has practically stalled. There are some minor additions, as well as some refactoring made over time, but apparently no much interest in developing it further. There is a number of things AGS is lacking that are making it difficult to use in the modern enviroment, such as unicode support for example.
So its future is unclear.
Course of action
So, @AlanDrake's suggestion (#403) is to a) radically clear the code from the legacy support, b) refactor the cleaned code, so that it is potentially easier to develop further.
Then after that's done maybe get the legacy support back in a modular way, that won't impose any constraints on future development (although legacy support is very low priority from his point of view).
This approach has both pros and cons; the opposite method of gradually refactoring the engine while keeping all the backward compatibility intact also has pros and cons.
Personally I have very mixed feelings about it, but acknowledging the fact that the number of active contributors is very low, and program development is barely existent, it looks like there won't be any "good" way out of this situation, there will be trouble no matter what we choose; only difference is in the nature of the trouble (and number of people willing to cope with it).
To sum up, the idea is as follows:
-
We create a branch called, e.g. "ags3" (since the major version is 3). From now on and until further notice this branch will contain latest version of the engine and editor compatible with importing and running old games. This branch will allow only necessary fixes, and only updates that improve its perfomance. Also, naturally, any kind of backward compatibility updates.
-
The latest version in 3.x.x family is probably going to be 3.4.2, because there is already a WIP version of it released for public use & test. Note that it still is kind of rough at the edges in the Editor, where we implemented new navigation bar, so may need extra tweaks. These should still be made in "ags3" branch.
-
Current "master" branch becomes a place of a refactoring project, which first priority is to clean and refactor the engine code (possibly editor too where necessary). All backward compatibilities are cut, except for loading latest 3.4.x games. This branch is allowed to become unstable for some periods of time too.
-
In case there is a patch that is worth to be also added to ags3 branch, one of two possible methods is used: either patch is applied to ags3 branch, and then to master separately, or after its applied to ags3, ags3 is merged to master very carefully, to not bring unnecessary code there again.
-
People willing to contribute for running old AGS games are also encouraged to assist finishing ScummVM AGS port, started by @fuzzie, and continued by @morganwillcock. This project may be found here: https://github.com/adventuregamestudio/scummvm/tree/ags
We of course need to explain all this very clearly in the Readme.
What should be the closest goals of this rewrite?
IMHO, if we are doing such change to the code, than after this first step we must do second and actually refactor it completely (more or less), and also break any constraints that were restricting development (such as data format constraints, imposed by the old plugin API, for example). Because, although removing legacy code would make it somewhat easier, large portions of contemporary code is still very hard to work with.
In such case I'd propose to open a "refactoring master ticket" with a list of most outstanding necessary changes and remaining unrefactored parts for contributors to choose from.
We'd need to also discuss the overall structure of the engine code we are aiming at, to prevent erratic changes.
To give an example, considering the upcoming SDL2 port (by @sonneveld), we probably should aim to restructure main program loop to make it consistent with SDL's event queue.
Issue of the legacy code
First of all, the legacy support stays in the "ags3" branch. @sonneveld already mentioned that his goal is to complete SDL2 backend for 3.x.x version. If this is done, that would hopefully cover some of the issues we have with e.g. Linux port. So the legacy branch, although not developed further, would still exist as a way to run old games.
Hopefully, the ScummVM port will be also finished someday. I'll post the link again just in case someone wants to test/contribute to help it happen faster: https://github.com/adventuregamestudio/scummvm/tree/ags
Finally, if that would still be wanted, an option which remains is to get the legacy support back if/when the refactoring in the master branch is completed. If done correctly, that should not interfere with the actual development, and scare anyone away.
In such case the biggest question is how to find what functionality to restore. If we are merging ags4 branch into master, as suggested, then this merge commit would contain all or most information about what was deleted. Much of that code was already distinctly separated, or related to very particular legacy data structs, which makes it possible to understand its meaning with certain effort.