Koenvh1 / ets2-local-radio

Radio from wherever you are in ETS2/ATS
https://koenvh.nl/projects/ets2-local-radio
Mozilla Public License 2.0
230 stars 40 forks source link

CanaDream and C2C someday? #53

Closed veso266 closed 5 years ago

veso266 commented 6 years ago

Hi would like to know if you had any plans on adding stations for C2C: https://forum.scssoft.com/viewtopic.php?t=202317 and CanaDream: https://forum.scssoft.com/viewtopic.php?t=205149 maps?

would also like to know how do you find City of Licence quickly because if you go to Canada on FMScan you can only filter by region not city but to manualy google a station and find its city of licence on wikipedia or somewhere it probably takes to much time

Thanks for Anwsering and Best Regards PS: how do you find a relative_radius and relative_whitenoise for a station (city) to put in cities-ats.js (do you find range on fmscan and then calculate by 1:20 scale?) PPS: it would be nice if there was an option to add cities-ats-custom.js (I have couple of custom cities in cities-ats.js and when an updates comes I must be very careful not to override custom cities with an updated cities-ats.js

PPPS: maybe add a simple to use add your station menu so people that are not so tech savy(don't know how to edit json) could quickly add their favourites stations as they play ATS/ETS2 on custom maps that you don't (yet) support

Koenvh1 commented 6 years ago

There are no plans to add those, unless someone else is willing to maintain them; I only maintain the base game and DLCs for ATS. Viva la Mexico is maintained by Rafa Martínez, meaning he provides and updates the stations. Reason is that radio stations in America are licensed per city, instead of per country/state, which means that adding station takes a lot more work. For example, there are 21 radio stations available in France, while New Mexico contains over 70 stations.

So, if you feel like doing it: Great! Go for it 😃 (Not just you, anyone who wants to take it on)

You can find how the stations for Viva la Mexico work in the cities-ats.js and stations-america.js files. The cities can be generated using this: https://github.com/Koenvh1/ETS2-City-Coordinate-Retriever Though if you can't figure it out, I can do that for you.

Anyhow, stations for the USA can be found using http://radio-locator.com, http://radiostationworld.com for Canada.

The relative radius is purely based on the map (http://localhost:8330/map.html?ats) and just driving around. You can see where there are gaps on the map.

Most people don't know how to add their own cities, hence I did not add a custom file for it. However, you can just add those to the stations-custom.js file. Something like

var cities_custom = ...;
cities = cities.concat(cities_custom);

Same can be done for country_properties and city_properties, just instead of x.concat(y);, use Object.assign(x, y);

Editing the JSON file should not be too difficult I think, plus an external editor is a lot less flexible. I think finding the right stream URL is more difficult in most cases. I so far have had no questions about editing the JSON yet (whereas I have had a lot of questions about finding the right URL, because that's a lot less trivial)

veso266 commented 6 years ago

started to slowly add canadien stations: https://github.com/veso266/ATS-CanaDream-RadioStation/blob/master/ats-stations.js

and to make it more fun for me

PS: would need some help with : https://github.com/Koenvh1/ETS2-City-Coordinate-Retriever (I've edited ets2-city-coordinate-retriever.exe.config and setted (what value is it expecting? (output folder, or mods folder)?

the I ran ets2-city-coordinate-retriever.exe after pressing enter I switched to ATS and opened map with m key but the the program said: "Processing 0 Cities which I assumed that it didn't do much)

BTW: anyway to hear only static when there are no station (defined in cities-ats.js) around lets say 4000 meters radius (like when driving with a real car if there is no radio transmitters around you, you hear only static)

Koenvh1 commented 6 years ago

You will need to extract the def/city folder from the mod, and point the folder to where you extracted it. That is where it gets the city data from.

The closest city, no matter how far away, will always be available. You could however add a placeholder station without stream, which would have the same effect. This was a deliberate choice, and is unlikely to change. The program requires 1..* stations to be available, so it won't work with 0, hence 0 isn't possible. Consequently, every country (ETS2)/city (ATS) needs at least one station associated with it.

veso266 commented 6 years ago

not sure what I am doing wrong but I still can't get ETS2-City-Coordinate-Retriever to work I've extracted dev/city and city.canada.sii and pointed it to the folder but when opening ATS and pressing Enter I only get: Processing 1 Cities (there is a lot more than just one) and nothing is ever written to game-log.txt like the program tells me it would do

Koenvh1 commented 6 years ago

So you have extracted the def\city folder to let's say, X:\city_canada? In that case you should point the folder to X:\city_canada. That folder (X:\city_canada) should then contain all city definitions for the mod (ottawa.sii, winnipeg.sii and whatever other cities are included in CanaDream).

veso266 commented 6 years ago

that did it but now I have a bigger problem I am using a Slovenian keyboard layout which means z and y are reversed so when ETS2-Cordinate-Retriever is typing in console goto commands (goto calgary for instance) ATS thinks it typed calgarz (because its not posible to change that in the game or is it?) and complains the city is not found

you could probably fix this by setting an english keyboard layout while ETS2-Cordinate-Retriever is in use and then set it back: https://stackoverflow.com/questions/37291533/change-keyboard-layout-from-c-sharp-code-with-net-4-5-2 but for some reason I can't force ATS/ETS2 console to use Slovenian keyboard layout which means I have to type y for z and z for y

Koenvh1 commented 6 years ago

Ah, yes, didn't know that nor did I test that. Unless you want to fix it yourself, I'll probably leave it be. It's not a polished product, nor is it meant to be. It just makes it easier for me to get the coordinates. I've quickly looked at the code, and I don't see a simple way to fix it. Changing the keyboard is not intended behaviour, and might cause other problems. (Who expects a program to capture city coordinates to change their keyboard settings?) So I won't do that.

veso266 commented 6 years ago

making some progress here:

Koenvh1 commented 6 years ago

Oh, whoops, that's a typo that has been in there since forever. Instead of the game.log.txt, open your bugs.txt file, and copy the data from where the cities start to the end to a new file and point it to there. Like this file for example: https://github.com/Koenvh1/ETS2-City-Coordinate-Retriever/blob/master/cities_east.txt

veso266 commented 6 years ago

Thanks now it works like a charm: https://github.com/veso266/ATS-CanaDream-RadioStation/blob/master/ne-glej-sem/cities_canada.json

04Marcus commented 6 years ago

Hey, Koen told me that you're working on CanaDream. I collected radiostreams for almost every city in CanaDream, so maybe we can merge our work? The iHeartRadio-station streams (the "streamtheworld" ones) are still included in that list so these streams need to get picked out, I think.

veso266 commented 6 years ago

sure why not (but I am adding stations realy slowly :) ) PS: when adding stations I've figured out that even if the stations seems geoblocked (Bell Media Radio ones) most of them have there streamtheworld stream open to everyone

Here is my list: https://github.com/veso266/ATS-CanaDream-RadioStation/blob/master/ats-stations.js if you it's usable (and also my finding on streamtheworld streams from Bell Media) and I try to avoid .m3u8 streams because for some reason they don't work (there are still some TSN m3u8 streams that I would need to replace with streamtheworld ones)

and here is my progress: https://github.com/veso266/ATS-CanaDream-RadioStation/tree/master/ne-glej-sem so you can see how slowly I am adding them

04Marcus commented 6 years ago

Hey Veso, sounds great, thank you! :) To be honest I wasn't sure if you're still working on that, so I started (mostly because of the interest how to do something like that) to extract the cities etc. by myself. I'm sorry... (Impatience, you know 😏)

I hope there's still a way to merge our work, because your list of radio stations is really great! Maybe you like to take a look at my github. I'll update my progress there soon, too. >> https://github.com/04Marcus/canadream_radio

P.S. The filepath for the logos is a bit different, because I thought of creating a folder "canadream" with all cities included to keep the "stations" folder clear - like C2C already did.

veso266 commented 6 years ago

Don't thank me I must thank you for doing all the hard work

Maybe if its possible to merge this: https://github.com/veso266/ATS-CanaDream-RadioStation/blob/master/cities-canada.js (spend quite some time edjusting relative noise and ranges to much as real life as posible (never been to canada but estimated on how big the city is and if there are hills sourounding it)

and the images (spend some time finding transparrent logos and local logos( for CBC local stations)

And i've used filepaths for the logos the way i did because i thought its well organised (every city has its own folder and in it arè stations that this city has)

04Marcus commented 6 years ago

The filepaths of you are quite similiar to the ones I used. The only difference is the folder "canadream" I created. In the folder candream are folders for every city, too. The reason is that in the "stations" folder are already all cities of ATS + official Addons and Viva Mexico included, so adding all Canadream cities would probably make it to messy. In addition to that I thought of adding the multiple used CBS and Prémiere Chaine Radio Logos directly into the "canadream" folder to avoid duplicates and to safe some space. Maybe its useful, maybe not 😁

I've got one question according to the whitenoise of Vancouver: Why did you set it to 5.0? Is the radio reception that bad in that area? 😃 Just kidding ;) I think that's a typo?

veso266 commented 6 years ago

Adding CBC logos direcly to CanaDream folder is actually great idea (i dont think space is a problem nowadays (also I tried using .svg logos where I could find them (vector graphic can be resized (if needed for the future)

As for Vancouver(thought of doing this for Yellowknife (did it with relative_radius: 5.0 and relative_whitenoise: 3.2) and Whitehorse too) I've set it to 5 because I think its quite nice when driving there and US stations disaphear and when getting close to Vancouver stations from there come in better (reminds me of driving from Slovenija to Austria and listening to Kronehit on 107.6 and when you cross the border RDS comes in and I am Happy :) )

Hope you can find in your heart to forgive me for having this there (I can always change this locally but I think people would apreciate it (at least I would if I didn't knew how to do this))

Hopefully this can stay on 5 for added realism and someday maybe someone records his drive from Seattle to Vancouver and tell me if I predicted right

04Marcus commented 6 years ago

I know what you mean and I like the idea, but I'm not sure if the whitenoise value should be changed or works like that. I think the "relative_radius" for each of the surrounding cities needs to be adjusted, so it changes exactley at the border. Maybe Koen knows how to realize it in the best way.