IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

This section is for any editing topics that don't fit into any of the other forums, any questions on how to mod belong in Editing Discussion

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (57) « First ... 55 56 [57]   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Documenting GTA3/VC memory adresses

 Vice *and* GTA3
 
Swoorup  
Posted: Monday, Jun 10 2013, 10:58
Quote Post


innovator
Group Icon
Group: Members
Joined: Oct 28, 2008

au.gif

XXXXX



Hacking Vice City game boundaries.

game stores entities inside a grid of sectors
each sector consist of all entities inside of one 50 sq unit game area

there are originally 80 * 80 grid sector for vice city,
that means game can store 4000 sq units wide encompassable entities

simply changing the indexer to 500, we can have 40,000 sq units wide game boundaries

CODE

#include <windows.h>
#include <stdio.h>

#define ARRLEN(a) (sizeof(a)/sizeof(a[0]))

#define BOUNDMULT 10.0f

// all elements are stored in sector grid and 1 sector consist of all entities inside 50 sq units game area
// 80 * 80 sectors are in the game
DWORD dwBoundMultiplierInstRef[] = {
0x40cc9d,0x40ccd1,0x40e526,0x40e565,0x40e5a4,
0x40e5e4,0x40ea5e,0x40ea89,0x40eaba,0x40eaff,
0x40eb40,0x40eb82,0x40f141,0x40f19b,0x40f20f,
0x40f243,0x40f5ef,0x40f623,0x423c97,0x423cd8,
0x423d19,0x423d5b,0x42563c,0x42567d,0x4256be,
0x425700,0x4258fe,0x42593f,0x425980,0x4259c2,
0x42e575,0x42e5b4,0x42e5f3,0x42e631,0x47fb72,
0x47fba5,0x47fbdb,0x47fc0e,0x487555,0x487580,
0x4875b3,0x4875f8,0x487633,0x48765e,0x487d55,
0x487d80,0x487db3,0x487df8,0x487e33,0x487e5e,
0x487ff5,0x488020,0x488053,0x488098,0x4880d3,
0x4880fe,0x4baf0b,0x4baf36,0x4baf69,0x4bafae,
0x4bafe9,0x4bb014,0x4bb335,0x4bb360,0x4bb393,
0x4bb3d8,0x4bb413,0x4bb43e,0x4bd9fb,0x4bda3c,
0x4bda7d,0x4bdabf,0x4c7088,0x4c70a6,0x4c70c8,
0x4c70e2,0x4c70fc,0x4c7116,0x4c730c,0x4c734d,
0x4c738f,0x4c73d0,0x4c8a69,0x4c8a87,0x4c8aa9,
0x4c8ac3,0x4c8add,0x4c8af7,0x4c8b13,0x4c8b2d,
0x4c8b44,0x4c8b5b,0x4c8b72,0x4c8b96,0x4c8bad,
0x4c8bc4,0x4c8bdb,0x4c8bf2,0x4c8c09,0x4c8e38,
0x4c8e6f,0x4c8eb1,0x4c8ef0,0x4d28fa,0x4d2952,
0x4d2a70,0x4d2ac4,0x4d2c4d,0x4d2ca5,0x4d3245,
0x4d3286,0x4d32c7,0x4d3302,0x4d3f59,0x4d3fa0,
0x4d3fe5,0x4d4029,0x4d5227,0x4d5282,0x4d53f7,
0x4d5452,0x4d558c,0x4d55e2,0x4d580f,0x4d5857,
0x4d5896,0x4d58d7,0x4d5ba1,0x4d5bea,0x4d5c2b,
0x4d5c6d,0x4d5fbf,0x4d6007,0x4d6046,0x4d6087,
0x4d6393,0x4d63d9,0x4d641c,0x4d6460,0x4d6793,
0x4d67d9,0x4d681c,0x4d6860,0x4d6bb3,0x4d6bf9,
0x4d6c3c,0x4d6c80,0x4d82ef,0x4d8339,0x4d837c,
0x4d83c0,0x4d8b38,0x4d8b93,0x4d9434,0x4d948e,
0x4d94de,0x4d9530,0x4d9973,0x4d999e,0x4d99d1,
0x4d9a04,0x4d9a56,0x4d9c17,0x4d9f2e,0x4d9f59,
0x4d9f8c,0x4d9fbf,0x4da011,0x4da1d7,0x4da5a2,
0x4da5de,0x4da618,0x4da65b,0x4daa02,0x4dab90,
0x4dae60,0x4daff4,0x4e9af4,0x4e9b40,0x4e9b85,
0x4e9bcb,0x4e9fd4,0x4ea020,0x4ea065,0x4ea0ab,
0x4f35c3,0x4f360f,0x4f3654,0x4f369a,0x50d527,
0x50d562,0x50d59f,0x50d5eb,0x51d215,0x51d266,
0x51d2b1,0x51d2fd,0x53cfb4,0x53cffa,0x53d03b,
0x53d07d,0x552f2d,0x552f6c,0x552fab,0x552fe4,
0x56c427,0x56c468,0x56c4a9,0x56c4eb,0x56cf8a,
0x56cfcb,0x56d00c,0x56d04e,0x587747,0x587786,
0x5877c5,0x587803,0x587b87,0x587bc6,0x587c05,
0x587c43,0x5a88db,0x5a890f,0x5a8943,0x5a8977,
0x5b51a0,0x5b51ea,0x5b5232,0x5b5279,0x5bc71e,
0x5bc749};

