|
 |
|
|
|
|
|
GTA Modification Forums
Documenting GTA3/VC memory adresses Vice *and* GTA3
 |
|
 |
| |
Swoorup  |
Posted: Thursday, Mar 8 2012, 15:58
|
innovator

Group: Members
Joined: Oct 28, 2008


|
| CODE | struct CPed { 0x338 CPathNode* CurrentWanderingNode; 0x33C CPathNode** NextWanderingNode; };
|
There might not be easy way to increase the paths. The path's coordinates from ipl file is truncated and is multiplied by 8 (after multiplying it by 1/16) and stored in a signed 2 bytes space in PathNode struct. Now the signed values have limits ranging from -32767 to 32767. So the limits for path coords would be -4095 to +4095 after division by 8. The 16 bit limit is same for GTA SA and the values are stored after multiplying by 8 | QUOTE | GTA Vice City From (-2300,-1900,-INF.) to (1540,1900,INF.) approximately, standard units. Total area: 14.6 square kilometers. GTA San Andreas From (-3000,-3000,-INF.) to (3000,3000,INF.) standard units. Total area: 36.0 square kilometers |
The 16x multiplier hack may be able to increase the original limits but it would increase not above that number. The solution to this may be redirecting every function that accesses this struct. But that would of course take a very long time. | CODE | struct CPathNode //size 0x14 { _uint16 unk1; Always 0xFFFF _uint16 unk2; Current Index? _int16 x; Divided by 8 _int16 y; _int16 z; _int8 unk3; _int8 unk4; _int16 nextPointIndex; _int8 unk5; _int8 unk6 _int8 flags; _int8 unk7 _int8 unk8 _int8 unk9; } |
As for the nodes not connecting properly after 16x multiplier hack, It might have to do something with the closest Node search radius. This function CPathFind::FindNodeClosestToCoors returns -1 if the node is not found. If it finds it would return a pointer to a pathnode struct. This might be occuring with the vehicle paths only since the peds path are close to each other in every nodes (Or most of the nodes I should say). Vehicles node tends to break up in a straight highway since the nodes are placed very far to each other. Also there might be an angle problem while taking a turn. I have not seen this issue with peds path though. I have fairly decompiled that function. | CODE | signed int __userpurge CPathFind__FindNodeClosestToCoors<eax>(GlobalMap *global<ecx>, signed int curObjecttypetIndex<ebx>, signed int LastObjecttypeIndex<edi>, float x, float y, float z, char type, float searchRadius, char skipForbidden, char flag2, char flag3, char flag4) { signed int v12; // esi@1 double v2; // st5@1 double VfY; // st7@1 signed int _curObjecttypetIndex; // ebp@4 CPathNode *curRouteNode; // edx@5 int curRouteNodeOffset; // ebx@5 double curRouteNodeY; // st3@13 float curRouteNodeX; // ST0C_4@16 double v3; // st2@14 double v21; // st2@16 double xOffset; // st3@16 double yOffset; // st4@16 double curRouteNodeZOffset; // st6@18 double zOffset; // st2@19 double v26; // st6@21 signed int result; // eax@25
v12 = 0; VfY = y; v2 = f10000; switch ( type ) { case 0: // For vehicles curObjecttypetIndex = 0; LastObjecttypeIndex = global->lastVehicleRoutePointIndex; break; case 1: // For Peds LastObjecttypeIndex = global->lastPedRoutePointIndex; curObjecttypetIndex = global->lastVehicleRoutePointIndex; break; default: break; } _curObjecttypetIndex = curObjecttypetIndex; if ( curObjecttypetIndex < LastObjecttypeIndex ) { curRouteNodeOffset = 20 * curObjecttypetIndex;// Since size of CPathNode is 0x14 = 20 curRouteNode = (global->paths + curRouteNodeOffset); do { if ( !skipForbidden || !((curRouteNode->flags >> 5) & 1) ) { if ( !flag2 || !((curRouteNode->flags >> 6) & 1) ) { if ( !flag3 || !((curRouteNode->field_11 >> 2) & 1) ) { if ( flag4 == (curRouteNode->field_11 & 1) ) { curRouteNodeY = *(&global->paths[0]._y + curRouteNodeOffset) * f8Divider; if ( curRouteNodeY - VfY < f0 ) v3 = curRouteNodeY - VfY; else v3 = -(curRouteNodeY - VfY); yOffset = v3; curRouteNodeX = *(&global->paths[0]._x + curRouteNodeOffset) * f8Divider; v21 = curRouteNodeX - x; xOffset = v21; if ( v21 >= f0 ) xOffset = -v21; curRouteNodeZOffset = *(&global->paths[0]._z + curRouteNodeOffset) * f8Divider - z; if ( curRouteNodeZOffset < f0 ) zOffset = curRouteNodeZOffset; else zOffset = -curRouteNodeZOffset; v26 = xOffset + yOffset + f3 * zOffset; if ( v26 >= v2 ) { v2 = v26; v12 = _curObjecttypetIndex; } } } } } ++_curObjecttypetIndex; ++curRouteNode; curRouteNodeOffset += 20; } while ( _curObjecttypetIndex < LastObjecttypeIndex ); } if ( v2 < searchRadius ) result = -1; else result = v12; return result; } |
Anyone could give a suggestion to do those hacks? This post has been edited by Swoorup on Friday, Mar 9 2012, 04:49
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Swoorup  |
Posted: Saturday, Apr 7 2012, 16:45
|
innovator

Group: Members
Joined: Oct 28, 2008


|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
DK22Pac  |
Posted: Saturday, May 5 2012, 21:45
|
Assembly!

Group: Members
Joined: Apr 12, 2009


|
GTA3 1.0 | CODE | 0x5197A0 CBrightLights::CleanNumOfBrightLights() 0x5197B0 CBrightLights::Render() 0x51A3B0 CBrightLights::RenderOne() 0x51A410 CBrightLights::RegisterOne(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, char red, char green, char blue, char alpha)
0x8F2C70 NumBrightLights 0x733A68 aBrightLights CBrightLight[32]
CBrightLight struc; (sizeof=0x38) 0x00 pointAA RwV3D 0x0C pointAB RwV3D 0x18 pointBA RwV3D 0x24 pointBB RwV3D 0x30 distanceToCamera dd 0x34 color RwRGBA |
Vice 1.0 | CODE | 0x5719B0 CBrightLights::Render() 0x571820 CBrightLights::RegisterOne(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, char red, char green, char blue, char alpha)
0x97F2BC NumBrightLights 0x818848 aBrightLights CBrightLight[32]
The struct is same. | This post has been edited by DK22Pac on Sunday, May 6 2012, 09:03
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
DK22Pac  |
|
Assembly!

Group: Members
Joined: Apr 12, 2009


|
Yeah. In SA, also, some material settings are changed (as I remember, "material diffuse" value). This bright light is really weird thing for me. After I removed them, vehicles look better at night. I thought about making new headlight coronas for GTAIII, since I dont like that light line. Also, about pointligths, in SA, for vehicle lights they are really "direct lights". And it's a cool thing. But it affects only dynamic stuff, like peds and vehicles... And about "surface lighting", like you called it, it creates 3d prim based on nearest entities' vertices. For SA, I documented CShadows struct here. Just one bad thing - these shadows could be created only on the ground, only ped shadows are drawed on the walls.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
MW_29  |
Posted: Saturday, Jun 9 2012, 11:40
|
i came to play

Group: Members
Joined: Jan 19, 2008


|
| QUOTE (NewportByChrysler @ Friday, Jun 8 2012, 22:44) | | So, through memory editing, would it be possible to re-enable headlight coronas in GTAIII? | Well, as guys previously posted here, i assume it could be done. Maybe then it 'd be worth releasing this as official mod, not only pieces of code in this topic, i mean  Anyways, keep up
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(56) « First ... 52 53 [54] 55 56
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|