Page 2 of 2

Re: OpenGTA2?

Posted: 11 Sep 2019, 14:33
by jericho
Mm okay, good point. I'll try to to see in slow motion

Re: OpenGTA2?

Posted: 11 Sep 2019, 14:47
by Sektor
Welcome to the forum. Are you just curious or are you creating something? Why did you post in this topic?

Re: OpenGTA2?

Posted: 11 Sep 2019, 15:57
by jericho
Sektor wrote:
11 Sep 2019, 14:47
Welcome to the forum. Are you just curious or are you creating something? Why did you post in this topic?
Thanks :)
Actually i'm creating my own remake of gta1 entirely from scratch (but it currently on very very early stage) and now collecting some info which i believe might be helpful.
I didn't want to create new topic for this tiny question, so I wrote here, sorry )

Re: OpenGTA2?

Posted: 26 Sep 2019, 18:20
by B-$hep
SEKTOR
Sektor wrote:
09 Feb 2017, 01:42
Likely way outside the scope of this project but are you able to debug audio? I want the shocking.wav to play when you die on train tracks, it displays the "shocking!" text but instead plays wasted.wav. Other sounds aren't played either like toasted and game over. Shocking.wav will actually play if it's your last life although in that case you'd think gameover.wav should play.
I looked into GTA2.exe, it seems it always calls wasted.wav for dying or something. Its hardcoded.
I attached the screenshot. The nr 1 in red box is the wasted.wav
Untitled.png
Untitled.png (23.39 KiB) Viewed 1261 times
I havent yet digged so deeply into this, this function is choosing what audio is played:

Code: Select all

char * __fastcall FUN_00564430(int param_1)
{
  switch(*(undefined4 *)(param_1 + 0x44)) {
  case 0:
  case 1:
    return s_wasted_0061aed4;
  case 2:
    return s_fried_0061aecc;
  case 3:
    return s_nicked_0061aec4;
  case 4:
    return s_shocked_0061aebc;
  default:
    return (char *)0;
  }
}
What is the "nicked"?
Fried should be played when ped is torched? I guess.
Have to dig deeper to find out why is wasted always called.

Re: OpenGTA2?

Posted: 26 Sep 2019, 18:58
by paul
I wonder if anyone would be interested in fully reversing GTA2 original exe?

This would mean:
1. Disassemble the game to asm source.
2. Re-assemble and patch any time stamps in the PE header/debug info so it produces exactly the same original exe file.
3. Re-create the MSVC6 build environment.
4. Replace each asm function 1 by 1 with C/C++ code that produces exactly the same assembly instructions as the original function.

Re: OpenGTA2?

Posted: 27 Sep 2019, 11:10
by elypter
this is a huge undertaking and very difficult to automate. however there are some new approaches for disassemblers that use machine learning which look very promising. i think effort is best spent in improving those tools and adapting it to the build environment gta2 was made with. decompiling will probably never be fully automated but my vision for the perfect decompile would be one that is able to take a bunch of user input like the memory addresses that the community found including descriptions and any other known variables and then let the ai work backwards from there giving the internal objects proper names and groupings based on the provided information

Re: OpenGTA2?

Posted: 27 Sep 2019, 20:35
by paul
Yep I fully expect this would be a multi person multi year project. Also agree that it can't really be automated. It would be manual work on around 5-6k functions.

I wouldn't do this alone if but we had say 5-10 people working on it then it could be possible to do within a few years.

Re: OpenGTA2?

Posted: 29 Sep 2019, 19:37
by B-$hep
  • Im willing to join.
  • I love GTA2
  • I have "worked" previously as cr@cker and reverse engineered many exes/apps
I really wish that somebody/somewhere got a real face to face contact with some "huge boss" in R* and ask them about the possibility to make GTA2, editor and all dlls open source.
It's 20 years old game.
In 2002 or 2004 they recompiled the sources of GTA1 and GTA2 and released the classics (now unavailable).
It means they have the sourcecode.

Even Microsoft is releasing lots of source lately. Why R* cant just release this messy old 20 years old code, put it on GitHub or something with specific license and let it be.
GTA1 is even older but also interesting to have with sources.
So many ports and mods could be made for both GTA1 and GTA2.

Re: OpenGTA2?

Posted: 30 Sep 2019, 21:11
by paul
I think the first thing to be done is to collect all known versions of GTA2 for cross comparison and hope of any symbol leaks or debug compiled versions.

I know of these versions:

-PS1 release
-PC demo
-PC retail
-PC "rockstar classics"

Re: OpenGTA2?

Posted: 01 Oct 2019, 21:47
by elypter
there were also some special releases for some language regions and multiple official patches

Re: OpenGTA2?

Posted: 02 Oct 2019, 09:06
by B-$hep
Really?
I have original, the 9.6F, Playstation and demo version.
I know there is a russian version also.
Dunno about others.
I have demo and PS version on dvds somewhere.
Have to dig out

Re: OpenGTA2?

Posted: 02 Oct 2019, 12:45
by elypter
there was a japanese version as well. i collected some additional versions in the game pakx.

Re: OpenGTA2?

Posted: 02 Oct 2019, 14:37
by B-$hep
Nice.
It would be great to find these all.
I doubt that they were compiled differently but who knows..
BTW: here are all the known .cpp files from GTA2.EXE, the original ones that were actually in source tree. Maybe 1-2 missing, dunno, but i will add them once i find them.
Image

Re: OpenGTA2?

Posted: 02 Oct 2019, 16:04
by elypter
i was searching for releases quite thorowly back then but i dont remember any details anymore. if you want to find every release i suggest researching what once existed and then if you cannot find downloads anymore to ask on retro forums and subreddits

Re: OpenGTA2?

Posted: 17 Oct 2019, 22:19
by JernejL
https://github.com/paulsapps/GTA2Hax

"Reimplementation of DmaVideo.dll and d3ddll.dll for GTA2"

Someone did this a few years ago.

Re: OpenGTA2?

Posted: 17 Oct 2019, 22:33
by Sektor
There's the freeloader version but that also has no debug symbols. The exe is larger than 9.6f. It was officially licensed and recompiled but the freeloader company went out of business.

I included their original installers and manuals but all you really want to look at is gta2freeloader.exe

http://gtamp.com/GTA2/gta2freeloader.7z , it's v10.5

Re: OpenGTA2?

Posted: 19 Oct 2019, 12:44
by B-$hep
So it means freeloader had sourcecode?
Why they bought the source anyway?
Whats the point. Same game. No changes.

I wonder if the guys from freeloader still have the sourcecode.