Git Product home page Git Product logo

Comments (34)

dowmeister avatar dowmeister commented on September 26, 2024 2

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.

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024 2

I have created a quicker way, based on ts-map, which I have uploaded here: https://github.com/Koenvh1/ts-map

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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 😆 )

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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 😦

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

I've tweaked ets2-map to build a HTML-friendly SVG of the map.... we'll see how well this works, and how long it takes (I had to disable the ContextSwitchDeadlock warning so execution could exceed 60 seconds 😆 ).

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

Ok, so I gave up on building the SVG using est2-map about 10 minutes later.... there were some road coordinates that made zero sense (9.4E+11 in particular), so I turned it off until I can figure out the min and max coordinates of the map. I tried using Funbit's map capture mod, but I think I set the zoom level too large, as an hour and 1500 screenshots later, it still wasn't finished (and Funbit claimed it should take ~15-20 minutes), so I think that I didn't set something up correctly.


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 .config file? I have a feeling that it shouldn't take over 1.5 hours and 2500 screenshots to generate a printable map.

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

Do you have some experimental code that exports to SVG? Maybe you forked ets2-map repository and saved your changes to GitHub?

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. :-\

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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)

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

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:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <appSettings> <!-- safe margin that will be cut from the captured area to avoid caption truncation etc (pixels) --> <add key="SafeWidthMargin" value="186"/> <add key="SafeHeightMargin" value="48"/> <!-- size of the map canvas area (area with black background) (pixels) --> <add key="MapWidth" value="1920"/> <add key="MapHeight" value="952"/> <!-- vertical capture step in pixels --> <add key="VerticalStepWithMargin" value="984"/> <!-- number of screenshots to make in each axis (total = columns * rows), this depends on map size --> <add key="CaptureColumns" value="18"/> <!-- 17 --> <add key="CaptureRows" value="31" /> <!-- 30 --> <!-- path to FRAPS screenshot directory (set image format to BMP) --> <add key="ScreenshotPath" value="F:\screenshots"/> </appSettings> </configuration>

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

Cool! I started rewriting ets2-map code in Python, so that I could explore the data quickly and easily, but never finished it.

Also, I can't download the map:

Direct Access Denied

The page you attempted to load is not intended to be accessed directly.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

Try this link... this is the one on the forums: http://www.mediafire.com/view/b74886a33ip4fxq/map.png

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

Alternatively you can use this URL: https://app.box.com/s/wv331ke4zmabim6zumpp13c4qabiipu0

from ets2-mobile-route-advisor.

Funbit avatar Funbit commented on September 26, 2024

Great work @Koenvh1 !

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

Great work @denilsonsa . I am using slightly different coordinates:
(x, y, 7.278, 13164, 16260); (Also see https://github.com/Koenvh1/ets2-mobile-route-advisor/blob/promods/js/map.js and #85)

How did you slice it? I used gdal2tiles-leaflet, but that reverses the x and y.

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

How did you slice it?

I've described it at the commit message and also at README.md. 😃

By the way, you should consider writing down a README for your ETS2-City-Coordinate-Retriever. 😉

Try these in-game coordinates at coords.html:

  • -49800, -48440 → In your map, the position seems slightly down-right when compared to Funbit's map.
  • 41740, 17255 → Same here.
  • -30250, 7000 → Seems closer, but still slightly off. Maybe the multiplicative factor needs to be adjusted.

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).

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

@Koenvh1 One question: I noticed in the map.js for promods, all locations are assumed to be at 1:19 scale (every conversion uses the EU conversion, and the UK option is commented out). Did the ProMods team change the scale for UK? I haven't tested that area yet so I thought I'd ask first (plus I'm not home right now so I can't test it for a few hours 😆 )

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

@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.

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

dowmeister avatar dowmeister commented on September 26, 2024

@mike-koch @denilsonsa @Koenvh1 @Funbit
Guys, this thread is really interesting, i'm developer of Trucky ( https://truckyapp.com/ )
now with new Italy DLC i need to extract the whole new map to serve online on my app. I would build it with Leaflet.
I've tried Map Mod from Funbit but it seems not working with latest version, tried also ets2-map from nlhan's but got errors building PrefabNode objects.

There is a working way to extract the map with latest game version?

Whatever, awesome work!

Thank you!

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

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/
No idea what it is, how it works etc., but it might be worth contacting him.

from ets2-mobile-route-advisor.

dowmeister avatar dowmeister commented on September 26, 2024

If interested, github project with source code here https://github.com/shardick/ets2-map-settings-mod

from ets2-mobile-route-advisor.

mike-koch avatar mike-koch commented on September 26, 2024

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 😆

from ets2-mobile-route-advisor.

dowmeister avatar dowmeister commented on September 26, 2024

seems great, but why only 5 zoom levels? it's possible to have 8 levels?

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

dowmeister avatar dowmeister commented on September 26, 2024

yeah :D 6 :)

thanks, i will try

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

You can see it in action here: https://koenvh.gitlab.io/ets2-map/

from ets2-mobile-route-advisor.

denilsonsa avatar denilsonsa commented on September 26, 2024

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.)

from ets2-mobile-route-advisor.

Koenvh1 avatar Koenvh1 commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

meatlayer avatar meatlayer commented on September 26, 2024

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.

from ets2-mobile-route-advisor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.