Quantcast

Jump to content

» «
Photo

Documenting GTA 3 car spawns per district

1 reply to this topic
Rodrigowski
  • Rodrigowski

    The flesh of fallen angels!

  • Members
  • Joined: 13 Dec 2012

#1

Posted 01 January 2018 - 06:21 AM Edited by Rodrigowski, 01 January 2018 - 06:23 AM.

I wanted to find out which cars spawn at which districts and how often. After some quick searching, I learned that main.scm is responsible for this, more specifically opcode 0152. This is what a 0152 command looks like:

0152: set_zone_car_info 'HARWOOD' 1 8 0 0 0 0 0 0 0 20 400 0 0 300 0 0 

As you can see there are 17 parameters for it. My search had indicated what 4 of them do. I went ahead and created a sheet with the initial setting commands for all districts to better analyze it. After that was done I had solid guesses that most of the parameters are related to gang cars and car "classes" as defined in handling.cfg.

 

Afterwards I modified main.scm to check whether my hunches were correct. The screenshots show what I found:

Spoiler

 

Here is the main.scm used to get these screenshots: https://drive.google...wqKddf0GUwW5IXp

Opcode 0152 is initially called at lines 415 through 708. A new game is needed to see changes.

 

You can access the sheet here: https://docs.google....dit?usp=sharing

 

So, what was learned from this?

 

Opcode 0152 is used in main.scm to set which cars appear on which districts and how often. Let's do a quick breakdown of all its parameters with the names I used for the sheet:

 

DISTRICT: The district where the cars will appear, as a string

 

TIME: 0 for night-time spawns, 1 for day-time spawns

 

DENSITY: 0 means no traffic at all, spawn rates go up with this parameter. Maximum used by default is 24

 

MAFIA SENTINEL, TRIAD FISH VAN, DIABLO STALLION, YAKUZA STINGER, YARDIE LOBO, CARTEL CRUISER, HOODS RUMPO XL: Chance that this gang car will appear (probably out of 1000, e.g. 150/1000 would be 15%, untested)

 

POLICE: Chance that Police Car will appear (probably out of 1000)

 

POORFAMILY, RICHFAMILY, EXECUTIVE, WORKER, SPECIAL, BIG: Chance that a car in this class will appear (probably out of 1000). Car classes are defined in handling.cfg, e.g. Perennial is a "poorfamily" car, Banshee is "executive", Linerunner is "big"

 

I will continue studying this subject later. Here are some final interesting remarks for now:

-Taxis are nowhere to be seen in arguments, and they appear in every district even if you set it to spawn only one class of car

 

-Some districts have 0152 opcode set, but no cars ever appear on it, like Portland Beach and Portland Harbor. Some others don't even appear as separate districts in the city, like MAIN_D1 to MAIN_D6 (which are main roads), and FILLIN_1 (I have no idea what could this district be, maybe the Junkyard?). I also don't know what's the use for HOSPI_1 and COPS_1 since they are overriden by Portland View. Lastly, there are 3 different district entries for Shoreside Vale, and WEE_DAM (which could be the lower part of Cochrane Dam) is called, but all of its arguments are 0

 

-For the "time" parameter day starts at 05:00 and night at around 20:00

 

-Values for most of the parameters seem to be a chance out of 1000, but on most districts if you add up all the chances you get a number lower than 1000, like 800-ish. Maybe the remaining chance is used by taxis

 

-Opcode 0152 is called again in main.scm, apparently at some missions. I'll try to find out more about it

 

-According to what was learned the best place to look for Mr Whoopee is at Portland View during the day : P

 

That's all, thanks for reading and if you have any questions feel free to ask them. I will post again when I find out more


zmudziak32
  • zmudziak32

    Homie

  • Members
  • Joined: 14 Dec 2007
  • Poland

#2

Posted A week ago

Thank you for doing research. How about doing same thing for Vice City?

 





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users