Threads
RussiaNick007J6 years ago

This thread contains information on details of game spawning random peds.

Game attempts to spawn random peds (not counting cop peds with wanted level etc) when current number of spawned peds in below a certain threshold. Threshold's formula is min(X1 ¤ X2 ¤ X3 ¤ X4, 25 ¤ X3). I'll detail them.

First of all, there is a file gta3.ini in everyone's game directory. It contains two numbers: one in car density, another is ped density. Ped density from this file is X3. Obviously in runs this file must stay in its original state so it doesn't really matter (although it might be interesting for testing and other stuff.

Second, there is a mission ped density multiplier (opcode 03DE). In GTA III it's just 0.0 to remove all peds at all and 1.0 to reset it to normal state. This coefficient is X4. For described reasons X3 and X4 can be removed from consideration, basically leaving with min(X1 ¤ X2, 25).

X1 is a zone density multiplier. It is a sum of ped density and car density. which are setup by opcodes 015C and 0152 (second number parameter in both of them). There are different versions for day (8-19) and night (22-5) [evening and morning are interpolated]. This sum is X1.

X2 is a road density multiplier which has a very important effect. It is a sum of lengths of all roads (including multiple lanes) in a rectangle 80x80 meters with player in the center, divided by 2500. (Edit: for those paths framgents, whose both boundary nodes are present in said rectangle, distance counts twice). Its current value can be found at address 0x9415A8 in version 1.1 for testing purposes. And here are the screenshots how it can affect, for example, Trial by Fire.

Here is a picture 1. http://i.imgur.com/NikVw3V.png Here only red lines (car paths) are relevant. In the center of this rectangle coefficient is approximately 1.27 - as it involves 3 roads, one of which is multi-lane. Here, during the night, for example, max peds count is min(16¤1.27, 25) = 20.

Here is a picture 2. http://i.imgur.com/jTw7blv.png Center of this picture has a coefficient of 1.41, which limits ped count at 22, as a northern road is additionally taken into account.

Now here is a picture 3. http://i.imgur.com/vGpdGsG.png Center of this picture, which is just an opposite side of the road shown in picture 1, has coefficient of just 0.64, limiting total number of peds in the night with 10! Even during the day, limit is fairly low, 23¤0.64 = 14. Coefficient is even lower on a road to the west of one shown in the picture. It causes a lot less spawns during, for example, Trial by Fire (using rampage + remote pickup). Choosing a different place with better coefficient might make this mission faster.

Patrick_, agjents and 4 others like this
RussiaNick007J8 years ago

Video:

Formally, it's enough to start the mission while on taxi mission with passanger in cab. However, unfortunately game crashes if some special models (like Joey's) are not loaded. Guaranteed way to avoid crash is to start Salvatore's Called A Meeting and end it and then immediately instapass (like shown in the video, mission is aborted by firefighter). If I remember correctly, it was tested that starting Dead Skunk In the Trunk after attempting and failing mission doesn't lead to a crash of instapass. However, trying this instapass without starting mission first with current any% route leads to a crash.

Edit: you don't actually require a passanger, you can keep caps without picking one up.

RussiaNick007J8 years ago

Here is a video: Pay attention to "CCarCtrl::ListOfInterestingVehicles[0]" and "CCarCtrl::ListOfInterestingVehicles[1]" in Cheat Engine window. As you can see, taxi is removed from the list if taxi driver, who hasn't despawned yet, tries to enter it back, but driver door is blocked. This means that it turns into usual traffic car which despawns if player gets too far away from it.

Therefore to avoid despawn:

  1. you can steal taxi in Luigi's girl, as you will safely reenter it in Don't Spank Ma Bitch Up
  2. you can drive safely making sure you don't have left door blocked while driver still hasn't despawned
  3. you can reenter taxi near Stallion to add it back to player's vehicles list.
Mhmd_FVC, guywith, and blacklev like this
RussiaNick007J8 years ago