DWORD dwCZonesBounds[] = {
0x4DE312,0x4DE31C,0x4DE32E,0x4DE338,
0x4DE364,0x4DE36E,0x4DE388,0x4DE392,
0x4DE46D,0x4DE477,0x4DE489,0x4DE493};

void updateGameBounds(void)
{
DWORD dwVp;
VirtualProtect((void*)0x401000, 0x27CE00, PAGE_EXECUTE_READWRITE, &dwVp);
static float fBoundMultiplier = 0.0020000001f;

for(int i = 0; i < ARRLEN(dwBoundMultiplierInstRef); i++)
 *(dwBoundMultiplierInstRef[i]) = (DWORD)&fBoundMultiplier;

for(int i = 0; i < ARRLEN(dwCZonesBounds); i++)
 *((float*)dwCZonesBounds[i]) *= BOUNDMULT;

*(float*)0x69136C = 50.0f * BOUNDMULT;

// world borders
*(float*)0x69135c *= BOUNDMULT;
*(float*)0x691360 *= BOUNDMULT;
*(float*)0x691364 *= BOUNDMULT;
*(float*)0x691368 *= BOUNDMULT;

//corona boarders
*(float*)0x69592c *= BOUNDMULT;
*(float*)0x695930 *= BOUNDMULT;
*(float*)0x695934 *= BOUNDMULT;
*(float*)0x695938 *= BOUNDMULT;

//car borders
*(float*)0x69a890 = 15950.0f;
*(float*)0x69a894 = -23950.0f;
*(float*)0x69a898 = 19950.0f;
*(float*)0x69a8a0 = -19950.0f;

// boat borders ??
*(float*)0x69afec = 15900.0f;
*(float*)0x69aff0 = -23900.0f;
*(float*)0x69aff4 = 19900.0f;
*(float*)0x69aff8 = -19900.0f;

// police chopper borders ??
*(float*)0x69c064 *= BOUNDMULT;
*(float*)0x69c068 *= BOUNDMULT;
*(float*)0x69c06c *= BOUNDMULT;
*(float*)0x69c070 *= BOUNDMULT;

// bullet boundaries ??
*(float*)0x69cf4c *= BOUNDMULT;
*(float*)0x69cf50 *= BOUNDMULT;
*(float*)0x69cf54 *= BOUNDMULT;
*(float*)0x69cf58 *= BOUNDMULT;

// projectile borders, simply destroy the projectiles
*(float*)0x69d1ac = -23990.0f;
*(float*)0x69d1b0 = 15990.0f;
*(float*)0x69d1b4 = -19990.0f;
*(float*)0x69d1b8 = 19990.0f;

DWORD dwVp2;
VirtualProtect((void*)0x401000, 0x27CE00, dwVp, &dwVp2);
}

int main()
{
updateGameBounds();
}


EDIT: this method would cause a bit of overhead on the game, since it stores larger entities inside a sector.
Sector searching algorithms, rendering algorithms might be bogged heavily

http://swoorup.x10.mx/index.php/Gamebounds.cpp

This post has been edited by Swoorup on Monday, Jun 10 2013, 17:14
PMMSNYahoo
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Pages: (57) « First ... 55 56 [57] 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG