Jump to content

Recommended Posts

Posted

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

Posted

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

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

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.

  • Like 1
  • Upvote 1
Posted (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 by Stonehouse
  • Like 2
Posted (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 by Stonehouse
  • Thanks 1
Posted (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?)

4A1BDDDF-D727-4DAC-A2DB-6B91F03BEF78.jpeg

BA6A48C1-5F55-4D04-8AC9-1471C599E4A9.jpeg

Edited by Vishnu
  • 1 month later...
Posted

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.

image.thumb.png.41d5c413ac690426999ed57f4ee66e35.png

 

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.

  • Thanks 1
PatrickAWlson
Posted

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

Posted

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.

  • Upvote 1
PatrickAWlson
Posted
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.

Posted (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.

 

image.png.f93747e29fac4d11df2d87563ad5ea9b.png

 

image.png.a59c959a1853b6a2d08574bf440e3a56.png

 

image.png.69a6617e5616a52875eed7f33d134329.png

 

unGTP-IL2.zip

Edited by Stonehouse
Posted

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
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?

Posted

yes, B= bridge

PatrickAWlson
Posted

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.  

  • Like 1
Posted

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.

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

Posted

I admire the dedication and persistence to solving this problem.  Thank you gentlemen. 

  • Like 2
PatrickAWlson
Posted
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.

Posted

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

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

  • Upvote 1
PatrickAWlson
Posted
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.  :salute:   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.

  • Thanks 1
  • Upvote 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...