Readit News logoReadit News
jonplackett · 5 years ago
I remember when GTA 3 came out on PC and I found just a simple human-readable text file you could edit to modify all the settings for all the cars.

We turned the Karuma into a physics defying monster. It was 1000x heavier than the tank, so as you drove down the road other cars just bounced off and flew over the horizon, or exploded on impact.

Yet it still did 0-100 in 0.1 seconds and could drive up walls.

One time we jumped it from the third island, over the middle island and landed on a skyscraper roof on the 1st island.

From there we spent about an hour dropping grenades on police cars and the army who had no way to reach us up there.

Fun times. Shame Twitch or YouTube didn’t exist back then to tell anyone about it!

HEHENE · 5 years ago
You would probably be pleasantly surprised with how easy handling modifications are in GTA:V.

The handling meta files are all XML now, in more or less plain English, and very well documented by the modding community.

I run an GTA:V multiplayer RPG server using FiveM[0] and the community around vehicle mods is really incredible. 3D modelers produce all kinds of real-world vehicles for GTA:V from Nissan GTR’s up to hyper-accurate law enforcement Dodge Chargers[1] with accurate Whelen lights, Setina bull bars, etc.

[0] https://fivem.net/ [1] https://redneckmods.com/product?id=3fbaf24e-7775-432e-87e1-f...

Rodeoclash · 5 years ago
Haha, you weren't the only one doing this. I used to alter the fire engine to also have some absurd weight but and engine powerful enough to still move it. Their was also a time scaling option somewhere which would slow the game down and put it into a "matrix"-esque mode.

I used to jump into the fire engine, get on the wrong side of the road on a freeway and activate the slow motion before driving head on into the traffic. Their was something mesmerising about smashing your way through the cars and seeing them lift off into the air and fly into the buildings on either side of the freeway.

Eventually the police would show up but what could they do against a fire engine that was as dense as a sky scraper!

jonplackett · 5 years ago
Yes now I remember the time changing too! That was so much fun.

Another fun thing I now remember was to turn the dampening on the Taxi’s suspension to a positive value, so if you even gave them the smallest possible knock they would gradually start to wobble like a jelly and then start bouncing and bouncing until they were leaping up higher than buildings.

artemonster · 5 years ago
If I remember correctly the file called "handling.cfg" and it was a huge unreadable CSV table :) good times.
jonplackett · 5 years ago
Yeah that rings a bell!

Really couldn’t believe my luck when I found something so obvious (I still felt like I had mad hacker skills)

asadlionpk · 5 years ago
Yes. It was a csv table with all the configs for physics engine for all vehicles.
pylua · 5 years ago
Yes ! I have a similiar memory. When I was a kid, My parents did not like me playing the game for many reasons, one being the in game prostitutes . I simply changed a file to have them removed .
raisedbyninjas · 5 years ago
We modded an SUV to have monster truck tires. It allowed you to drive over passenger vehicles like speed bumps.
unicornporn · 5 years ago
Opened this thread expecting to share this fond gaming memory. I've wished that modern games was more like this more than once. Finding jumps for crossing entire maps was incredibly liberating!
pqb · 5 years ago
> We turned the Karuma [...]

It was Kuruma, in Japanese it means just a "car".

jonplackett · 5 years ago
haha, funny, and thanks for the correction!
mcjkrw · 5 years ago
I remember raising sea level in San Andreas.

Weapon damage was also controllable. I accidentally discovered a hack I used in the multiplayer (MTA mod) that made me receive 0 damage from non-projectile weapons.

tnolet · 5 years ago
As a basic web / JS developer I’m envious that creators of this repo get to work on awesome methods and classes called “Crime.h” and “!ped->bRenderScorched && !ped->bBodyPartJustCameOff”.

Beats “div.container” in my book.

