In this thread a new idea is discussed of combining several GTA games into one game. The approach differs from a total conversion, (e.g. State of Liberty (SOL), or GTA United), where several maps are merged into the limited space of ~20000 object IDs. At this point I would like to express my respect to these incredible works! In fact, if the proposed idea is as good as I beliefe, then why not adapt this idea in other projects.
The Proposed Approach
The idea is to run several instances of the gta executable on the users computer, where each one is responsible for one map (e.g., San Andreas, Vice City, Liberty City, (possibiliy even another custom map)). Only one executable (map) is active (running in full screen mode) at a time. When the player crosses an imaginary border between two maps, then the executable for the new map automatically becomes actived and the old one deactivated. Several synchronization techniques could be implemented to mimize disruption by this transition, for instance: synchronizing camera position and orientation; synchronizing time, weather, player stats; spawning of player and surrounding vehicles in the active executable. I think that the disruption caused by a transition will not harm gameplay experience; for instance, a similar disruption existed already in Vice City when going to/from the other big island. To prevent poping up of the new map, a partial very low detailed mock-up of the other map's part that is visible from the current map (consisting only of few objects) would be added to the other engine, so the player thinks he sees the other map from the current map.
Advantages of the approach.
- Depending on the configuration one or several of the original games will be fully playable including missions and mini-games. Hence, each map will feel alife and feature-rich without compromize. Each maps would have it's own music and atmosphere which totaly makes sense in my opinion. By "configuration" I mean which gta executables are choosen for each map. I suggest to use the SA engine for all maps (hence, San Andreas would be fully playable). This could then be combined, for instance, with San Vice (Vice City for San Andreas total conversion), or Vice City Stories (another total conversion for San Andreas), and one of the Liberty City (III, or IV) conversions for San Andreas. Using only the San Andreas engine would allow a more consistent experience when changing maps and simplify synchronization and implementation.
- Most of the existing mods would still be applicable. This is a very important point for many users. Further, the game would benefit from future mods and would in this way stay alife.
- Assumeing that solving the technical problems (described below) is not too difficult, then this approach would require less work, than merging all the maps into one map.
- There would be object IDs left that could be utilized by mods.
- Several total conversions would be brought together, reviving them, and the communities would be brought together too.
- In contrast to a single map, there will be some disruption when transitioning between maps/game engines. I hope this disruption can be made very small by technical solutions (some vague d3d ideas are pointed out below).
- Users will have to install non-location-dependent mods for each engine. For example, the dynamic field of view or bullet whole mod would have to be installed on each engine. Other more location dependent mods, e.g., gasoline would have to be adapted for the other engines to have a more consistent experience.
- The computer must have enough ressources to run, e.g., three instances of GTA. However, note that only one instance will be active at a time. Ultimately the other instances will only consume memory space and not computing power.
Ok, so far we have been dreaming. Now let's have a look what technical problems would have to be solved. I think the problems can be divided into the following three categories and steps (and substeps).
- Patching gta_sa.exe to allow running several instances of them in parallel. If one instance of gta_sa.exe is running, then another one does not started by default. The goal is that the currently active EXE is in full screen mode and the other ones are in the backgroud (sleeping). Solving this problem is the precondition for this whole idea and in principle this is possible as Ss4gogeta0 has showed. Ultimately the EXE should be patch in such way that compatibility with other mods would be preserved. (Possible tools OllyDbg (1), IDA (2), Visual Studio Debugger (3))
- Transitions and Direct3D. (Update: maybe this step can be ommitted, see section "Results so far") Once the first problem is solved, the transition between games could be achieved simply by automatically changing the application in the foreground. The context switch is quite expensive, especially on the graphics side. Perhaps, better solutions are possible using D3D wrappers or injectors. I found some interesting articles for sharing D3D objects or rendering into other processes' surfaces (4,5,6,7). Maybe several gta EXEs could share a D3D object or several D3D object could render to a master process which started the gta processes? However, preserving compatibility with ENB, SALA, and other d3d-wrapper mods would be important.
- Synchronization between the engines. This is the least difficult step I beliefe. Some static adjustements between the games are necessary like adjusting the timecyc, sharing of vehicles so that when you cross the border to a the other engine, the same vehicle can be spawned in the other EXE. Shared player model. Communication between the processes can be established via a launcher.exe. The communication is necessary for dynamic synchronization. Dynamic synchronization is, for instance: spawning of player and surrounding vehicles in the active process; synchronizing camera position and orientation, time, weapons, money, weather, player stats, player health.
- Ss4gogeta0 has proved that this idea is possible (see here). He showed that two instances of GTA SA with SA:MP (Gta United and regular, hence two different process names) can be executed in parallel and one can switch between them "as if it were just a normal game" . Both were running in full screen mode!
- I have also tested running GTA SA and another game (based on unreal engine), both in full screen mode, and switching between them. This works, too. Hence D3Dexclusive mode is not a problem, and therefore maybe Step 2 can be ommitted. Note, that there is a disrupption, as the screen switches to windows, but this can be ommitted, when the switching is managed in the background by a launcher.exe.
- gta_sa.exe checks if another process with the same name is running, if yes, then it quits immediately. I did some very light patching by opening gta_sa.exe in Notepad++ and renaming occurrences of "GTA San Andreas" to another name "GTA SanXAndreas" (without changing the length). I created a copy of the whole game but with the modified exe and ran it parallel with the original game. The the second instance does not quit immediately anymore, but it runs only until the menu. Hence, there must be second reason that prevents running a second instance of the game (but it can be solved, see the post by Ss4gogeta0).
I think that GTA SA still has a long time to go even after GTAV. The reason is that many people grew up with it and the nostalgia will make them come back again and again (even if with breaks). Combining the GTA III worlds while preserving the original missions, gamplay, feeling, and atmosphere would be an amazing experience. The possible compatibility with existing and future mods for san andreas would keep this project alife. Making this mod does not require copying and adjusting models, textures, and collision files. Instead some lines of codes have to be written/modified in some clever way. I hope the idea is as good I think and that the technical problems can be actually solved.
This post describes an idea, but I'm not making any committment due to time constraints. I must admit that step 1 (patching the exe) is beyond my skills. However, when I see what mods have already been accomplished, I beliefe the legendary modders are out there who can help. I would like to invite experienced modders for discussions, relevant research results, and possible solutions.
- (1) OllyDbg
- (2) IDA
- (3) Debugging a User-Mode Process Using Visual Studio
- (4) can-you-render-a-direct3d-window-for-one-process-into-another-process-hwnd
- (5) how-does-one-write-to-another-processs-opengl-directx-context
- (6) How do I use the Direct3D Device Manager
- (7) pass-texture-using-pointer-across-process