I've tried to track down what exactly causes heli to despawn during Lance pickup cutscene and now I can share my findings.

In fact, the heli despawns even before player reaches Lance as game thinks that it is not needed just like some faraway random traffic. Usually it doesn't happen, because (unless vehicle is tied to a mission) last 2 player's cars are specifically prevented from despawning. However, the thing is that heli can be removed from player's vehicles list and it leads to a despawn.

What leads to this removal? It's an strange behavior of ped's AI process. Vehicle is removed from this list if there is a ped that has the vehicle as a target and (this is just a hypothesis, but it seems realistic) game can't find coordinates that can be used for jacking it. In fact, it is guaranteed to be removed from list if a left door is blocked. So if you exit the heli through the right door, it is guaranteed to despawn. However, exiting through left door doesn't guarantee anything. At first, if a door was blocked at any moment after entering junkyard (when guys become hostile), it is removed already and further maneuvers don't matter. Secondly, there are cases when door was never fully blocked, but the vehicle is still removed. I am not sure what exactly causes it in this case, but I have two ideas: first, the safe area used for this calculation is slightly bigger than used for actual entering, second, the path can't be created to those coordinates (the way to a door is blocked). I don't know exact answer, though.

So, if you feel that at some point left door was blocked or was in awkward position, you can quickly relocate it to a safe position, exit it, immediately enter it again and exit it again. If the position was safe, this should prevent it from despawing.

RussiaNick007J8 years ago

This is a risky trick but luckily with more or less a fail-safe method. The start is usual: start Evidence Dash and reach on_mission == 0. After it the most risky trick has to be executed. The thing is that if you just enter the marker, one copy of Gangcar Round-Up will instapass (the one that was originally Evidence Dash), the other will still be running and since instapassing will set on_mission to 0 again, Kingdom Come will start (the player stays in the marker). And this would crash the game.

So how to avoid this? You have to activate mission while still moving and exit the marker by the end of the movement. However since the game activates this particular mission only when player is not moving (not using keyboard as far as I understand), there is only one way to execute this trick: by jumping off the phone. The most consistent way in terms of fail-safety in shown on video. Mission will start, one copy will instapass and the other will still be running. If may require a few tries but it shouldn't crash the game.

To cancel the other copy of mission you need to start vigilante. The next problem that now both Kingdom Come and Gangcar Round-Up are available. If you immediately enter the marker, first mission to start would be Kingdom Come with Gangcar Round-Up being second. As we know, this leads to the second of the missions to be active. However after reloading the game the order of mission-starting scripts will reverse. So Kingdom Come will be activated. It can be passed normally, however you have to start vigilante after its completion once again because one more copy of Kingdom Come will still be running.

This instapass works for 100% only since it doesn't affect mission counter. However the percentage is increased.

Also thanks to Powdinet for original discovery of instapass and video.

Patrick_, RunnerHAWORTH and 2 others like this
RussiaNick007J8 years ago

As it was suggested, weather is fixed in GTA III. There are 4 types of weather: sunny (0), cloudy (1), rainy (2), foggy (3). Here is the array of weather loop: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 02 02 01 00 00 00 01 03 03 01 00 00 01 01 00 00 00 00 00 00 00 00 01 01 02 02 01 02 01 00 00 00 00 00 00 00 00 00 00 03 03 00 00 00 02 01

Weather changes only when another hour advances. Sometimes (like sunny->fog) change doesn't happen immediately. The first weather is fixed, it is 1 (cloudy) up until 8-ball is spawned after safehouse cutscene. After it next hour advance will mean that the current weather will be set to 0, element #2 of the array (first 0 it skipped). At next hour advance the weather will be set to 0, and previous weather will be set to 0 as well and so on. There are 3 missions that lock weather the same way: Blow Fish after Trashmaster is in fish factory until the end of the mission, Last Requests from getting to boat until the end of the mission, and Gone Fishing from the start to finish. During these missions running under these circumstances the weather loop will not advance (so weather changes will be postponed). Similarly, arriving too late at safehouse (approximately 4:46 and later) will pospone it as well. The Exchange locks weather as well during ending cutscene until mission end.

