-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a Way to Easily Capture Maps #77
Comments
For future reference: there has been some discussion about this at issue #79. And the URL for nlhan's ets2-map is: https://github.com/nlhans/ets2-map Then I wondered, how was http://ets2map.com/ created? I don't know, and the "About" link in that site shows nothing. But then I found another map: https://map.krashnz.com/ https://forum.ets2mp.com/index.php?/topic/21376-ets2-map/ That map looks awesome! Maybe we should contact them and join forces. I see they used "Leaflet" while we use "Openlayers". No problem, I can convert stuff. |
I contacted Krashnz (from map.krashnz.com) via the ETS2MP forums a couple hours ago about how the map was generated. I'll post the response here (if I even get one 😆 ) |
Well, it has been over a week with no response from Krashnz... It looks like either improving the map capture mod or improving the ets2-map solution is our best bet so far 😦 |
I've tweaked |
Ok, so I gave up on building the SVG using Hey @Funbit, out of curiosity, what zoom level did you use when you built the printable map for ETS2? Also, should a 1920x1080 resolution work fine with the default settings in the |
Do you have some experimental code that exports to SVG? Maybe you forked To be honest, for me it is hard/annoying/slow to develop stuff on the Windows machine, so I am very slow regarding anything that requires booting Windows. :-\ |
I tweaked the application to generate a quick and dirty svg using HTML markup; however there were some issues when I tried running it (most likely since I told the program to start from int.MinValue and go to int.MaxValue for both X and Y). I'm going to clean it up first (and probably create a separate executable), and then I'll push it to my fork. |
The code I wrote up for generating a HTML-friendly SVG can be found at mike-koch/ets2-map@d52dcb8...db1b956. It's very very slow, even using a range of -2000..2000 x -2000..2000 is very slow. Not sure if this is a feasible option or not. |
It looks like someone used Funbit's tool to build a map of ProMods + RusMap, which I have attached. I have not had a chance to check to see if the scale is the same or not. http://www.mediafire.com/download/b74886a33ip4fxq/map.png (I didn't want to attach it here due to the size of the image itself) |
Oh, yes, I created that one. The scale is the same, apart from the UK. Funbit resized the UK to make it the proper size, I left it alone. Therefore there is no need for the calculate coordinates UK logic anymore. As for the settings: |
Cool! I started rewriting Also, I can't download the map:
|
Try this link... this is the one on the forums: http://www.mediafire.com/view/b74886a33ip4fxq/map.png |
Alternatively you can use this URL: https://app.box.com/s/wv331ke4zmabim6zumpp13c4qabiipu0 |
Great work @Koenvh1 ! |
The map is by @Koenvh1, as mentioned here: mike-koch/ets2-mobile-route-advisor#77 (comment) The exact formula seems slightly off. More testing is needed. For such purpose, I've also created `coords.html` file. The map tile images will be included in the next commit.
As described here: <mike-koch/ets2-mobile-route-advisor#77 (comment)> This commit only contains binary data, it contains all the images. They were generated using `slice_and_resize.sh` script (also available in this repository), and then optimized (i.e. losslessly recompressing them to reduce the file size) using [`zopflipng_in_place`][1] script, which is just a wrapper around [`zopflipng`][2]. [1]: https://bitbucket.org/denilsonsa/small_scripts/src/default/zopflipng_in_place [2]: https://github.com/google/zopfli/tree/master/src/zopflipng/
I've sliced @Koenvh1's map and uploaded a version of OpenLayers demo to my ets2-stuff repository. It is also available online. Then I took some time adjusting the formula to Koenvh1's map. I got it pretty close to the correct values, but it still seems slightly off. If anyone wants to help, look at coords.html and adjust the numbers there. You may also look at the online demo (but you won't be able to edit the formulas there). To help with the formulas, both online maps (Funbit's map and Koenvh1's map) will print at the JavaScript console the coordinates of where you click. It will be two pairs, one in OpenLayers inverted Y coordinates (ignore this one), and another in the natural image coordinates (look at this one). Ideally, in the future, the mobile route advisor can have an on-screen configuration of which map tiles to be used. |
Great work @denilsonsa . I am using slightly different coordinates: How did you slice it? I used gdal2tiles-leaflet, but that reverses the x and y. |
I've described it at the commit message and also at By the way, you should consider writing down a README for your ETS2-City-Coordinate-Retriever. 😉 Try these in-game coordinates at
It has been a while since the last time I started ETS2, and even longer since I last played it for fun. It's great to see the progress you both did on capturing the cities (using a pretty simple solution). |
Whoops, I should learn how to read 😊 I've written a short README that should work for most. It's not the most extensive document, but it works (I hope 😛 ) I am using the same scale as Funbit (unless SCS changed it), so that should not be the issue. I have noticed a little offset, but nothing too bad. |
@Koenvh1 One question: I noticed in the |
@mike-koch No, but what Funbit did was capture the map, and then shrink the UK to be properly scaled (compared to where Norway is)... I just captured the map and left it that way. Compare the location of Bergen (NO) and Aberdeen (GB) in both maps. |
Gotcha, I'll check it out later tonight. By the way @Koenvh1 and @denilsonsa , I went ahead and created a gitter.im room over at https://gitter.im/mike-koch/ets2-mobile-route-advisor. It might be easier to communicate there and in more of a "real-time" environment than over here in the issues section. |
@mike-koch @denilsonsa @Koenvh1 @Funbit There is a working way to extract the map with latest game version? Whatever, awesome work! Thank you! |
I can't help you with that I'm afraid. Last version introduced the mercator projection for ETS2, which means that maps will now be projected as if they were on a globe. This makes map capturing (and more specifically pixel to coordinate calculation) a whole lot more difficult. However, I did see this recently: https://www.reddit.com/r/trucksim/comments/7hu1t2/the_good_part_is_that_my_program_worked_with/ |
Meanwhile i made the map settings mod working with 1.30, here attached. With some work i was able to capture the map, https://imgur.com/a/99rSf , it takes a while. Now i'm trying to adjust columns and rows to get entire map grabbed. |
If interested, github project with source code here https://github.com/shardick/ets2-map-settings-mod |
I have created a quicker way, based on ts-map, which I have uploaded here: https://github.com/Koenvh1/ts-map |
Welcome back 😃 .... I'll have to take a look at your approach when I get some time.... currently backed up on a few other projects at the moment 😆 |
seems great, but why only 5 zoom levels? it's possible to have 8 levels? |
Everything is possible. 😉 Slight nitpick: There are six zoom levels (0, 1, 2, 3, 4, 5). I set the tile size to 4000×4000, which means that you only have five levels before you reach layer 0 with a single image (or four images with padding). If you set it to something smaller (e.g. 256×256), then you should be able to create more layers. You can also create a more sophisticated pyramid building algorithm, but this suffices for my use case. |
yeah :D 6 :) thanks, i will try |
You can see it in action here: https://koenvh.gitlab.io/ets2-map/ |
That is awesome! Given that you wrote your own renderer... I wonder if it would be possible to export as some vector format. OpenLayers has support for vector tiles, look at some examples:
It could be possible to export it as SVG, because that's a well-supported format everywhere. And OpenLayers can use it (without requiring splitting up in tiles): https://stackoverflow.com/q/34416412 I just don't know how large and heavy the resulting SVG would be. As an extra idea if anyone wants to go beyond, the graphics (i.e. the roads and buildings) could be the SVG format, but all the text could be a separate file that is rendered on top. This would allow for readable text even if the map is rotated or zoomed. Again, congrats on building your renderer! (And I'm sorry that I won't have time to contribute to this project for the foreseeable future.) |
I did not write my own renderer - I adapted it from https://github.com/dariowouters/ts-map which in turn based it on https://github.com/nlhans/ets2-map (it should show up as a fork from that). I did create the process for capturing the images systematically and turning them into tiles, but I do not want to take credit work the renderer - thank @dariowouters and @nlhans for that. To answer your question: This would mostly be possible (the renderer currently turns it into a graphic, there is no reason why it couldn't turn it into something else) - however, whilst the roads are vectors, the overlay imagery (rest stops, road numbers, etc) are not. An alternative would be to turn it into OSM XML, so that you could display it using any OSM-compatible style. |
In develop branch ts-map an easy way to capture map tiles was added, I tested this with max zoom = 8. Works great! Perhaps at the moment it is one of the most really working and useful tools for this. |
A highly requested feature is to include 3rd-party maps (such as ProMods). However there is no easy way to capture maps. There are two options:
ets2-map
utility which can map most of the roads out, but seem to be missing prefabs.The text was updated successfully, but these errors were encountered: