Giter Club home page Giter Club logo

ts-map's Introduction

Euro Truck Simulator 2 / American Truck Simulator Map Renderer

This Application reads ATS/ETS2 files to draw roads, prefabs, map overlays, ferry lines and city names.

Preview of the map

Support for 1.48.5

Export Maps

Can now export maps as a tiled web map.

Example with a max zoom level of 4

Map mod support

It can now load map mods.

Making all/specific map mods supported won't be a priority for me.

Tested* map mods:

ETS2:

  • TruckersMP map edits (cd_changes & hq_final)
  • Promods Europe + Middle-East Add-On V2.60
  • Rusmap V1.8.1
  • The Great Steppe V1.2
  • Paris Rebuild V2.3
  • ScandinaviaMod V0.4
  • Emden V1.02c (Doesn't show city name)
  • Sardinia map V0.9 (Can't load some dds files)
  • PJ Indo Map v2.5 (Can't load an overlay)

ATS:

  • ProMods Canada V1.2.2
  • Coast to Coast V2.6 (Can't load some dds files)
  • US Expansion V2.4 (C2C Compatible)
  • CanaDream Open Beta (ATS 1.32)
  • Tonopah REBUILT V1.0.2
  • Mexico Extremo 2.0.5
  • Viva Mexico v2.4.8

* The tested mods load and get drawn but I haven't looked at anything specific so it's always possible there will be some items missing or things will get drawn that shouldn't.

Supported maps / DLC

  • ATS
    • All map DLCs up to and including Oklahoma.
  • ETS2
    • All map DLCs up to and including West Balkans.

Dependencies (NuGet)

Based on

Original project

ts-map's People

Contributors

dariowouters avatar jonashouben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts-map's Issues

Compatibility with 1.36 Open Beta (Corsica)

Hi,
i'm trying to open the map for ETS2 with 1.36 open beta but crashes on parsins TsRoadItem, TsTrigger and some prefabs.

There is any way to understand how make it compatible with latest version? If i can help actively, i can send a PR.

Thanks

Can't read game files of 1.50.

In new version of the games, the _hashHeader.Version change to 2, so the software can't access to SCS Files.

HashArchiveFile CLASS

if (_hashHeader.Version != SupportedHashVersion)
{
Logger.Instance.Error("Unsupported Hash Version");
return false;
}

Various errors generating tiles (develop branch)

Hi,
i'm having various and strange errors generating map tiles with different configurations, generating for ATS 1.36 (all dlcs):

  • Tile size 512 and map padding 400: randomly fires "Parameter not valid" in var bitmap = new Bitmap(tileSize, tileSize); (TsMapCanvas.cs line 91)
  • Tile size 256 and map padding 500: "Generic Error in GDI+" at bitmap.Save($"{exportPath}/Tiles/{z}/{x}/{y}.png", ImageFormat.Png); (TsMapCanvas.cs line 98), example Tiles\8\15 tile 1 . Generated tile remain corrupted

image

Master branch, instead, no errors.

(as usual, great job!)

DLC Guards for Kansas

Here they are :)

            new DlcGuard("dlc_ks", 28),
             new DlcGuard("dlc_ks_and_ko", 29),
             new DlcGuard("dlc_ks_and_ok", 30),

Support for Texas

Hey Dario,

i've found a null reference exception in

Line 261 - TsPrefabItem.cs

           var rot = (float)(originNode.Rotation - Math.PI -
                Math.Atan2(mapPointOrigin.RotZ, mapPointOrigin.RotX) + Math.PI / 2);

and also many warnings about items not found

[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Building in sec-0004+0013.base @ 2010
[9:13:30 PM|Warning] [TsSector.cs::Parse] File 'sec-0004+0013.base' from 'D:\SteamLibrary\steamapps\common\American Truck Simulator\dlc_tx.scs' was not read correctly. Read offset was at 0xD7A23A52 while file is 0x7567C bytes long.
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Curve in sec-0004+0014.base @ 23090
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Curve in sec-0004+0014.base @ 23090
[9:13:30 PM|Warning] [TsSector.cs::Parse] Unknown Type: Curve in sec-0004+0014.base @ 23090

Hope this helps

Thank you in advance as usual.

Questions: About SCS Hash system.

Hi.

I'm working on total refactoring of this project.

And, I need some light on the Scs Hash system.

  • That I know : All *.scs files are an archive.
  • Some files can be compressed

When the TsMap uncompress a file, it use the Dotnet Zip package..

Q1: Do you know if a compressed SCS file have a specific compression system?

Q2: If Q1 are yes, can you tell me if another lib can uncompresse the file AND if this lib are thread-safe?

My project is based on Threads. And, sometimes, I've got crash. It's may due to the Zlib include on the DotNetZip package.

I've been located the place where this lib was used, and I don't yet find a way to use another system.

return ZlibStream.UncompressBuffer(buff);

Q3: If you can give me somes explanation on the hash process, there will help me ^^.

Thanks you so much for all answers who can give me.

1.45 beta problem?

I don't know C language, so I can only say for you the program is not working/compiling...
I've successfully compiled and used the current program with game version 1.44, but it doesn't run with 1.45 beta.

where is the exe

I downloaded this and there seems to be no .exe file how do i run this???

Access violation ETS2 1.36 + Black Sea

With ETS2 1.36 and Black Sea DLC, it fires Access Memory violation exception,

Loaded all .scs files in 1170ms
Loaded city files in 311ms
Loaded prefab files in 1002ms
Loaded road files in 20ms
Loaded ferry files in 8ms
Loaded overlay files in 603ms
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Unknown Type: 1316166 in sec+0010+0005.base @ 3213243
Exception thrown: 'System.AccessViolationException' in TsMap.dll
An unhandled exception of type 'System.AccessViolationException' occurred in TsMap.dll
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Tiles aliased or lower quality than before

Generating tiles using the develop branch, tiles look aliased or generated with a lower quality than before.

Before:
image

Now:
image

Not sure is a bug but now looks different and not really good looking.

Iberia DLC is not showing correctly on map

Hi.
On the latest commit, Iberia doesn't generate properly both when viewing using the canvas program and when exporting as png.

Remembered I was on 1.39 and after upgrading to 1.40 it did work.

Feature request: more items on map (bus stops)

What a fun and interesting project this is! I have a lot of admiration for those who make this, so first of all thank you for all the effort.

Now why I write. Would it be possible that someone can help guide how extra objects (assets) can be displayed on the map. I'm looking for a way to see bus stops in the world with an icon (just like petrol stations). The bus stops are objects (or prefabs in case of terminals), does anyone have the time and desire to help?

Support for 1.43

Thank you for the great project. I noticed that the map tile generation does not seem to work properly on 1.43. A few exceptions I came across:

  • Prefab originNode is sometimes null
  • Ferryline curve runs out of memory
  • mapAreas list is empty

Seems like 1.43 introduces a slightly different map format. Strangely enough the map preview loads as it should.

How to run it?

I've seen that the program requires some files but I don't know exactly which one and how to get them.
Also, does it works with the new Italia DLC?

Promods 2.50 not captured completely

Hi,
i have a problem with Promods 2.50 as it's not captured completely.

image

Missing Bosnia, Montenegro and Croatia and also Cyprus that was present in 2.46.

Load order:

image

I'm missing something?

Output log:

Loaded all .scs files in 1578ms
Loaded city files in 1289ms
Loaded prefab files in 2822ms
Loaded road files in 108ms
Loaded ferry files in 14ms
Invalid DDS file (size), 'material/ui/company/small/toom.dds'
Map Overlay file not found, C:/Users/Edvinas/Desktop/New folder/usb.dds
Loaded overlay files in 1569ms
Could not find City: 'gdyne'(1F21FC1), in sec+0007-0006.base @ 42948
Could not find City: ''(0), in sec+0027+0024.base @ 35763
Could not find City: ''(0), in sec+0027+0024.base @ 35925
It took 1576 ms to parse all (*.base) map files and 16323 ms total.
Could not find lane count for (4, 5), defaulting to 1 for prefab2/gas_station/gas_station_car_01_blke.ppd
Could not find lane count for (4, 5), defaulting to 1 for prefab2/gas_station/gas_station_car_01_blke.ppd
Could not find lane count for (4, 5), defaulting to 1 for prefab2/gas_station/gas_station_car_01_blke.ppd
....

Thanks in advance

Get a node graph from TsRoadItem and TsPrefab

I am working on a project that calculates the path from a to b and i am looking to create node graph from TsRoadItem and prefabs to run algorithms like Dijkstra. Are there any conections between node and how can i implements this?

Any advice are welcome

Memory Leaks when running or trying to Generate Tile Map

Sometimes when just dragging around the generated map, I get a crash with error System out of memory on the Memory Chart, it constantly just keeps increasing from the second the project is running.

Video here

Any suggestions on how I can get this running?

`EDIT:

Print out of the exception;

System.OutOfMemoryException
  HResult=0x8007000E
  Message=Out of memory.
  Source=System.Drawing
  StackTrace:
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.DrawCurve(Pen pen, PointF[] points)
   at TsMap.TsMapRenderer.Render(Graphics g, Rectangle clip, Single scale, PointF startPoint, MapPalette palette, RenderFlags renderFlags) in C:\Users\kangw\Documents\ts-map\TsMap\TsMapRenderer.cs:line 374
   at TsMap.Canvas.TsMapCanvas.SaveTileImage(Int32 z, Int32 x, Int32 y, PointF pos, Single zoom, String exportPath) in C:\Users\kangw\Documents\ts-map\TsMap.Canvas\TsMapCanvas.cs:line 100
   at TsMap.Canvas.TsMapCanvas.GenerateTileMap(Int32 zoomLevel, String exportPath) in C:\Users\kangw\Documents\ts-map\TsMap.Canvas\TsMapCanvas.cs:line 139
   at TsMap.Canvas.TsMapCanvas.<GenerateTileMapToolStripMenuItem_Click>b__25_0(Int32 zoomLevel) in C:\Users\kangw\Documents\ts-map\TsMap.Canvas\TsMapCanvas.cs:line 215
   at TsMap.Canvas.TileMapGeneratorForm.GenerateBtn_Click(Object sender, EventArgs e) in C:\Users\kangw\Documents\ts-map\TsMap.Canvas\TileMapGeneratorForm.cs:line 18
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at TsMap.Canvas.Program.Main() in C:\Users\kangw\Documents\ts-map\TsMap.Canvas\Program.cs:line 16

  This exception was originally thrown at this call stack:
    [External Code]
    TsMap.TsMapRenderer.Render(System.Drawing.Graphics, System.Drawing.Rectangle, float, System.Drawing.PointF, TsMap.MapPalette, TsMap.RenderFlags) in TsMapRenderer.cs
    TsMap.Canvas.TsMapCanvas.SaveTileImage(int, int, int, System.Drawing.PointF, float, string) in TsMapCanvas.cs
    TsMap.Canvas.TsMapCanvas.GenerateTileMap(int, string) in TsMapCanvas.cs
    TsMap.Canvas.TsMapCanvas.GenerateTileMapToolStripMenuItem_Click.AnonymousMethod__25_0(int) in TsMapCanvas.cs
    TsMap.Canvas.TileMapGeneratorForm.GenerateBtn_Click(object, System.EventArgs) in TileMapGeneratorForm.cs
    [External Code]
    TsMap.Canvas.Program.Main() in Program.cs

Support 1.48 [not an issue]

Easy change for 1.48 and Oaklahoma DLC:

new DlcGuard("dlc_ok", 25),
new DlcGuard("dlc_ok_and_co", 26),
new DlcGuard("dlc_ok_and_nm", 26),
new DlcGuard("dlc_ok_and_tx", 27),
new DlcGuard("dlc_ks", 28),

Support for 1.48.5 + West Balkans DLC

Hey Dario,
hope you are good.

Application crashes on parsing 1.48.5 files - Tested on master and develop, with ETS2 with West Balkans DLC

seems the Sector.Version of TsCompanyItem is 900

For your information, if this could spare some time, the new DLCGuards are

 new DlcGuard("dlc_blkw", 16, false),
 new DlcGuard("dlc_blkw_and_east", 17, false),
 new DlcGuard("dlc_blkw_and_blke", 18, false),
 new DlcGuard("dlc_feldbinder", 19, false)

and for ATS + Oklahoma:

new DlcGuard("dlc_ok", 25),
new DlcGuard("dlc_ok_and_co", 26),
new DlcGuard("dlc_ok_and_nm", 26),
new DlcGuard("dlc_ok_and_tx", 27),
new DlcGuard("dlc_ks", 28),

How fix this? what is the magic behind it? :)

Thanks

Where I need to go to find the location of useful informations in binary files (prefabs/roads)?

Every information that is used by this tool is extracted from lots of binary files (.base for roads, .ppd for prefabs...) and for analyzing them the program uses some addresses (like 0x20 or something similar) which say the location on file of some variables. This means that you need to know the structure of these files (for finding the right variable), so how did you get the structure of them? Is there any wiki or documentation about that?

Christmas 2023 Event Map not rendered

The map sections for the christmas 2023 event is not rendered for ETS2 (probable also not in ATS).

The section is South-West of portugal (way off the base map).

It's part of the DLC Guard None (0).

Some clarifications about TsRoadSideItems

I've done some research on TsRoadSideItems and I've found some interesting things. Maybe these could be useless in project and will slow down the entire program but I propose you to put them in the associated template file for 010 Editor.

First of all, if you want to run all these stuff you need to add in the ScsHash.cs file the function that permits to convert a token to a string.

Template contains a 72 byte array called as padding actually contains data. If the item is a road sign for navigation like the one in the picture below, there will be some text and pictures for destinations that can be showed as a .dds file contained in /material/overlay. The name of the files can be found (encoded) inside 9 unsigned quad variables that decoded using the TokenToString function previously mentioned return the name of the files ( prefix city_ or road_ must be added before name depending to the index of variable. The structure of those variables is:

  • first sign
    • 8 byte number (road icon)
    • 8 byte number (primary road destination - as text)
    • 8 byte number (secondary road destination - as text)
  • second sign
    • 8 byte number (road icon)
    • 8 byte number (primary road destination - as text)
    • 8 byte number (secondary road destination - as text)
  • third sign
    • 8 byte number (road icon)
    • 8 byte number (primary road destination - as text)
    • 8 byte number (secondary road destination - as text)

immagine

Next, in the same template there's a variable called m_some_model_id which, if encoded with the same function as before, contains the unit name of the sign, without the prefix sign.. This can be used in /def/world/sign.sii for getting the relative information.

And, the variable called m_some_uid contains the same uid that the item's relative node has. It is strange because it hasn't any sense, but it's there.

Support for 1.47

When using ts-map with ETS2 1.47 some of the map overlays are incorrectly assigned. It looks like SCS has changed the bit positions/definitions of the map overlay flags (core_map_version: 898). In the values below byte 3 is on the left and byte 0 is on the right.

Here is how the flags were defined prior to 1.47:

0x0000_0001 = Hide for zoom level 0
0x0000_0002 = Hide for zoom level 1
0x0000_0004 = Hide for zoom level 2
0x0000_0008 = Hide for zoom level 3
0x0000_0010 = Hide for zoom level 4
0x0000_0020 = Hide for zoom level 5
0x0000_0040 = Hide for zoom level 6
0x0000_0080 = Hide for zoom level 7
0x0000_FF00 = DLC guard field
0x0001_0000 = Parking type
0x0002_0000 = City name type
0x0004_0000 = User text type
0x0008_0000 = Secret overlay
0x0010_0000 = Landmark type

And here is how the flags appear to be defined starting with 1.47:

0x0000_0007 = Type field:
  0x0000_0000 = Road
  0x0000_0001 = Parking
  0x0000_0002 = City name
  0x0000_0003 = User text
  0x0000_0004 = Landmark
0x0000_FF00 = DLC guard field
0x0001_0000 = Secret overlay
0x0002_0000 = Hide for zoom level 0
0x0004_0000 = Hide for zoom level 1
0x0008_0000 = Hide for zoom level 2
0x0010_0000 = Hide for zoom level 3
0x0020_0000 = Hide for zoom level 4
0x0040_0000 = Hide for zoom level 5
0x0080_0000 = Hide for zoom level 6
0x0100_0000 = Hide for zoom level 7

(Values obtained through experimentation and observation)

Problem on place for landmark icon

With our latest version, I think there are a little problem on the place for landmark icon

As you can see, the landmark icon is placed nowhere.

image

I use the latest version of ETS (1.46).

Issue while converting values from game coords to pixels

Hello,
I have 256px * 256px ETS TileMap which is displayed in Leaflet.js.
I generated the map with ts-map.

To calculate the coordiantes i use this function:

const calculateCoords = (gameX:number, gameY:number) => 
    {
        const x1:number = tileInfo.x1;
        const x2:number = tileInfo.x2;
        const y1:number = tileInfo.y1;
        const y2:number = tileInfo.y2;
        
        const MAX_X:number = 256 * 256;
        const MAX_Y:number = 256 * 256;

        const xtot = x2 - x1; // Total X length
            const ytot = y2 - y1; // Total Y length

            const xrel = (gameX - x1) / xtot; // The fraction where the X is (between 0 and 1, 0 being fully left, 1 being fully right)
            const yrel = (gameY - y1) / ytot; // The fraction where the Y is

        setPosition([xrel * MAX_X, (yrel*MAX_Y)]);
    }

The problem is, that the my map is 256px but the calculated values are much to big.
When i use a correction Value which i calculate with 256/MAX_X the marker is on the map.
In this case the X value is correct, but the y value is not right.
The marker on the map is is displayed is unter the position i want to target.

Have anyone a solution to calculate the positions correctly or can anyone find the bug in my code ?

Thanks

Canvas area to image file

You consider the possibility to add function in canvas area to save full map in a bitmap file .png ?
By add an appropriate button on form and the ability to select zoom/scope and image resolution when saving.

Reading navigation data (.navcache)

Hey there! I'm currently working on a ETS map viewer and your ts-map project has been really helpful so far, thanks a lot for this.

I would like to add navigation / route generation to my map, but that's easier said than done. One way of doing this would be to export the roads and prefabs so that I can run some sort of algorithm to generate a route, but I have absolutely no idea how I should do that. Another way would be to work with the navigation cache of ETS2. Unfortunately the .navcache format is not documented anywhere.

I've tried to reverse engineer the format myself, but I'm already stuck. I've only been able to decipher the first part of what I assume to be the header (4 bytes magic value (NAVC) followed by 4 bytes version (0x01)).

It seems like you have a bit more experience with reverse engineering file formats than I do judging by this repository. Would you be able to help with this? I understand if that's completely out of scope.

The navigation cache can be found in Documents\Euro Truck Simulator 2\cache\<profile id>.navcache. I can send you my own navcache if needed.

Thank you!

Question: How you set the value "itemDrawMargin" of TsMapRenderer.cs ?

Hi,

I'm work on a rework. It's on the good way.

But currently, I've an issue with the road rendering.
All roads seems not be drawn.

In my investigation, I've change the value of this

private const float itemDrawMargin = 1000f;

For example, if I set to 2000f, some roads appears.

I think all road was not returned to list from this place

var roads = _mapper.Roads.Where(item =>

Can you tell me more about it ? How you're set this value ?

Thanks a lot.

How to read sector file (*.base) as String?

I know that the program reads the information from the sector files directly, and only certain information that it requires.

But I would like to know if there is any way to get the entire .base file in String format.

This can be done directly from the map editor with the command: edit_save_text

And the files are stored as follows:

imagen

But not all users know how to use the map editor, so I would like to know if the Sector.Stream can be read or converted to String format.

Prefab polygons drawn with wrong z-index

It looks like there's an issue with some prefab polys not rendering correctly. In the ATS map editor, near Truckee, California I see:

image

But in ts-map, I see:

image

I think it has something to do with this ZIndex assignment:

if ((colorFlag & 0x02) != 0) fillColor = palette.PrefabLight;
else if ((colorFlag & 0x04) != 0) fillColor = palette.PrefabDark;
else if ((colorFlag & 0x08) != 0) fillColor = palette.PrefabGreen;
// else fillColor = _palette.Error; // Unknown

var prefabLook = new TsPrefabPolyLook(polyPoints.Values.ToList())
{
    ZIndex = ((colorFlag & 0x01) != 0) ? 3 : 2,  // <= incorrect?

Possible fixes might be:

    // assumes PrefabLight is always the "background" of a prefab area
    ZIndex = (fillColor == palette.PrefabLight) ? 2 : 3, 

or maybe

    // this check matches the explicit fillColor assignment in line 213
    ZIndex = ((colorFlag & 0x02) != 0) ? 2 : 3, 

Either of those changes leads to ts-map rendering:

image

Hope this helps!

Lastly: I discovered ts-map while doing some research for my own mapping project. ts-map is amazing; the code and the docs folder have been a very valuable reference. Thanks for you time and effort working on it!

Compile Issue

Hello,

I complied the source as release but I get the following issue:

image

Import TruckersMP Mods file

Hi,

as always, thanks for your great work and dedication.

i know is a strange request but i'm trying to import the TruckersMP Mods Files.

Looks like the .mp files are loaded correctly and ts-map can look into them but then the modifications should be appplied arent visibile.
Here attached: mpdata.zip

Originally the files are here: C:\ProgramData\TruckersMP\data\ets2\mods

The game actually load them.

They added a new company and a road from Wroclaw:

image

Hope you can give me some advice to read them correctly and show on the map.

Thanks

Issue when generating tiles with ProMods 2.70

Using ProMods 2.70 (with ETS2 1.50), and ProMods TCP 1.50, ts-map built on Visual Studio 2022 using develop branch.

If the max tile depth is set to >= 4, ts-map will not generate any tiles at greater depth than 4, and reports having completed successfully.

During tile generation, it (correctly, I believe based on the high value) shows the total number of tiles to generate, but stops at roughly 160 (a depth max of 4).

The problem can be circumvented I believe by generating twice, 0 -> 4 depth, and 5 -> 8 depth. I've been using the tiles (combined, with the json info file correctly edited) with JAGFx.

Possible issue with some of the tiles at a zoomed out level (3 or 4, maybe) not displaying on the map widget of the tool above - but haven't yet conclusively proven what the reason for this is.

I'll update the issue if I discover anything else - if there's any testing I can help with to identify the source of the issue, feel free to ask! Thanks in advance if you get a chance to look this over.

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.