GTAStunting

General => General Discussion => Computer Talk => Topic started by: JayFoxRox on May 03, 2006, 09:03:14 AM

Title: Replay File/Memory documentation
Post by: JayFoxRox on May 03, 2006, 09:03:14 AM
Hi guys. I think the only way of improving the original Replay in San Andreas is by collecting all the data we know in a thread. When you know something please post the information here.

I have just started searching data. So when I m sure that the data is correct I will add them here.

Memory (Running Process)

Current Replay

-/-

Replay in memory

-/-

File (gta_sa.exe)

-/-

File (replay.rep)

Frame size=344 ??

Unknown Frame base
+0 = Pos (Matrix)

Misc

Matrix
+0 = X (float)
+4 = Y (float)
+8 = Z (float)

Released Patches

-/-
Title: Replay File/Memory documentation
Post by: JayFoxRox on May 03, 2006, 09:10:15 AM
dec 84 in replay.rep seems to store the base coords... So actually this points out if GTA saves each Frame or use one base adress

Frame Tech.:

1 second - 2015.0 150.0 26.5
2 second - 2016.0 151.6 26.5

Header Tech.:

Header - 2015.0 150.0 26.5
1 second - 0.0 0.0 0.0
2 second - 1.0 1.6 0.0

So this finding seems to be really important because when i change it the whole replay is messed up. So it shows me that the 2nd way (Header Tech.) is used

//Edit:

dec 268 in replay.rep stores coords too... Unused?

//Edit2:

The game updates the replay engine only when the camera is moved:

(http://img53.imageshack.us/img53/8235/replay3ab.png) (http://imageshack.us)

This is my 1st hacked replay. Maybe you notice that i m standing in mid air due the hack! My hex editor replaced 37 findings for a 3 second replay which means that 1 frame ~ 100 ms - is that correct or did my brain hoax again?

//Edit3:

There is an PED pool at the end of the file i think...  When no PEDs are lpaded the data is zero. When there are PED atleast the Model ID is saved there
Title: Replay File/Memory documentation
Post by: marklund on May 03, 2006, 10:29:03 AM
Hey Fox, great work! Good luck on finding more valuable values from the .rep files, this may become a big discover.

:)
Title: Replay File/Memory documentation
Post by: JayFoxRox on May 03, 2006, 10:33:39 AM
It became allready:

Pos, Rot, ModelID, Time, Weather is known right know. I just started on a tool which is reading all data using special plugins. So we can find things much easier and scan the unknown offsets for values only :)
Title: Replay File/Memory documentation
Post by: Juan on May 03, 2006, 11:20:10 AM
Quote
It became allready:

Pos, Rot, ModelID, Time, Weather is known right know. I just started on a tool which is reading all data using special plugins. So we can find things much easier and scan the unknown offsets for values only :)
Keep working brother, cause if you ever make a tool that allows you to change the fps from 25 to thirty, or allow you to change the weather, bike color, skin texture, etc, you will be god. :D  
Title: Replay File/Memory documentation
Post by: JayFoxRox on May 03, 2006, 11:33:04 AM
Thats possible allready (Have a look at gtaf - Documenting SA memory addresses in modding/misc section) . What i do is trying to understand the replay format rockstar made so i can make bike wheel spins etc...

//Late edit:

Think i missunderstood you - trying exactly what you said now
Title: Replay File/Memory documentation
Post by: Daffy on May 03, 2006, 11:37:48 AM
Repediting is something i think should remain untoched, i don't want to see fabricated stunts...
Title: Replay File/Memory documentation
Post by: Nitzkit on May 03, 2006, 11:44:26 AM
O_O fabricated?....that would be the end of stunting....imo
Title: Replay File/Memory documentation
Post by: Daffy on May 03, 2006, 11:47:17 AM
Excactly my point.
Title: Replay File/Memory documentation
Post by: gunner on May 03, 2006, 01:14:54 PM
already found by someone, it was useless tho :P and it would be much more interesting if you posted this on gtaforums.com then on a stunting forum... almost no one knows what to do with those offsets..
Title: Replay File/Memory documentation
Post by: JayFoxRox on May 03, 2006, 11:21:52 PM
Daffy and Nitzkit:

