Page 1 of 2

OpenGTA2?

Posted: 31 Mar 2016, 19:03
by paul
Does anyone know what the status of this is?

Last news was this: http://gtamp.com/2009/07/18/gta2-news/

Now his site seems to have gone including the svn, but there is some mirror on github here:

https://github.com/u9oqcd4p/OpenGTA2

Re: OpenGTA2?

Posted: 31 Mar 2016, 23:03
by Sektor
It hasn't been updated for years. OpenGTA2 supported multiplayer and allowed players to run around the city. The physics weren't finished. I don't think cars and weapon support was ever added. Black Phoenix decided to rewrite it from scratch and renamed it OpenGBH. He still owns the http://opengbh.net domain but it's been down for a while.

In 2014, someone asked him if OpenGTA2 was dead and he said no but he's not working on it: https://web.archive.org/web/20150220161 ... age_id=438

Black Phoenix is still alive and coding other projects but nothing GTA2 related. Years ago he said to me in emails that he has 3 projects ahead in the queue before GTA2 projects. I sent him an email today to get the current status but no reply yet.

https://github.com/PhoenixBlack

Re: OpenGTA2?

Posted: 01 Apr 2016, 09:28
by paul
Hmm I wonder why he would re-write it. Sounds like it was about 50% of the way there gameplay wise.

I've got a fork of the original code on github but I don't want to spend time updating it if its a dead end :).

Re: OpenGTA2?

Posted: 20 Nov 2016, 00:57
by BenMillard
The original game, with vike's modifications as promoted through GTAMP, is huge fun! Just returned to it after some years and had a tremendous evening of retro gaming on our custom levels.

Re: OpenGTA2?

Posted: 06 Dec 2016, 23:52
by paul
Has anyone worked on reversing the car physics? I've been thinking about perhaps using a dmavideo.dll proxy to try to reimplement the car physics functions.

I think for a re-implementation the car physics need to feel very close to the original. All of the reading map formats/scripts etc seems like it can be done easily enough.

In fact it seems that GTA2 rendering engine is also implemented in a DLL, so a custom/reimplementation of this is probably possible too.

Re: OpenGTA2?

Posted: 07 Dec 2016, 00:47
by Sektor
NYC.gci has all the car handling data in plaintext but you'd still need to re the game to make use of that data.

Re: OpenGTA2?

Posted: 03 Jan 2017, 18:28
by paul
I've started a project that reimplements dmavideo.dll and d3ddll.dll here https://github.com/paulsapps/GTA2Hax

After this is done I will try to make OpenGL rendering engine for GTA2 and integrate ImGui for debugging purposes. Then I can start work on reversing car physics properly. It might even make sense to reverse a lot more of the engine. Let me know if anyone has any useful info or can help :).

Re: OpenGTA2?

Posted: 03 Jan 2017, 22:35
by Sektor
Cool stuff. All the found memory addresses are in this thread but there's a lot more that hasn't been found. Vike has IDA files for gta2.exe, he'll be happy to send them.

Re: OpenGTA2?

Posted: 04 Jan 2017, 08:08
by paul
If I could get a copy of the IDB file that would be awesome :D!

Edit: Got it now :)

About 70% done in terms of having a working open source d3ddll.dll

Edit: Some more funny screen shots of various hacks/progress.

Edit: Almost have a replacement now, only lighting is missing. Colour conversion of on the menu is wrong, and the internal texture cache is always missed for some reason. But otherwise its not looking too bad.

Only bad thing is that I've lost motivation to continue now, I'll try to fix these last few missing features/bugs. But probably won't continue in the near future on reversing the main GTA2.exe.

Re: OpenGTA2?

Posted: 27 Jan 2017, 20:00
by paul
3 bugs left...

1. Lighting is super confusing due to floating point hacks, see screen shot. Struggling to get this one working..
2. Main menu graphics colours are wrong - should be easy to fix.
3. The texture cache is always missed, probably doesn't really matter on modern hardware..

Re: OpenGTA2?

Posted: 27 Jan 2017, 21:08
by Sektor
Looking good, I hope you don't lose motivation. Will you add widescreen support?

Re: OpenGTA2?

Posted: 27 Jan 2017, 22:57
by paul
Sektor wrote:Looking good, I hope you don't lose motivation. Will you add widescreen support?
I think that probably requires also replacing some functions in the main exe - the game would still only be trying to render 4:3 amount of data. Stretching the viewport is easy enough though.

Re: OpenGTA2?

Posted: 30 Jan 2017, 18:28
by T.M.
paul wrote:3 bugs left...

1. Lighting is super confusing due to floating point hacks, see screen shot. Struggling to get this one working..
2. Main menu graphics colours are wrong - should be easy to fix.
3. The texture cache is always missed, probably doesn't really matter on modern hardware..
Epic progress!

Floating point hacks hmm... sounds familiar when i was working with the Epic GTA2 Script Decompiler.

In SCR files the float values were stored by multiplying float by 16384 and storing the result as 32 bit signed integer.

Re: OpenGTA2?

Posted: 30 Jan 2017, 21:05
by paul
That sounds like fixed point. I've fixed 1 and 2 now.

The float hacks in GTA2 is some variation of this: http://stackoverflow.com/questions/1349 ... -quake-iii all replaced with a call to sqrt() once I figured out what the hell was going on!

Re: OpenGTA2?

Posted: 09 Feb 2017, 01:42
by Sektor
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.

Re: OpenGTA2?

Posted: 30 Mar 2017, 01:57
by elypter
wow, thats really awesome stuff!

Re: OpenGTA2?

Posted: 11 Sep 2019, 13:30
by jericho
Hi! Does anyone knows how cars in gta2 gets drawn on slopes? They are simple 2d sprites, and I assume there is only 2 options:
1) always perpendicular to floor regardless of slopes
2) project car sprite along slope plane

In 1 case sprite should be drawn high enough so that the edge does not fail into slope.
In 2 case sprite can overlap other objects... Or not, I don't know.

Re: OpenGTA2?

Posted: 11 Sep 2019, 13:59
by Sektor
I think option 1, the sprite never rotates on z axis.

Re: OpenGTA2?

Posted: 11 Sep 2019, 14:07
by jericho
Sektor wrote: 11 Sep 2019, 13:59 I think option 1, the sprite never rotates on z axis.
Z is for roll, but I mean Pitch, some thing like this (view from side - grey is slope): https://gyazo.com/d60c2a182ad9879d07f4b77eb34c9840 (red rect is car sprite projected to slope plane - rotate X axis)

Too bad there's no 3d look camera mode in game

Re: OpenGTA2?

Posted: 11 Sep 2019, 14:20
by Sektor
Even from top down view, I think you would be able to see if they pitched. The front and back of the vehicle are always at the same height.