Radio does not re-init/play when exceeding 40.0 units

  1. Canary, v1.0.0.5156, tested with mpsecurity and mptuner, onesync off and on
  2. I expect to hear the radio upon returning
  3. No radio is heard
  4. Client, Radio

Requires two clients.
Player 1 - In any vehicle with a radio
Player 2 - On foot

Player 1 tunes to whichever radio station. Player 2 hears the radio.
Player 1 then drives >40.0 units but <424.0 (onesync on) / 900.0 (onesync off) away and returns back to Player 2. Player 2 does not hear the radio until Player 1 swaps radio station OR drives >424.0 (onesync on) or >900.0 (onesync off) and comes back again.

If Player 1 is less than 40.0 units away, which seems to be within the attenuation distance, the radio is heard continuously.

I had someone verify that this is not an issue on GTA:O.

2 Likes

That’s odd for this to also happen with ‘onesync off’, but yet behave differently on R* sessions. Is Rockstar doing anything special using script?

2 Likes

Not sure, will try to investigate… Might look it up in ReClass and see what’s up too…

1 Like

After looking at this, here are some insights (1604 retail addresses):

At 0x1403D9F57 there is a some logic for recreating the radio emitter. In addition to some vehicle hardcodes 0x149BD32A (pbus2), 0xEDA4ED97 (blimp3), there is also a check for a specific flag: *(audEntity + 164) & 0x80) != 0

This value is set in: 0x1403D9C94 and 0x140F50284: which checks if the entity has a PLAYER_VEHICLE decor value (i.e., one that exists; value does not matter). There are likely some more features dependant on this decor that could probably be searched for.

Also, 0xC1805D05E6D4FE10, 0x2F7CEB6520288061, and 0xDA07819E452FFE8F are all natives related to radio emitters, its low-pass/distance threshold, etc.

11 Likes

Yup, can confirm. When setting that decor it does indeed work with my repro script!!1

Thank you! :smiley:

5 Likes

I’m surprised game code cares about a random freemode decorator value. :open_mouth:


Another easy to find piece of code that cares about this decorator seems to be CTaskOpenVehicleDoorFromOutside.

4 Likes

(After a two minute search…) It seems PLAYER_VEHICLE has uses related to VEHICLE_LOD_MULTIPLIER, Is Stationary in CVehicleGameStateDataNode, and things in CVehicleTrailerAttachPoint and CVehicleGadgetTowArm.

PLAYER_BOSS and PLAYER_GOON are also referenced in a few places: e.g., CTaskEnterVehicle, CTaskPlayerOnFoot. CTaskOpenVehicleDoorFromOutside has also references to PLAYER_HACKER_TRUCK, PLAYER_AVENGER, and PLAYER_TRUCK.

7 Likes