xsharawi, Patrick_, and Zachoholic like this
RussiaNick007J8 years ago

Vigilante is dead forever after it :(

Marcinp93, domisbak and 4 others like this
RussiaNick007J8 years ago

Do not enter Dodo from mission! However, regular spawned Dodo is okay.

RussiaNick007J8 years ago

Instapass happens, if you enter Patriot during Salvatore's called a meeting after picking up Luigi while on_mission = 0. There might be a probability that one byte in the memory can be corrupted, but at worst it should only make one of the phones ringing.

It also may save no time, since more than 3 minutes are wasted on Salvatore's called a meeting, but instapass is instapass OpieOP

RussiaNick007J8 years ago

So I decided to summarise the info on this interesting glitch, which doesn't seem to be useful for speedruns, however, still is pretty amusing and can theoretically help in extreme situations.

First of all, videos. With cheats. Without cheats.

What is the trick? It depends on two things. First of all, special busting animation should occur. Besides usual animation, during which cop needs to open door first, there is another which occurs while player is entering a car. Here are two gifs of busts showing both animations. Regular:

Special:
The second one can lead to invincibility glitch. The thing is that player is set to be busted even before he gets in the car. To avoid unexpected outcomes it was programmed that player can't die until he fully enters the car. However, there is a way to cancel entering animation, by blowing up the car during it. Player will not die and since he is set to become invincible until he gets in the car, he remains invincible.

Car can be blown up at least in two ways. First and easy one is to type blowing up cheat during animation. Second one is to set car on fire beforehand and then get in.

Getting the necessary animation is more tricky. There is a consistent way to get it: if player punches cop and immediately enters the car (while cop is still recovering), this animation will occur. It is a bit more tricky without a cheat because cop should be near a car so that player can quickly enter it, and it takes time to damage a car. It also seems more consistent if cop has already pulled out a pistol.

Damage that should be dealt to the car is at least 750 but no more than 1000 (8 or 9 shotgun pellets or 15-19 M16 bullets unless car is damaged too much) for it to start burning and not to explode.

Also since player is set to be busted, he can't enter any car until whatever remains of busting cop still exist, otherwise he will be busted.

Now about invincibility itself. While player is on foot nothing at all can kill him: not bullets, fire and explosions, not cars running him over, not water and not even crusher, which normally sets health to zero if player gets inside it. While player is in car he still doesn't take damage from water. But if a car gets blown up with a player inside, he dies. Also player still can be busted.

The unfortunate part about it is that invulnerability is removed by opcodes 01B4 with parameter 1 (remove frozen state) and 02EA (end cutscene) if there actually was cutscene. So this basically means that any mission removes invincibility. However it works with rampages and regular gameplay.

This glitch also works in Vice City and was originally discovered by KAS.

SRK, Svenir and 3 others like this
RussiaNick007J8 years ago

So I've recently found out that Evidence Dash can be instapassed with a tank. I'm not sure if it is known but there is pretty quick way to obtain it during Arms Shortage. The execution is awful in my video but a think optimal time would definitely be under a minute (maybe much less if tank is pushed while waiting for Colombians). Unfortunately there is a small problem because this particular tank is not explosion-proof, so it can start burning after a few collisions. Anyway, i hope this can be useful. The general idea is to block both doors. For some reason only during a mission (at least it didn't work for me after speaking to Phil) if you try to enter a tank, Claude gets in. PS: Not sure if it is important, but if the tank is stored in garage, it becomes explosion-proof.

dimiusko, Gaël and 3 others like this
About Nick007J
Joined
8 years ago
Online
1 year ago
Runs
0
Games followed
Grand Theft Auto III
Grand Theft Auto III
Last visit 1 year ago
606
visits
Grand Theft Auto: Vice City
Grand Theft Auto: Vice City
Last visit 1 year ago
310
visits