fabricated? That is not the thing i want to point at... But it has been my bad i should have explained more detailed:

I want to IMPROVE the replay code rockstar made! Add spark, wheels spinning etc... There are different ways of doing this. I start in the saved replay files to find out in which order and how it is saved. Then i will have a look at the functions (in the running GTA Process) which are writing and reading from it. When i know how that works i could hook the function so it would at my data too (Particles for spark as sample).

I found out that when i record a replay using a car and change the car id to 522 (NRG) in replay.rep the replay will show me a NRG with spinning seat! Thats logic due the model format. But i m sure there is a way to change the part which should be rotated so the wheels are spinning. I got the wheels spinning on XBox allready using a simple default.xbe crack (xbe = xbox executable)

Gunner:

First: Thanks for your reply. Its been the first respectfull in a long time :)
You are right maybe... But the thread on GTAF has been closed cause it has been a Question - not a Project or sthin. There was the same topic in the Memory doc. But it wasnt explained good and also it has just been sum RAM findings.
Maybe some guys dont know what to do with the stuff i post here. But there are others like you and Marklund who should know this.


So all i want to do is improve and explore the R* replay format. Fabricating stunts using hacks is nearly impossible cause Replay files can be about 5 mb sometimes... This would mean 1000s (!) of bytes. We would need to know them all. (And it has never been my idea to do that ;) )
Title: Replay File/Memory documentation
Post by: Dannye on May 04, 2006, 04:09:56 AM
Sounds like a nice idea dude.

And although i dont know much (at all) about how you are doing it, its still nice to read your updates as you make them  :)  
Title: Replay File/Memory documentation
Post by: Urban Legend on May 04, 2006, 07:06:40 AM
keep it up dude, looks like you've made good progress eh?
Title: Replay File/Memory documentation
Post by: JayFoxRox on May 04, 2006, 07:29:04 AM
Allrite... The plugin loader is nearly completed. My tool loads a class.ini with the following data:

[Class]
ped=0
car=1
bike=2
heli=3
boat=4
plane=5
pushbike=6

The tool compares the current object type with the id's - then it will load the correct file ("PED.ini" as sample) that file looks like this:

[Plugin]
Name=Pedistrian
Author=J-Fox
Size=100
[Data0]
Name=ModelID
Type=1
Offset=1
[Line]
[Data1]
Name=Position X
Type=4
Offset=4
[Data2]
Name=Position Y
Type=4
Offset=8
[Data3]
Name=Position Z
Type=4
Offset=12


So it shows me the position and model ID in a table. The size is used to generate the offset where the next block starts. Also the tool will create a list in the future showing me all Objects and Frames found in the file. So i can easily add new values i found and update the ini! When i know the whole file format it shouldnt be the problem to create a dll which gets inprocess with GTA and pushes my code to the orig. function which saves or loads replays. By that i could add extra data like particles etc without screwing up the orig. replay.

//Edit:

Screeny :P

(http://img76.imageshack.us/img76/7264/replay1nf.png) (http://imageshack.us)
Title: Replay File/Memory documentation
Post by: The Antidote on May 04, 2006, 08:38:31 AM
Quote
O_O fabricated?....that would be the end of stunting....imo
lol I think thats a very long way off.
Title: Replay File/Memory documentation
Post by: ZeroX3k on May 07, 2006, 11:32:16 PM
Nice Work, Good Luck :)
Title: Replay File/Memory documentation
Post by: gunner on May 08, 2006, 05:28:13 AM
Quote
Nice Work, Good Luck :)
What nice work? theres nothing interesting in here yet..
Title: Replay File/Memory documentation
Post by: boxXx on May 08, 2006, 10:42:36 AM
i liek it hope you guys get more stuff :P  
Title: Replay File/Memory documentation
Post by: mikey2008 on May 15, 2006, 06:05:04 PM
yea so far this is really interesting seeing as how i have noe experence w/ .rep files or even Sa on pc yet.
Title: Replay File/Memory documentation
Post by: marklund on May 27, 2006, 09:14:42 AM
Hey Fox, any more progress? I'm really interested in this. :D
Title: Replay File/Memory documentation
Post by: gunner on May 30, 2006, 05:22:09 AM
nope, he doesnt mod gta anymore, so close this.
Title: Replay File/Memory documentation
Post by: JayFoxRox on June 08, 2006, 02:28:24 AM
This has been discussed on a german forum via pm.

