Vishnu Posted March 2, 2022 Posted March 2, 2022 Hey guys, this has been bothering me for a long time. I exclusively use PWCG, and have various mods activated. Whenever I do a train and faculties mission, the locomotive is spawned but its usually perpendicular to the tracks, and off of the station. As well, the cars that are supposed to be attached are not there or are invisible. Also, there are no trains running on tracks outside of town, if on a hunt mission. I'm just wondering if anybody else has experienced this, and if so, which mod is causing it? Any solutions would be appreciated. Vish
Stonehouse Posted March 2, 2022 Posted March 2, 2022 Have you tried rerunning the mission without mods? I've seen the issue before several times and have just avoided train attack missions but kept forgetting to try one mods off to confirm whether it is a mod causing the issue. I'm not sure it is.
FodderMonkey Posted March 3, 2022 Posted March 3, 2022 It's been an issue for some months now, I think since the big cloud update the dev's did that upped the graphics demands. I'm pretty sure I've seen it off and on running the "career" mode, so I don't think it has anything to do with PWCG.
PatrickAWlson Posted March 3, 2022 Posted March 3, 2022 Awhile back I verified that the trains were at the same position as the station. That was always how it was done. If there is a new way to do it I am not aware. 1 1
Stonehouse Posted March 3, 2022 Posted March 3, 2022 (edited) Don't think it is PWCG Patrick. Might be a mod perhaps although someone has just posted in the mission making and mission editor sub forum that they cannot get a train to align with the track when building a mission from scratch (I think that is what they are saying anyway) so my general unsubstantiated feeling is it is probably not mods since it is apparently not specific to a map - ie if I had a Bodenplatte map mod and trains never worked on this map but did on others I'd think the mod was the problem but it seems to happen on different maps. Maybe something changed along the way in the game? <edit> rereading the mission editing sub forum post it seems like the issue is sporadic and happens only sometimes? I did try to look a quick mission after the new AQMG was added but I don't know enough about mission editing to tell anything beyond it seemed like the AQMG puts the trains directly on the track and I definitely don't know enough to build a sample mission from scratch to try to prove something has changed. It was a moving train in the AQMG mission not stationary like PWCG targets anyway which could make a big difference My post from Dec last year https://forum.il2sturmovik.com/topic/61145-new-pwcg-issues-thread/?do=findComment&comment=1152575 mission editing sub forum post Train not aligned issue - Mission Making and Mission Editor - IL-2 Sturmovik Forum (il2sturmovik.com) Edited March 3, 2022 by Stonehouse 2
Stonehouse Posted March 4, 2022 Posted March 4, 2022 (edited) @PatrickAWlson Perhaps of interest to you Patrick although not sure what you can do about it if this is indeed the problem for trains in PWCG. See Beebop's last post in thread below about map object hit boxes - it resolved the train alignment issue being discussed it appears. Perhaps buildings also cause the same problem as trees as described in the post. https://forum.il2sturmovik.com/topic/77517-train-not-aligned-issue/?do=findComment&comment=1171462 Edited March 4, 2022 by Stonehouse 1
Vishnu Posted March 4, 2022 Author Posted March 4, 2022 (edited) Here’s a photo Pat. I started the same thread in MODS, because I thought, perhaps it could be a mod. I disabled all gunnery mods and still got the train as in this picture. Note it’s only the locomotive and no cars. As well no buildings were visible (perhaps because I had structures on low?) Edited March 4, 2022 by Vishnu
Nocke Posted April 18, 2022 Posted April 18, 2022 Just made a short experiment with one of these missions where the train is off the tracks: Just moving its position from where it is in the mission editor directly onto the track puts it correctly aligned onto the tracks in game. Now I do not know how close they need to be, but it seems their positioning in the ME is just a bit off. Going to investigate a little further. A picture tells more: I just moved the timers away to show the locomotive, this is the position as set by PWCG. Like this, the train spawns off the tracks. After moving the locomotive onto the tracks, the train spawns correctly aligned on the tracks. 1
PatrickAWlson Posted April 18, 2022 Posted April 18, 2022 @216th_Nocke Appreciate the assistance. What I had been doing for a very long time is putting the train at the same location as the rail station. It worked until it didn't. Since PWCG is software, it needs very clear rules as to what to do. At the moment it has no idea where train tracks are, only train stations.
Nocke Posted April 18, 2022 Posted April 18, 2022 One can unpack the Map.gtp and find therein the railroad coordinates for all maps in a file called railroad.ini. From there one could search from any railway station the closest intersection with a railway. 1
PatrickAWlson Posted April 19, 2022 Posted April 19, 2022 On 4/18/2022 at 2:41 PM, 216th_Nocke said: One can unpack the Map.gtp and find therein the railroad coordinates for all maps in a file called railroad.ini. From there one could search from any railway station the closest intersection with a railway. Any hints on how to unpack that file? Also, any idea which file correlates to which map? The second question is convenience as I can probably figure it out on my own.
Stonehouse Posted April 19, 2022 Posted April 19, 2022 (edited) 57 minutes ago, PatrickAWlson said: Any hints on how to unpack that file? Also, any idea which file correlates to which map? The second question is convenience as I can probably figure it out on my own. Hi Pat, You need to unGTP the gtp files. Attached is the unGTP tool I use, to use I open an Windows Explorer window with the unGTP.exe showing and another window with the gtp files showing. Drag and drop the gtp file you want to unpack onto the unGTP exe and a dos box will open showing the files being unpacked. It will eventually stop with a message which you can ignore. Close the dos box. Navigate to the data folder in your Il2 install and you will see a new folder "(null)" has been created in it. If you look in there you'll see the unpacked files. Doubt that it matters but I keep unGTP located in a folder in the IL2 game folder. Example of unpacked folders and files below where I have unpacked graphics1.gtp, graphics2.gtp, graphics3.gtp. You can unpack multiple gtp files without cleaning up the (null) folder. Be aware though that you can quickly create several GBs of data. The (null) folder being present has no impact to the game running and when you no longer need the info just delete the (null) folder PS I believe you will find that there are multiple maps per gtp file and that there is a folder per map/season and the railroads.ini file lives in the roads folder for each map/season. I don't know why there would be a difference in rails system seasonally and perhaps the file is just duplicated because that is how the map processing code expects to find it. FYI in case it is of use to you there is a similar roads.ini too. unGTP-IL2.zip Edited April 19, 2022 by Stonehouse
Nocke Posted April 20, 2022 Posted April 20, 2022 b.t.w. it took me a while to figure out how the coordinates in railroads.ini transform to the coordinates used in the mission editor: In the file roadsystems.ini you can find for each map the values Map_Width, Map_Height, and Map_Scale_Factor. If you read the coordinate pairs from railroads.ini as xr/yr, they transform to coordinates xe and ze in the editor like this: xe=(Map_Height-yr)*Map_Scale_Factor, ze=xr*Map_Scale_Factor. And, maybe a matter of taste, but I personally would not unpack into the game directory, you can do that anywhere. Another point: the game uses the points given in that file to do spline interpolation to draw the tracks.
PatrickAWlson Posted April 22, 2022 Posted April 22, 2022 On 4/20/2022 at 8:04 AM, 216th_Nocke said: b.t.w. it took me a while to figure out how the coordinates in railroads.ini transform to the coordinates used in the mission editor: In the file roadsystems.ini you can find for each map the values Map_Width, Map_Height, and Map_Scale_Factor. If you read the coordinate pairs from railroads.ini as xr/yr, they transform to coordinates xe and ze in the editor like this: xe=(Map_Height-yr)*Map_Scale_Factor, ze=xr*Map_Scale_Factor. And, maybe a matter of taste, but I personally would not unpack into the game directory, you can do that anywhere. Another point: the game uses the points given in that file to do spline interpolation to draw the tracks. Thanks for that. B = ? ... bridge?
PatrickAWlson Posted April 23, 2022 Posted April 23, 2022 Trains are back on the tracks ... sometimes. When I did my initial debugging it looked like the train locations resolved to the stations. However, on further examination there was a difference of 25-50 meters. Looks like using the rail positions in the files resolved the problem. The down side is that one train was on a road. Rail and road positions are in two separate files and I am not mixing them, so some of the rail data is less than perfect. @216th_Nocke Do you know what a block of positions (basically a single line) is? I thought that each block of positions might be a rail line, but the distance of the one I was working with is only a few hundred meters at most. 1
Nocke Posted April 23, 2022 Posted April 23, 2022 The problem may be in using linear interpolation between coordinate pairs in the file, the game is doing spline interpolation between these points to draw the tracks. My idea had been to use splines, evaluate them at a given constant interval, like e.g. every 10m, put the resulting cloud of points into a kd-tree and use that to find the closest point from a station. Unfortunately I have never programmed anything in Java, I was thinking about doing this in a Python script to postprocess PWCG missions.
coconut Posted April 23, 2022 Posted April 23, 2022 On 4/20/2022 at 2:04 PM, 216th_Nocke said: b.t.w. it took me a while to figure out how the coordinates in railroads.ini transform to the coordinates used in the mission editor: In the file roadsystems.ini you can find for each map the values Map_Width, Map_Height, and Map_Scale_Factor. If you read the coordinate pairs from railroads.ini as xr/yr, they transform to coordinates xe and ze in the editor like this: xe=(Map_Height-yr)*Map_Scale_Factor, ze=xr*Map_Scale_Factor. And, maybe a matter of taste, but I personally would not unpack into the game directory, you can do that anywhere. Another point: the game uses the points given in that file to do spline interpolation to draw the tracks. @216th_Nocke, your formula is quite close to the one I'm using, see https://github.com/deneuxj/SturmovikCampaign/blob/master/RoadExtractor/Program.fs#L66 and https://github.com/deneuxj/SturmovikCampaign/blob/master/RoadExtractor/Program.fs#L82 // Transformation to apply to each coordinate component let truncateAndScale x = floor(x / parseStep) * parseStep * float32 scaleFactor fun (x, y) -> truncateAndScale (mapHeight - y), truncateAndScale x The missing truncating might explain the 25-50 meters error that @PatrickAWlson is seeing.
Vishnu Posted April 23, 2022 Author Posted April 23, 2022 I admire the dedication and persistence to solving this problem. Thank you gentlemen. 2
PatrickAWlson Posted April 23, 2022 Posted April 23, 2022 3 hours ago, coconut said: @216th_Nocke, your formula is quite close to the one I'm using, see https://github.com/deneuxj/SturmovikCampaign/blob/master/RoadExtractor/Program.fs#L66 and https://github.com/deneuxj/SturmovikCampaign/blob/master/RoadExtractor/Program.fs#L82 // Transformation to apply to each coordinate component let truncateAndScale x = floor(x / parseStep) * parseStep * float32 scaleFactor fun (x, y) -> truncateAndScale (mapHeight - y), truncateAndScale x The missing truncating might explain the 25-50 meters error that @PatrickAWlson is seeing. I round to the third decimal place. I think the distance is a real thing. The station is at one place and the actual tracks are 25-50 meters away. Putting the train at the station used to work. Something changed in the code that made that less forgiving, and now you have to get it much closer to the actual track. Still curious about what each set, delimited by a newline, represents. I thought it would be a length of track, but it seems too short.
Nocke Posted April 23, 2022 Posted April 23, 2022 I believe it is the parts of tracks between end/startpoints and/or ramifications. At least as far as checked it is. They do not need a lot of points because they are just the support points for the splines describing the actual track.
No105_Swoose Posted April 24, 2022 Posted April 24, 2022 This is a fascinating thread and has given me new insights into the detailed coding and algorithms behind the curtain that make PWCG such a fantastic program. I hope it will lead to seeing trains running on open tracks in the countryside on the Bodenplatte map instead of just locomotives and tenders stationary under railway station sheds in towns. 1
PatrickAWlson Posted April 24, 2022 Posted April 24, 2022 3 hours ago, No105_Swoose said: This is a fascinating thread and has given me new insights into the detailed coding and algorithms behind the curtain that make PWCG such a fantastic program. I hope it will lead to seeing trains running on open tracks in the countryside on the Bodenplatte map instead of just locomotives and tenders stationary under railway station sheds in towns. They do run when they are actually on tracks. I am using Kuban for testing at the moment, and about 2/3 to 3/4 of the trains are positioned properly. 1 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now