OpenGTA2?

Anything to do with GTA1/GTA2 that isn't covered by the other forums
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

OpenGTA2?

Post 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
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post 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
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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 :).
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: OpenGTA2?

Post 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.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post 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.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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 :).
Attachments
2017-01-02 (3).png
2017-01-01.png
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post 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.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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.
Attachments
2017-01-05 (6).png
2017-01-07.png
2017-01-05 (4).png
2016-12-27 (6).png
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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..
Attachments
2017-01-27.png
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post by Sektor »

Looking good, I hope you don't lose motivation. Will you add widescreen support?
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: OpenGTA2?

Post 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.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post 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!
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post 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.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: OpenGTA2?

Post by elypter »

wow, thats really awesome stuff!
yur sa'nok ngeyä
User avatar
jericho
Car Jacker
Car Jacker
Posts: 23
Joined: 09 Sep 2019, 20:03

Re: OpenGTA2?

Post 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.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post by Sektor »

I think option 1, the sprite never rotates on z axis.
User avatar
jericho
Car Jacker
Car Jacker
Posts: 23
Joined: 09 Sep 2019, 20:03

Re: OpenGTA2?

Post 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
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post 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.
Post Reply