nlhans / ets2-map

Map of ETS2
MIT License
14 stars 5 forks source link

gas_station.ppd Roads Not Appearing in Output #2

Open mike-koch opened 8 years ago

mike-koch commented 8 years ago

I noticed that one of the gas station prefabs, gas_station.ppd in particular, is not displaying on the rendered map. It looks like since there are no AI curves/paths through the prefab, the current logic does not recognize any curves, and does not display the prefab on the screen (I'm still slowly trying to parse through all of the logic :laughing: to figure out how all of this works). It looks like the prefab has has two nodes, both with X, Y, and Z positions; however I'm not sure how they tie in with the rest of the road. Are there other possible properties that can be used to build a suitable roadway for this prefab?

It also looks like company roadways / lots are also not appearing, which I am assuming is due to the same thing (no AI curves stored in the prefab).

Here's a screenshot of what I tried to explain above :smile:

screen shot 2016-02-01 at 9 33 08 pm

nlhans commented 8 years ago

Thanks for taking the time to set-up this project, as in it's current state that was not trivial.

Yes I have seen this too during my testing on 1.19 a while back. Most fuel stations don't render. I am not sure exactly why anymore, it's a little while back since I've actively worked on this code. Yes some code files require some refactoring and structuring, but I just wanted to get some basic working code out there while trying to figure out which bytes are what using the world editor :)

From the world editor I deducted 2 things: 1) A node is a location on the map. Each has a forward/backward item ID. 2) An item is often a road or other object that goes A>B. I think SCS aimed at storing roads efficiently in this map. Almost all items have start/end node ID's, which is very efficient for roads because you can follow along a path of UID's like Item UID -> End Node -> Forward Item UID -> End Node, etc. This is 1 reason why prefabs are currently not always rendered properly.. the map renderer actually follows these roads so it isn't busy rendering roads off-screen. Prefabs seem a bit more complicated, because they store more info about e.g. multiple node ID's (a cross junction can have 4 roads connected to it), or a company prefab having multiple trailer locations. I also haven't figured out how to grab the dimensions of a company from the map files. This is also why company prefabs are not rendered. I also wanted to look into adding fuel & rest stop icons on the map etc., but since then I've been really busy at work.

mike-koch commented 8 years ago

Yeah, companies were something else I noticed were missing. Ideally, it would be nice to know exactly how ETS2/ATS generates the in-game map, since that (to me) would be the ideal solution. However, I doubt SCS will tell us how to pull that information :laughing: .

Also, I just noticed that there is some navigation capabilities. Nice!