We found sum more stuff. I will update the list when i know the whole format because i not want to give you wrong infos.

sry for that delay but i lost my gtas login data ^^

gunner: yeh - i said i m not making mp anymore (that much as before). i dunt lik other mods than mp. but i never said i will stop modding from one to another day. i will look around sumtimes and finish all my projects. so i m kinda back ;)
Title: Replay File/Memory documentation
Post by: JayFoxRox on July 05, 2006, 10:28:17 AM
Well i m sum kinda back and got some more information:

'.0 Type info - 8 bytes | Everytime GtaSA29{NULL}
'.8 Header - 52 bytes | Useless (?)
'.60 Matrix (XYZ) - 12 bytes | Useless (?)
'.72 xxx - 12 bytes | Useless (?)
'.84 Matrix (XYZ) - 12 bytes | Useless (?)
'.96 xxx - 24 bytes | Useless (?)
'.120 Matrix (XYZ) - 12 bytes | Useless (?)
'.132 xxx - 104 bytes | Useless (?)
'...
'.176 Matrix (???) - 12 bytes | Useless (?)

'.300 - 60 bytes | Zero

Thats been in my current Test replay. For now i m searching for the clothes states. Here are some:

0|00CDF163|TSHIRT|TSHIRT
0|CCA41CBB|VEST|VEST
1|47693314|PLAYER_FACE|HEAD
2|9C70F41F|BBSHORTWHT|BOXINGSHORT
2|8BCF9A28|JEANSDENIM|JEANS
3|BE526233|SNEAKERBINCBLK|SNEAKER
3|EDF74809|TIMBERFAWN|TIMBER

The naming is still wrong - Its texture change only when injecting at Gi3 (Head model? ô.O) -7 (Body) -3 (Head - cGi3) +1 (Trousers) +4 (Shoes)

w/e i cant figure out how the replay works - When deleting existing data the game will crash - when only writing zero to the useless stuff nothing changes (expect Camera warp which has to do sthin with one Matrix). When adding new zeros the game will crash anyways which messed up my idea of chunks

An important name seems to be 2222 (hexcode: 32 32  32 32) its found often (in steps of 344 bytes) which looks like an object pool to me.

The weather seems to be set by rockstar - its not random! I just need to have an look at the rep files which seem to link to an array rockstar set up in there gta_sa.exe ( - I still dno how dis is working anyways)

Also I noticed that the clothes states like Gi3 or Rb3 are found often to. The Replays got a fixed size of 98 kb - when having a longer one the header is left (expect clothes) and attached to the older ones. So 2 minutes replay (player only) is about big 782 kb ( ~ 8 * 98 )

When changing the header the game simply wont load ur file which is really tricky. w/e - The first 64 bytes seem to be the same everytime. I m sure its sum kind of internal setup.

Also i found out that 84 is used to store the original player stuff too (an F1 leftover? o.O). So when changing it to the current player pos (Must be 100%ly exactly) the replay mode wont be started! the screen is just frozen, Replay text is blinkin and u can c another Player running around doing the replay stuff close to you).


As i said i have stopped working on the tool used for changing replays - anyways i m programming an new tool which helps me to debug certain areas only, change time, weather, skin, bike/car colors adding spark, fire, ... when i know more.
Title: Replay File/Memory documentation
Post by: gunner on July 05, 2006, 12:07:32 PM
i still think you should post this at gtaforums.com
SimplePortal 2.3.7 © 2008-2025, SimplePortal