ggambetta · 5 years ago
I get you. I was a game developer a couple of lifetimes ago. I once had to investigate and fix a bug called "HANDBAG TURNS INTO A BANANA". Never had anything like that in the corp world :_(
alisonatwork · 5 years ago
Hang in there. We once had a bug "PRODUCT IMAGE TURNS INTO A DOG" due to some code that kept falling back to an embarrassing placeholder.
ttt0 · 5 years ago
Reminds me of the interview with Tarn Adams from Dwarf Fortress.

https://www.youtube.com/watch?v=VAhHkJQ3KgY

fnord77 · 5 years ago
is it more stressful working on games than in the corp world?
grokkedit · 5 years ago
You can still write a fully working page with a body but without a head, and a parent can do whatever it wants with their children, destroy them if necessary... It's not that bad...
onion2k · 5 years ago
A lot of my frontend code should probably live in a file called crime.js
rkuykendall-com · 5 years ago
Great collection of real video game changelog entries: https://twitter.com/thestrangelog
withmorten · 5 years ago
Then you'll love "CCutsceneMgr::RemoveEverythingFromTheWorldForTheBiggestFuckoffCutsceneEver()" - yes, that is a name originally chosen by R*!
tmpz22 · 5 years ago
Quirky variable names does not a good code base make.
spoonjim · 5 years ago
It’s not a quirky variable name, it’s just the description of what’s happening in the game.
bzb6 · 5 years ago
Rockstar forgot to strip the PlayStation binaries so I suppose those are the variable names of the original codebase.
aap_ · 5 years ago
Maybe this site is the best place to ask. There are two major things we could use help with:

- the games do not run particularly well on the raspberry pi (any version really) and I have a feeling it's at least partially due to the OpenGL layer. We could really use someone with how to optimize OpenGL (especially on the pi).

- physics have always been wonky beyond 30fps. I think someone with a good knowledge of game physics could really help us here.

sokoloff · 5 years ago
I did some of the physics work (but was not the lead) for Papyrus racing games in the ‘95-‘97 era. Email’s in my profile if I can help.

My recollection of Vice City is that the vehicle dynamics model is not particularly realistic but optimized for “fun gameplay with a hint of realism” whereas Papyrus optimized towards “realistic gameplay with a hint of fun”. :D

Our physics engine was deeply, deeply tied to a particular isochronous rate (30 Hz, then later 60Hz, IIRC) with all kinds of hackery to make that happen and divorce rendering rate from physics rate. (On the PSX, we ran physics engine tied to the VBlank.)

aap_ · 5 years ago
Yeah, i think so too. In Vice City the most surprising thing to me was that they actually modelled tire temperature. it's probably a bit crude but i found it interesting. As for the physics code, there's a big ProcessControl function all sorts of physical entities that does everything that has to happen to that entity each frame. some of it is physics, some not. My theory as to why varying timestep produces different results is that the physics calculations form some sort of differential equations whose solution depends on the timestep. That may be wrong but it makes sense to me at least. My approach to fixing it would be to log all sorts of forces applied to the physical objects each frame and log them so they can be compared. this is quite a bit of stuff to implement though so nobody has done it yet. if you or somebody is interested in that, we'd appreciate that a lot.
rzzzt · 5 years ago
The physics engine of Vice City is definitely tied to the frame rate. If you switch off vsync, you can only drive in reverse veeery slowly.
mypalmike · 5 years ago
Ha, back in that same era I was working at a small game company that was in discussions with Papyrus about doing some work on the Indy Car Racing game - probably a Playstation port. It never happened - I think it was determined that it wouldn't sell enough to cover the development costs. I don't remember much else except we played the PC game ("research") and it was super difficult - you needed a lot of skill not to crash at every curve. I also seem to recall that the polygon models for the cars were based on manually edited text files. Good times.
Const-me · 5 years ago
> We could really use someone with how to optimize OpenGL (especially on the pi).

Not sure that gonna help much.

I think what you should do instead, port your OpenGL code to OpenGL ES. Specifically, Raspberry Pi 1-3 support GLES 2.0, Pi 4 supports GLES 3.1. As a nice side effect, renderer will become portable to smartphones.

This may or may not be a lot of work, depending how exactly you use OpenGL.

Pi 4 introduced Vulkan as well, but unlike GLES I have not tested it and not sure how good is the support.

aap_ · 5 years ago
I have in fact tested everything with GLES 2.0, 3.1, and desktop GL 2.1 and 3.3 and they should all work. If it's as efficient as it could be is another question. I find OpenGL rather messy as an API compared to d3d9.
phire · 5 years ago
It's a bit of an underpowered GPU, but I would have thought it would be powerful enough to run an early PS2 era game like this.

It might just be really unhappy with the number of draw calls that you are doing. Looks like you are currently doing a drawcall per mesh; You might need to pack multiple meshes into a single drawcall.

Do you have any idea how many drawcalls per frame you are currently doing?

aap_ · 5 years ago
Using renderdoc with normal opengl i count 660 draw calls on a hopefully representative frame. Multiple meshes per drawcall are hard due to the architecture of renderware. I have considered sharing vertex and index buffers though. Do you think that will make a big difference?
rwmj · 5 years ago
> physics have always been wonky beyond 30fps

I suppose this is because the original developers knew exactly what hardware this would run on and the achievable framerate on the PS2 and so took lots of short-cuts in the code?

Edit: Incredible project by the way.

aap_ · 5 years ago
They actually did try to make it work at all frame rates but I don't think they were actually able to test it very well because the hardware, as you said, didn't do it.
peruvian · 5 years ago
A lot of games were hardcoded for a specific FPS. Even modern-ish ones!
zamalek · 5 years ago
Time corrected vertlet integration[1] is really approachable and I'd strongly recommend trying it out.

[1]: https://www.gamedev.net/articles/programming/math-and-physic... Edit: http://archive.gamedev.net/archive/reference/articles/articl...

zennit · 5 years ago
Could box86 help here? https://github.com/ptitSeb/box86
terramex · 5 years ago
No, according to README.md re3 works natively on arm64.
albertzeyer · 5 years ago
Can you give some more details how the reverse engineering was done exactly? (And maybe put that also in the README or somewhere, because I think this is probably interesting to some.)

You write:

> re3 was started sometime in the spring of 2018, initially as a way to test reversed collision and physics code inside the game. This was done by replacing single functions of the game with their reversed counterparts using a dll.

How exactly? So the game EXE exported all the function symbol names? How did you know the function signature (arguments, return type)? And then it is enough to preload a DLL to replace the function? There is no global state or so which must be accessed?

aap_ · 5 years ago
Maybe you'll find the first commit instructive: https://github.com/GTAmodding/re3/tree/600bf0351476a5a21aabb...

We were very lucky that we had symbols for global things, which inludes function names and signatures but not return types. We then replaced the first instruction of a function with a jump to our own. global variables can be done with a reference to a raw address. virtual methods are a bit of a challenge but we found way to handle them.

dom96 · 5 years ago
Wow, that's cool, so you replaced each of the game's functions individually until you had the majority replaced and working stand-alone?
4gotunameagain · 5 years ago
I think that for games like those, which more or less defined entire generations of people (the ones that were into gaming ofc) in a lot of countries, it should be mandatory that their source code is made public after like, ten years or something.

Sure, a company created it and it should be its intellectual property for enough time to return the investment etc. But something ingrained so much into people imo trancends that and should be considered belonging to the public realm.

jrrrr · 5 years ago
I can imagine a policy mandating that for all commercial software, source code goes into escrow for automatic release 10 or 20 years later.

The company doesn't have to be around anymore, rights don't have to be negotiated, etc.

Short of that I wish more companies would do it voluntarily. I'm not into id games, but they're one example that comes to mind.

spideymans · 5 years ago
This is critical imo, if only because software are cultural artifacts that should be able to be archived just like any other cultural artifacts.
news_to_me · 5 years ago
Have you ever heard of free software? ;)
4gotunameagain · 5 years ago
I have never heard of compulsory source releasing
jeofken · 5 years ago
Any law in the end requires a violent threat. This suggestion implies that someone who does not publish their source code should, after som ignored formal letters, get armed men sent to their office to kidnap whoever is responsible.

