in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.21k stars 358 forks source link

Playing radio stations #29

Open in0finite opened 5 years ago

in0finite commented 5 years ago

TODO:

in0finite commented 5 years ago

Radio stations can be large (> 100 MB), so they can't be loaded at once. Only the part of the station which is currently played, should be loaded.

lexnewgate commented 5 years ago

The code is structured well and thus clear to me. However due to my inexperience both in GTA game and Unity, I still have some extra work to do. Here is a todo list.

lexnewgate commented 5 years ago

Are all stream sounds with 2chars radio stations(except AA)? image Other names such as cutscene or beatsdo not belong to radio stations. Am I correct?

in0finite commented 5 years ago

Play game to check input keys relevant to radio stations

We don't have to use the same keys. The original game uses mouse scroll (which can be read from Ped.MouseScrollInput), but this is not available on mobile platforms. So for now, we can use the same buttons which are used for switching weapons (E and Q on a PC, arrows at bottom of screen when using touch input). These buttons invoke OnNextWeaponButtonPressed()/OnPreviousWeaponButtonPressed() on current ped state. So you can override these 2 methods in VehicleSittingState class, and switch radio station.

whether the radio station still be playing after the player get off the car without switch off radio.

It's switched off in original game. This should be configurable. It would be cool to hear radio sound in 3D, when ped is not in the vehicle. But, for the sake of simplicity, we can switch off radio for now.

I think I have to read some doc and play with mirror a bit. (Btw, why you choose mirror? Are there some special considerations or you just pick it random?)

I choose Mirror because it seems like the best networking solution to me. You don't need to make it networked. I can do it, if it's a problem for you.

in0finite commented 5 years ago

Other names such as cutscene or beats do not belong to radio stations. Am I correct?

I think you are correct.

I forgot to mention this. You can download SAAT, extract it, and open metadata-generic.ini. There you will find all info about radio stations.

lexnewgate commented 5 years ago

arrows at bottom of screen when using touch input

Is there any art resource to show these arrows? Or I just use button named < and >.

It would be cool to hear radio sound in 3D

Yeah. Thats what I am thinking about.

But, for the sake of simplicity, we can switch off radio for now.

Sure.

I choose Mirror because it seems like the best networking solution to me. You don't need to make it networked. I can do it, if it's a problem for you.

No. It will be no problem for me. I am also interested in it.

I forgot to mention this. You can download SAAT, extract it, and open metadata-generic.ini. There you will find all info about radio stations.

I have checked the files. It seems they are all raido stations. (They are all in a form of station=xx)

in0finite commented 5 years ago

Is there any art resource to show these arrows?

Touch input is already implemented. You can turn it on in Options => Misc => Use touch input.