Quantcast

Jump to content

» «
Photo

Documenting GTA3/VC memory adresses

1,146 replies to this topic
JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#61

Posted 02 April 2004 - 11:23 AM

QUOTE (jax @ Apr 2 2004, 11:32)
Ahem biggrin.gif

May i request the memory addy for the local player's current position (most likely used with teleporters for trainers).

Also from what ive found, there are no set memory addy's for actors or cars, both are random data, and if im not mistaken, both mta and gtaT, reads the process memory and 'searches' for the address's of all the cars/actors, before they synchronise them.

more to follow on this!

-Jax

come on, why do you insist on making another multiplayer?
mta is far enough, and you haven't even took that minute of
time to see i posted teleporting techniques in one of first pages.

btw, teleporting technique will be realy bad to use for multiplayer,
how are you gonna sync it with collision detection?

jax
  • jax

    Moof!

  • Members
  • Joined: 20 Jan 2004

#62

Posted 02 April 2004 - 12:11 PM

no no no, not for teleporting, im after the memory addy, for the local players postion. the way it works, is the client reads the local players postion, then sends it to the server, which translates it into an actors postion, thus local player appears in certain area on the other screen. also further more i need the addy to be for VC 1.0

Thanks

-Jax

Stretchnutter
  • Stretchnutter

    Also known as Racer_S

  • Members
  • Joined: 15 Jun 2002

#63

Posted 02 April 2004 - 02:11 PM

Keywords: Pointer, DMA (Dynamic Memory Allocation)

Luke
  • Luke

    suckmyrocket

  • Inactive Staff
  • Joined: 01 Dec 2003
  • None

#64

Posted 12 April 2004 - 01:21 PM Edited by Smithers2, 12 April 2004 - 02:21 PM.

THESE ARE FOR GTA3


Game Random Stuff
------------------------
006FAD68 = Widescreen (Cutscene, not the options widescreen) (Integer 0/1, 1 byte)
0095CDA6 = Hour (Integer, 4 bytes)
0095CDC8 = Minute (Integer, 4 bytes)

Money (Integers, 4 bytes)
--------
0094139C = Money Value (Real Value, actual money you have)
009413A0 = Money Text (Set both and it wont increment slowly, set just the value and it will go slowly up like after missions)

Menu Screens (Integers, 1 byte)
----------------
008F5AE9 = Menu visible when its 1
0095CD7C= Menu visible when its 1

If you dont set them both, then the menu may hide itself, but the game will still be paused.

Strange Stuff (Integer, 1 byte)
----------------
006FAD57= When you enter or leave your car, it will take the camera to the hideout
006FAE9E= Camera at hideout.

Might not always be the hideout, i just found these while looking for something else.

I think some of these might be in the Admin Console Excel sheets, not sure, long time since i looked through them.

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#65

Posted 27 April 2004 - 09:40 AM Edited by ashdexx, 28 April 2004 - 06:32 AM.

Change the hardcoded values of Em vehicle models that chases you. i have to be that specific, because the parked ones that make up the roadblocks, WILL be UNaffected.

Fbi Rancher
0x4269ba - xx model number
if i tried this during a normal game, it simply crashes. however, if i change it to the id of a model i have loaded in my main.scm, it seems to work. Replacing a vehicle such as the rhino, will NOT give the replacement its special abilities. putting the patriot over the rhino model, as i did, will not make it immune to anything, nor will it have the ability to fire. these attributes are stored somewhere else.

Edit: - dammit, some of these were off, corrected now.
*Police1 - 0x426A21
Police2 - 0x426987
Enforcer - 0x42697e
**Vicechee1 - 0x4268b8
Vicechee2 - 0x4268d3
Vicechee3 - 0x4268ee
Vicechee4 - 0x426909
Police Helicopter - ???!
Fbi Rancher - 0x4269ba
Barracks Ol - 0x426a0a
Rhino - 0x426a14