All nice sounding laws, such as gov funded welfare, gov funded hospitals, gov funded schools, and the endless regulations, implicitly carry a threat of violence, and when judging the ethics of a carrying a law out, that violent threat must be included. Government is firstly about guns.

zymhan · 5 years ago
Quite the slippery slope fallacy.

You're also conflating civil and criminal law. Copyright is civil law. The government doesn't send the FBI in to ensure some publisher respects that a book's copyright has lapsed.

noname120 · 5 years ago
Check the other branches out! There is one for GTA Liberty City Stories[1], and another one for GTA Vice City[2].

This project enabled people to port GTA to the PS Vita device[3]. This device hasn't seen any games from the franchise, so this is a big thing.

[1] https://github.com/GTAmodding/re3/tree/lcs

[2] https://github.com/GTAmodding/re3/tree/miami

[3] https://github.com/TheOfficialFloW/re3

neilv · 5 years ago
Nice labor of love, and team accomplishment. I might have to re-buy Vice City (for game assets), just to try this on my Linux GPU box.

I got into the GTA franchise when (after not playing video games for a long time) I happened to see an old PS2 Slim that someone had put out beside the trash on the curb, brought it home, and started buying old games on eBay for a few dollars.

Adolescent humor and terrible themes&glorification aside, GTA Vice City led me to GTA San Andreas, which was both a compelling open world, and some great gameplay. I came to very much dislike members of other gangs, who were always starting crap when I was just going about my business -- which I suppose fit the story, and was also good mechanics for a game.

