dariowouters / ts-map

ATS/ETS2 map renderer
MIT License
85 stars 28 forks source link

Promods 2.50 not captured completely #15

Closed dowmeister closed 2 years ago

dowmeister commented 4 years ago

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

dowmeister commented 4 years ago

Thanks! it works!

It's possible to read documentation how you do this magic, like a troubleshooting and an explanation how to dig into game files to make me independent (and overall, understand how really works)

Thanks again

dariowouters commented 4 years ago

Well for this issue specifically it was easy once I saw that it didn't load any of the main ProMods map, so I checked the amount of "entries" it found in the 'promods-map-v250.scs' (a zip) file, and the result was negative so it was either reading the entry count in the zip file at wrong file offset or I used the wrong value type, which was the case.

On how to update this for game updates and when the map files (.base and .aux) change version, which is currently 880 (first uint32 of the .base or .aux file).

(The .base files are located in the '/map/europe/' or '/map/usa/' folders, which is located in the 'base.scs' file, which you can extract with the scs_extractor)

Every (major) game update I check if that version number has changed, if it hasn't then everything should still work. If it did change I run the program to see if it crashes/logs any errors, also a good idea to check the modding guides SCS releases as those can contain an indication of what exactly could have changed.

The log then might show something about an unknown type and in what file and at what offset, I then open that .base file in 010 editor and run the .base template for the latest version. (templates for 875 still work for the current 880 files)

I will then go to the last item that is found correctly. (start of an item is indicated with the item type number having a blue background) In this case the last found item is 0x24 which is a road side item (a road sign) image

I generally go to that item (search for the UID) in the in-game map editor, copy the item and paste in a new and empty map then save it and load the new .base file so it only has the specific item in it.

Now there is an easier way to do the next part, explained in here.

But personally I enjoy going through the hex file and figuring things out this way:

It depends on a lot of different things on how to figure it out, sometimes it's obvious because they just added an extra field in the item properties where I can just change that value to something obvious like 123 in the properties, save the map and find the 123 in the hex editor and add it to the template and rerun it to check if anything else needs changing.

Sometimes it's a little less obvious, then I go through the file in the hex editor and check if all the existing values are all still in the correct place, if not I add padding in the template in between to make it so the known values are in the correct place. I just keep the new values as padding if I can't figure out what the value means, Rerun the template to make sure it reaches the end without problems.

That obviously doesn't always work especially when it's something with a variable length like arrays or strings, then I create multiple items of the same type with different properties and compare them to find a pattern. (This was a very common problem when I started working on the file structure, but this happens less and less with now knowing most of the structures)

If that worked then I rerun the template on the original .base file to see if it loads the whole file without problems. If that is the case then I make the changes (like add the extra offsets) in the program to reflect the template. Run the program and repeat the steps for any other problems.

DubStepMad commented 4 years ago

@shardick @dariowouters

Mind giving me a hand with the promods map.

If you have a look here: https://github.com/dariowouters/ts-map/issues/12 you can see that the map doesn't display correctly.

However I do no have the promods-me-defmap and promods-me-assets like you as I did not get these in the file I downloaded.

Edit

I do now have the missing file extras and the issue still persists.

dowmeister commented 4 years ago

hey @DubStepMad :) nice to see you here. I'm dowmeister from Trucky (shardick is my old github username).

I'm able to capture promods correctly as you can see on web.truckyapp.com/map or there are issue I can't see also in my app?

DubStepMad commented 4 years ago

@shardick ah hey dowmeister, yeah just looking into it for legacy and myself as we do need to get the updated map images containing promods.

Just downloaded promods and installed it today so not sure on the issue I am having within the map having dodgy roads as seen in the mentioned issue.