Other Em vehicles, like the Ambulance and Firetruck are not listed, as i do not know the addresses.

Note: i only tested this on the enforcer, but i swapped the MrWhoopee (ice cream truck) model over it, and the ice cream music plays when it chases you tounge.gif

*The difference between 1 and 2; police 1 is the first copcar that chases, not too aggressive, usually gives up. Police2 is the real agreesive version that typically flies around a corner and tries to t-bone you. they can use different model id's i guess...

**I don't know why the game has 4 entries for the vicechee that chases you, but if you look in the default.ide, theres also 8 vicechee cops listed (97-104) @ 2 per car, it works out.

For example, normal game, i changed it to D3h (211d - check the default.ide for numbers) to load the deluxo, and it crashed.
i requested the model and loaded it via scm this time and changed the values, and now it works, the vehicle that CHASES me, is the deluxo. however for whatever reason, the roadblocks fbi ranchers remain unaffected.
its also important to note that the chasing deluxo had no lights, no siren and no driver (!!!). i could get in and drive it with no problems.
I tried putting a pcj over it, which kind of works, same issues as above, except if you try to drive it, the game crashes.


Screenshot: (my deluxo was replaced by one of yazu's aston martin's)
user posted image

more investigation continues. any help is appreciated...

Ransom1
  • Ransom1

    map makin opcodin noob

  • Members
  • Joined: 20 Feb 2004

#66

Posted 29 April 2004 - 12:45 AM

QUOTE (Delfi @ Nov 1 2003, 18:14)
QUOTE (ZanderZ @ Nov 1 2003, 17:37)
QUOTE (brokenfish @ Nov 1 2003, 14:59)
QUOTE (Opius @ Nov 1 2003, 07:44)
<span class='ME'>
<span class='ME'>Opius</span>    crosses fingers
</span>

<span class='ME'>
<span class='ME'>brokenfish</span> crosses fingers too
</span>
wow.gif wow.gif wow.gif wow.gif

<span class='ME'>
<span class='ME'>ZanderZ</span> hopes that too
</span>
although LithJoe's Ultimate Trainer is great too.

Delfi, have you contacted LithJoe? I think he programs in Delphi too and he might know more offsets and stuff.

he does, but his website is d.o.w.n..

ok, here is a nice litle something:

user posted image

*note here: the background loader is from spooky's path editor biggrin.gif
*another note: setup the keys before you run the game
*and another one: it is still unstable..
*and it loads / saves lithjoe's teleport tables
*place it to the gta-vc-exe dir, as it loads the images from img file and the default.ide..

baa:

http://www.infofeast...p/p_trainer.zip

I have vc1.1 and I can't get this teleporter thing to work sad.gif What I'm trying to do is press warp and then click back into the game and expect to be warped when I press resume game to return.

Does this thing work or what am I doing wrong? Doesn't include a readme in the download =/

Sounds awesome if it would work damnit

Stretchnutter
  • Stretchnutter

    Also known as Racer_S

  • Members
  • Joined: 15 Jun 2002

#67

Posted 29 April 2004 - 12:49 AM

Only works with 1.0 i think... i liked the car spawn option biggrin.gif

Stretchnutter
  • Stretchnutter

    Also known as Racer_S

  • Members
  • Joined: 15 Jun 2002

#68

Posted 01 May 2004 - 09:12 AM Edited by Stretchnutter, 29 May 2004 - 06:06 PM.

61EA5C (dword 4 bytes) - During replays this is the Time in Jiffy's (1/60th of a second) before mouse-look is turned off after idle.

This is contained in an actual ASM instruction so if writing to this position make sure your length is exactly 4 bytes no less, no more.

eg; 300 Jiffy's = 5 seconds... look it up

on a side note, if editing GTA-VC.exe in a hex editor, subtract hex 400000 (dec 4194304) from the memory offset to get the offset in the exe. (only applies to some games, not gta-vc.exe)

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#69