At some point, I had to buy a PS3, for GTA IV, which had been out a while. The PlayStation was a GTAstation. At the end of the story mode, as the cast-of-thousands credits rolled, over a montage of views of the New York City world they'd built, my reaction was that this game was a significant achievement for humankind.

And it was engaging enough, that, by endgame time, er, I might've developed muscle memory for consistent PVP headshots, high-speed "chicken" drive-bys, and literally driving circles around another player's car while concentrating fire on their driver position. One of the highest compliments you can receive is being wrongly accused of cheating.

In the very limited time I have for gaming lately (none, at the moment), it's usually been Ubisoft open worlds, but, whenever I check back into GTA Online freeroam, I'm reminded that it's the most actively fun for me. Cycles of retribution with another player or three, for the most creative or spectacular ways of fighting each other. And sometimes I even have the personally fulfilling opportunity to teach-- OP Mk. II griefers, that the Buzzard is still to be respected. (But forget heist stealth missions with randoms... :)

(Story-wise alone, The Last of Us might be my all-time favorite game. I dislike zombie stories in any medium, but, by the climax, I was misty-eyed, caring for the child character I was protecting.)

randomswede · 5 years ago
How possible is it to use the PS2 version for extracting assets? If the answer is "do this" or "we don't know", I am (in principle) willing to spend some time looking into it, but if the answer is "it won't work", that is useful information as well.
aap_ · 5 years ago
Hi, (co-)author here. Cool to see this here :)
NullPrefix · 5 years ago
>Do not use features from C++11 or later.

Is this a technical requirement to have compiler feature parity on all platforms?

aap_ · 5 years ago
Pretty much, but also our goal is to recreate the code in a way that R* could have plausibly written it. And that implies no C++11.
withmorten · 5 years ago
To add to what aap mentioned, it also made it relatively easy to compile re3 and reVC with the original IDE it was written in - CodeWarrior 7. Some things accidentally made it in, like sized enums, but overall no major surgery required, or rather, far less than I expected.
ayoubElk · 5 years ago
This is fascinating, thanks!

Can you speak about what it took to achieve this? (required knowledge, process, etc...)

aap_ · 5 years ago
We were lucky that we had symbols from PS2 gta3 and the android games. other than that it was a lot of reading code in IDA and massaging it back into c++. I made a little video about part of the process [1] but i never did part 2.

The strategy for gta3 was to replace function by function of the game until we had everything replaced. for VC we evolved our existing code base by, again, reversing function by function until we had everything done. Just not by dll injection this time.

[1] https://www.youtube.com/watch?v=22BeuOOERLo

duncanspumpkin · 5 years ago
Hey, whatever happened to openrw? I remember trying to get into that back in 2017 but looks like this project ended up superseding it.
app4soft · 5 years ago
Any ideas to make it usable under ATI RS600 on Linux with Mesa drivers?
aap_ · 5 years ago
I assume you have tested it and it doesn't work? Maybe the GPU is simply too old. I'm doing everything with shaders and it's possible they are just too much for this GPU. Supporting a wide range of hardware (especially old one that nobody has anymore), is not easy.

Deleted Comment

ChuckNorris89 · 5 years ago
Thanks for your efforts.