Posted 03 May 2004 - 11:26 AM

QUOTE (Ransom1 @ Apr 29 2004, 23:14)
Yep, you're right

This thing is sweet colgate.gif

But I can't figure out how to do a few things like car health, because I don't know how to specify when it needs a parameter. I tried just putting "1000" or "=1000" after the command but it didn't work. dozingoff.gif

use spaces to separate parameters.

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#70

Posted 06 May 2004 - 12:17 PM

Mooreee............*drools*
Is police chopper chasing you (# of stars you have doesnt matter)
byte - A10ADB, 0/1

car door open / close animation speed?
float - 69B34A

PANZER cheat vehicle ID - byte - 4AC14B (you can change this to a bike and spawn one. but dont bother, its glitchy, and when you try to get on the bike, CRASH!)

Anytime you shoot this vehicle, you will automatilly get a 1-star rating
byte - 5B9675 - Default is 156(D), Police car

Hardcoded special features of Vehicles, use default.ide numbers
Hunter Weapons - byte - 597F4A
Seasparrow Weapons - byte - 598302 (you can only put heli weapons, on other helis!)

Cuban Exhaust - byte - 58BCA8
Tank Cannon- byte - 5945F1
Firetruck Waterhose - byte - 5945D5
Voodoo hydraulics - byte - 594611

Stuff in blue and yellow, doesnt work on bikes.

the way these are coded, you can only have one..."special attribute", per vehicle. for example, if i try to give the firetruck BOTH the waterhose and tank cannon, it will only use one. not everything works on every car. if you want to change the hunter weapons and seapsparrow weapons around, you would have to change both IDs around. the maverick is fun with hunter weapons, easier to control...
if you give your vehicle the tank cannon, it also gets the BP tires, and the ability to kill other cars by ramming them. However, it does NOT get the improved armor, so ramming another car in tank mode, does enough damage to start your OWN car on fire! be warned!

I even used a trainer maker kit (TMK 1.51) to bust out this little app to do the work for me...
http://gregval.phpwe...ads/trainem.gif
the police stuff on the left, as mentioned in my last post, previous page, still requires a separate main.scm with the models you want to change them to, loaded and requested through there. the exe has to have its own model loading routine for this (as none of the default chase vehicles are in the main.scm), but i cant find it turn.gif

more as i find it..

=MATT=
  • =MATT=

    Player Hater

  • Members
  • Joined: 11 Apr 2004

#71

Posted 10 May 2004 - 05:06 AM

hey, nice list of addressed here
i have made a trainer program in VB, yes Delfi, VB and i was wondering how you get the position of the player. I read the first post on this topic but i dont exactally get what it ment by:
QUOTE
teleporter - same for as ped and as any other vehicle:
8276416 > pointer = 72083480, + 52 bytes = 72083532 where is x, y, z of the object as 4 byte float values
72083532 > float x next is y and then z

ok so there is the address "8276416" which is a pointer to "72083480" then if you add 52 bytes to it you get "72083532" where the x pos of the objest is then in "72083533" is the y pos of the object and in "72083534" is the z pos??
an i getting this rite?
and before jax said that all peds and cars were randomly stored in VC's memory so how can you give exact addresses?, or are these the addresses for the players x, y, z?
blink.gif

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#72

Posted 10 May 2004 - 11:10 AM

QUOTE (=MATT= @ May 10 2004, 06:06)
hey, nice list of addressed here
i have made a trainer program in VB, yes Delfi, VB and i was wondering how you get the position of the player. I read the first post on this topic but i dont exactally get what it ment by:
QUOTE
teleporter - same for as ped and as any other vehicle:
8276416 > pointer = 72083480, + 52 bytes = 72083532 where is x, y, z of the object as 4 byte float values
72083532 > float x next is y and then z

ok so there is the address "8276416" which is a pointer to "72083480" then if you add 52 bytes to it you get "72083532" where the x pos of the objest is then in "72083533" is the y pos of the object and in "72083534" is the z pos??
an i getting this rite?
and before jax said that all peds and cars were randomly stored in VC's memory so how can you give exact addresses?, or are these the addresses for the players x, y, z?
blink.gif

"where is x, y, z of the object as 4 byte float values"

just read a DWORD at the "pointer" and add 52 bytes (decimal) to the value you read there, then read a 4-BYTE IEEE SINGLE FLOATING POINT VALUE at that position, that
value you read here is the X, y and z follow after x, add 4 bytes more for y and 8 bytes for z.

i don't know where you can get positions for random
peds and cars, but if someone founds out i could find this very useful!

jax
  • jax

    Moof!

  • Members
  • Joined: 20 Jan 2004

#73

Posted 10 May 2004 - 01:42 PM

Yes all peds are DMA, although i believe if you were to create them with ?? (global vars) which directly links them to a static memory address (sort of).

EG:

CODE

SCM ?? MEM ADDY
1000?? 821668
1004?? 82166C
1008?? 821670


I've never tried to do anything with this, just something i found along my path. However, an idea sprung to mind with ur pointer for the x,y,z perhaps if you 'point' your 'pointer' at one of those addys (after creating an actor using the required number that is).

err in scm create an actor using 1000?? and then use the 'pointer' to 'point' at 821668 is what im saying.

I have no idea if this would work or not, just a thought colgate.gif

-Jax

Sobeit
  • Sobeit

    mta ninja

  • BUSTED!
  • Joined: 11 May 2004

#74

Posted 12 May 2004 - 02:57 AM

sorry for the extra trouble i am givin u guys for posting this reply so late, but for

QUOTE
Mooreee............*drools*
Is police chopper chasing you (# of stars you have doesnt matter)
byte - A10ADB, 0/1

car door open / close animation speed?
float - 69B34A

PANZER cheat vehicle ID - byte - 4AC14B (you can change this to a bike and spawn one. but dont bother, its glitchy, and when you try to get on the bike, CRASH!)

Anytime you shoot this vehicle, you will automatilly get a 1-star rating
byte - 5B9675 - Default is 156(D), Police car

Hardcoded special features of Vehicles, use default.ide numbers
Hunter Weapons - byte - 597F4A
Seasparrow Weapons - byte - 598302 (you can only put heli weapons, on other helis!)
Cuban Exhaust - byte - 58BCA8
Tank Cannon- byte - 5945F1
Firetruck Waterhose - byte - 5945D5
Voodoo hydraulics - byte - 594611


this is obviously not a freeze/unfreeze thing, but, i tried to add values with a hotkey but, to no avail, help?

*EDIT*:i was talking about the adding voodoo hydrolics mostly, but for the weapons, ect, that would be cool as well cool.gif

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#75

Posted 16 May 2004 - 02:30 AM

Here's some addresses i got this afternoon.

All are float as far as i can tell
Friction between car wheels, and ground: - 69a61a (0 = no friction, or traction. cars cant drive properly!)
Flip the driver side wheels of a car horizontally - 69a5ec (user of the dmagic wheelmod should recognize this effect, make it all 0)
Width of front wheel - this only affects vehicles that have the "skinny front wheel" flag, checked off in the handling.cfg, like the boxville and Linerunner - 69a62b
Size of the corona on the police car EM lights - 69a633
Area that the police car EM lights actually effect - 69a65c

there's more, but they need further testing.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#76

Posted 17 May 2004 - 10:59 AM

QUOTE (ashdexx @ May 16 2004, 03:30)
Why dont all of you stop? Delfi your a moderator! its your job to delete spam like this, not add to it.

ANYWAY, ontopic, here's some addresses i got this afternoon.

All are float as far as i can tell
Friction between car wheels, and ground: - 69a61a (0 = no friction, or traction. cars cant drive properly!)
Flip the driver side wheels of a car horizontally - 69a5ec (user of the dmagic wheelmod should recognize this effect, make it all 0)
Width of front wheel - this only affects vehicles that have the "skinny front wheel" flag, checked off in the handling.cfg, like the boxville and Linerunner - 69a62b
Size of the corona on the police car EM lights - 69a633
Area that the police car EM lights actually effect - 69a65c

there's more, but they need further testing.

the spam: the spelling DOES matter to me a lot, sorry but it just throws me off.

i disassembled the gta-vc exe with win32dasm and parsed the asm text to
extract out any adress access to object data - variables, etc.. so i will now
make a addon for my memory editor to show me these positions of
variables so i can easily break the memory blocks into records and have a
better overview on the data and extract some stuff and post here something useful.

ashdexx, there is also a "wider rear wheel" effect, got that one?


DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#77

Posted 17 May 2004 - 05:05 PM

QUOTE
ashdexx, there is also a "wider rear wheel" effect, got that one?

Not YET, but that did occur to me when i was poking about, and i dont know why it would be anywhere else, there's a ton of wheel stuff in that area, so im gonna have another look.

ModelingMan
  • ModelingMan

    Crackalacking!

  • Feroci Racing
  • Joined: 23 Jan 2004

#78

Posted 17 May 2004 - 06:35 PM Edited by ModelingMan, 17 May 2004 - 09:35 PM.

I haven't really read this topic until ashdexx pointed it out. I started mem hacking with N64 ROMs with the use of TSearch. Looking at all the things that you all have found/hacked makes me want to start hacking Vice City myself, which I am going to do now.

.:EDIT:.
I got the address for the current car in the vercetti mansion garage:

8223480 > The value is the Car number in the Default.IDE. I'm still trying to figure out the car colors address.

.:EDIT2:.
Another addition to garage editing, this is for the El Casa something mansion:

8221880 > Again the Default.IDE number.

I still can't figure out the car colors address.

Cray
  • Cray

    MTA Developer

  • Members
  • Joined: 01 Jul 2002

#79

Posted 18 May 2004 - 06:49 PM

QUOTE (ModelingMan @ May 17 2004, 18:35)
I still can't figure out the car colors address.

Try +416 (color 1, primary) and +417 (color 2, secondary) on the vehicle object.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#80

Posted 18 May 2004 - 07:28 PM

just to announce for anyone that remembers "P_trainer" - gta-vc admin console,
the thing moved far, it now works with a system-wide keyboard hook (i don't intend to scare you tounge.gif )
so it captures key presses even if in the background and it does it real-time
so no more sticky keys or stuff.. but because of this larger parts for console
writing input.. there will be also a parameter hint and autocomplete function biggrin.gif

stay tuned and post things you would like to see implemented in the console.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#81

Posted 20 May 2004 - 07:32 PM

QUOTE (ashdexx @ May 19 2004, 05:23)
id like it to change the values for what ID numbers are assigned to police cars. but this might not be practical unless you also find the internal model loader, as so far you can only change them to a vehicle loaded externally by the main.scm.
so maybe not...

i intend to build another asi-like plugin for gtavc to enable calling
internal code in gta-vc via the plugin, this way we could spawn cars anywhere..

some progress on my offsets:

this image is here just for fun..
user posted image

i messed with pcj a bit.. and came up with this result, that
rotates pcj with swaped heading instead leaning:

user posted image


to show what i mean again: this bike doesn't lean but instead it rotates its heading
like this, see the displaced lights:
user posted image

and i found out some very vierd ways to hold on the bike biggrin.gif

user posted image

this is f*cking cool!!
(also notice the delphi 4 boxes on the floor tounge.gif )
user posted image

i have no idea how this happened, i just messed with the data,
here is 3000 bytes data dump for this bike (i don't know how many bytes vehicle blocks "cost")

http://www.infofeast...he_vierd_pcj.cb

by editing and importing this file you should get this to import over another pcj and see the effect.. maybe..

ok, decimal-offsets now:

car block pointer +
112:
if non-zero then the car is moving



1476:
if this is zero then the vehicle flies
otherwise it is some sort of suspension
pressure, watch it when car falls to
ground and tires are pushed upwards

note:
unsigned single-byte value !! ??
doesn't seem to work on bikes..


general memory:

4899147 = panzer cheat car Id
you can spawn normal cars with this, car doesn't get any tank abilities..


here is new version of P_Trainer:
http://www.infofeast...p/p_trainer.zip

some changes:
use the '~' key to access console now!

an example list of commands file is included

the syskeyhook dll hooks up system keyboard access
and sends the keys to the trainer app real-time,
many trainers use same methods, it is harmless and the best way.

to operate console:
use the '~' key and type commands, if all goes ok you will see the
effect otherwise you will be notified about errors.

the console is quite safe, it checks for valid player-model changing
and valid ide car numbers, but it doesn't detect bikes yet, so commands
like the one that "patches and reinflates" all car tires crash when used on a bike.

to test the thing:
put the files into gta-vc.exe dir and run the exe and load jernej.gcl file (my real
name is Jernej if you realy need to ask about the file-name)

then go to the gta-game and test keys 1-0 and Q, don't use the W key because
it is mapped to unsafe command!!!!!!!!!111!!!!!!!!!!!!!!!!!!!!1111!!!!!!!!!

some stuff is in the app for no reason or for debugging things (like buttons that are visible when you are in a car and some test bike-detection, leave that stuff)

have a productive hacking session (or something..)

Cray
  • Cray

    MTA Developer

  • Members
  • Joined: 01 Jul 2002

#82

Posted 20 May 2004 - 09:38 PM

QUOTE (Delfi @ May 20 2004, 19:32)
(i don't know how many bytes vehicle blocks "cost")

VC vehicle block is 1500 bytes, actor block is umm ... if my memory holds me correct, around 1752

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#83

Posted 21 May 2004 - 12:37 AM

Ive also been poking about more, to get effects like this..
user posted image
that looks kinda cool.

offests:
width of rear wheel with Wide_rear_wheel flag (told you id find it!)
either 69a794, or 69a194, my handwirting got sloppy.
Yellow headlights: 69a756, make it zero. only affects cars that have the blue-halogen lights, headlight flag in the handling.cfg
Headlight texture clipping? 69a6c8

Has anyone ever found the RGB's for the text used ingame? i would love to change the hud color.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#84

Posted 21 May 2004 - 10:03 AM

QUOTE (Cray @ May 20 2004, 22:38)
QUOTE (Delfi @ May 20 2004, 19:32)
(i don't know how many bytes vehicle blocks "cost")

VC vehicle block is 1500 bytes, actor block is umm ... if my memory holds me correct, around 1752

does the vehicle block size apply to helicopters, bikes and boats too?

edit: renamed the topic title to:
Documenting GTA-VC memory adresses -
hard coded gets uncovered here

ghost of delete key
  • ghost of delete key

    ಠ_ಠ ... otter ...

  • The Connection
  • Joined: 27 Dec 2003

#85

Posted 21 May 2004 - 03:40 PM

QUOTE (ashdexx @ May 21 2004, 03:35)
Well i dont think the menu has its own color per se. As far as i can tell, it looks like all the colors would have to be defined somewhere, and then each aspect of the game, is assigned to use one of the pre-defined colors, ie the hud armor and health, the menu system, and especially in the gxt files, except there you can control it.

The HUD RGB and the positions of the text sprites are constants defined in the .exe confused.gif
This shaves a few points off the performance curve-
Unlike particle effects, which are in motion, the HUD is stationary throughout the game, so the positions of these 2D sprites do not need to be continuously re-calculated from "external" data. The values are therefore stored as constants in the .exe .
The same is true for the textures- No need for changing colors, so the color values can be made constants, stored in the .exe, and the textures in the .txd can be made monocrome, allowing the lowest possible bit-depth.
All-around, a very efficient way to manage graphic resources, even if it does hinder modification.

I've seen references to it in the .exe, but I can't post details now, as all my crappy freeware disassemblers are currently uninstalled...

If anyone wants to buy me IDApro (or anything else for that matter), feel free tounge2.gif

So if anybody wants to exercise their DISASM, try searching for the font texture names- you won't hit the data, but that should get you into the prog flow to track where the values are stored.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#86

Posted 21 May 2004 - 07:24 PM

QUOTE (ghost of delete key @ May 21 2004, 16:40)
QUOTE (ashdexx @ May 21 2004, 03:35)
Well i dont think the menu has its own color per se. As far as i can tell, it looks like all the colors would have to be defined somewhere, and then each aspect of the game, is assigned to use one of the pre-defined colors, ie the hud armor and health, the menu system, and especially in the gxt files, except there you can control it.

The HUD RGB and the positions of the text sprites are constants defined in the .exe confused.gif
This shaves a few points off the performance curve-
Unlike particle effects, which are in motion, the HUD is stationary throughout the game, so the positions of these 2D sprites do not need to be continuously re-calculated from "external" data. The values are therefore stored as constants in the .exe .
The same is true for the textures- No need for changing colors, so the color values can be made constants, stored in the .exe, and the textures in the .txd can be made monocrome, allowing the lowest possible bit-depth.
All-around, a very efficient way to manage graphic resources, even if it does hinder modification.

I've seen references to it in the .exe, but I can't post details now, as all my crappy freeware disassemblers are currently uninstalled...

If anyone wants to buy me IDApro (or anything else for that matter), feel free tounge2.gif

So if anybody wants to exercise their DISASM, try searching for the font texture names- you won't hit the data, but that should get you into the prog flow to track where the values are stored.

as far as i know, there is NO need to copy font glyphs
to new data, because in opengl you would just apply the color
to draw font in and push the geometry.. well i think in diFectx
the things go same.. and they probably use same for car coloring..

the offsets like color aren't usualy visible in disassemblers
(they don't have labels like "this is font color for cage font..")

use Tsearch, artmoney or other memory hacking program to
find em, knowledge of how directx coloring works would be useful..

ghost of delete key
  • ghost of delete key

    ಠ_ಠ ... otter ...

  • The Connection
  • Joined: 27 Dec 2003

#87

Posted 22 May 2004 - 12:17 AM

QUOTE
the offsets like color aren't usualy visible in disassemblers
(they don't have labels like "this is font color for cage font..")


Actually, the .exe is rife with just those labels. Anything in the game that is referenced from the .exe has the name of what it needs attached to it. We all know how the game finds the data it needs through the TXDname/texture name (or DFFname/atomic name); most everything in the game that is a static environmental component, such as the HUD, menus, certain sounds, etc., has these labels stored in the .exe, and these resource name strings are scattered throughout the file.
All in all, a quick way for the less-savvy to hook into the logic flow, if they have the tenacity to track it tounge2.gif

QUOTE
as far as i know, there is NO need to copy font glyphs
to new data, because in opengl you would just apply the color
to draw font in and push the geometry.. well i think in diFectx
the things go same.. and they probably use same for car coloring...


Erm, there is no geometry to push. It's a 2D sprite. It's simply painted to the screen, and runs seperately of the 3D rendering cycle.
Sprites work just like UV mapping does, but in a seperate rendering space. A texture, when applied to a geometry (in GameSpace or WorldSpace), is mapped to the surface of the polygon along its 2D aspect and rendered as a component of a 3D world (represented as a 2D viewplane)
A texture, when applied to a sprite (in DeviceSpace), UV mapped to an XY position on the view plane, which itself is analogous to a polygon (but isn't really one!).
So really there is no "font glyph" other than a particular segment of the font texture as seen in the .txd .
But you are exactly right about not needing to write new data, hence the method they used to display the HUD. RW allows the option of setting the RGB values of texture applied to a sprite, or letting the texture define the colors, as in particle effects like gunshots and explosions.
They've done everything else to eliminate the need to open up a seperate binary stream and import values for a one-shot calculation; I'm surprised that the font textures weren't embedded in the .exe as .bmp resources! Nvrmnd, everytime a number in the HUD changes, the tex would be recalculated (but pos. & RGB remain constant).

BTW, RW can also write directly to the screen, but this uses fonts from your system instead of textures from a resource directory. This is rendered in DeviceSpace also.

steve-m
  • steve-m

  • Feroci Racing
  • Joined: 26 Jul 2002

#88

Posted 22 May 2004 - 05:49 PM

The function LoadingScreen, which draws and updates the loading screen, is at 0x4A69D0. It gets 3 parameters, two of them being strings for use as on-screen status messages during the loading process. This has been disabled by R*^, anyone an idea how to enable it again or how to manipulate the progress bar? (more details here)

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#89

Posted 22 May 2004 - 09:02 PM

QUOTE (ghost of delete key @ May 22 2004, 01:17)
QUOTE
the offsets like color aren't usualy visible in disassemblers
(they don't have labels like "this is font color for cage font..")


Actually, the .exe is rife with just those labels. Anything in the game that is referenced from the .exe has the name of what it needs attached to it. We all know how the game finds the data it needs through the TXDname/texture name (or DFFname/atomic name); most everything in the game that is a static environmental component, such as the HUD, menus, certain sounds, etc., has these labels stored in the .exe, and these resource name strings are scattered throughout the file.
All in all, a quick way for the less-savvy to hook into the logic flow, if they have the tenacity to track it tounge2.gif

QUOTE
as far as i know, there is NO need to copy font glyphs
to new data, because in opengl you would just apply the color
to draw font in and push the geometry.. well i think in diFectx
the things go same.. and they probably use same for car coloring...


Erm, there is no geometry to push. It's a 2D sprite. It's simply painted to the screen, and runs seperately of the 3D rendering cycle.
Sprites work just like UV mapping does, but in a seperate rendering space. A texture, when applied to a geometry (in GameSpace or WorldSpace), is mapped to the surface of the polygon along its 2D aspect and rendered as a component of a 3D world (represented as a 2D viewplane)
A texture, when applied to a sprite (in DeviceSpace), UV mapped to an XY position on the view plane, which itself is analogous to a polygon (but isn't really one!).
So really there is no "font glyph" other than a particular segment of the font texture as seen in the .txd .
But you are exactly right about not needing to write new data, hence the method they used to display the HUD. RW allows the option of setting the RGB values of texture applied to a sprite, or letting the texture define the colors, as in particle effects like gunshots and explosions.
They've done everything else to eliminate the need to open up a seperate binary stream and import values for a one-shot calculation; I'm surprised that the font textures weren't embedded in the .exe as .bmp resources! Nvrmnd, everytime a number in the HUD changes, the tex would be recalculated (but pos. & RGB remain constant).

BTW, RW can also write directly to the screen, but this uses fonts from your system instead of textures from a resource directory. This is rendered in DeviceSpace also.

Actualy even for each font glyph you do NEED geometry (except if you are in
directdraw but vicecity isn't)
you need 2 triangles for Each glyph, run gta-vc in wireframe mode (use 3d analyse tool)
and you will see what i mean perfectly.

JernejL
  • JernejL

    Big Homie

  • Feroci Racing
  • Joined: 11 Mar 2002

#90

Posted 22 May 2004 - 09:49 PM

GTA-VC Developer Console:
http://www.gtaforums...=0#entry1679733




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users