Banjobeni / DerailValley-PersistentJobs

Derail Valley Peristent Jobs Mod
https://www.nexusmods.com/derailvalley/mods/794
MIT License
2 stars 1 forks source link

SU multi-dropoff job targetting the same track twice, and being too short for both parts #16

Open Mich3lin opened 1 year ago

Mich3lin commented 1 year ago

Hello, I've encountered bug, when a 2-drop off job gets assigned single track for both drop-offs which is too short to accommodate the whole consist. This is the job: job1 (270m) gets assigned to G1S for both parts job2 job3 Longer tracks were obviously available at time of accepting job. overview

Persistent Jobs version: 3.2.0

Banjobeni commented 1 year ago

Hi and thanks for the detailed bug report. That does indeed look like it doesn't fit. Do you have by any chance your Player.log (or Player-prev.log) still available from that session? And/or a savegame from right before accepting this job?

Mich3lin commented 1 year ago

I'm not sure if the log file hasn't been overwritten already, but at least I have the save file right before accepting the job. Here it is: Derail Valley.zip

Banjobeni commented 1 year ago

Try finding the log files anyway, i could search in them for anything specific to that job SU14.

Mich3lin commented 1 year ago

Yes, I forgot to mention I've attached both logs already. I've found

Matched job and job booklet [HB-SU-14] 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

[PersistentJobsMod] YardTracksOrganizer.ReserveSpace 147.1m on track HB-G1S. Reserved space is now 187.1m of 259.4m total 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Unexpected state: Not enough unreserved space for reservation! Something is not right. 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

[PersistentJobsMod] YardTracksOrganizer.ReserveSpace 128.7m on track HB-G1S. Reserved space is now 315.8m of 259.4m total 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

in the "prev" log.

Banjobeni commented 1 year ago

Huh, really interesting. I need to debug.

Actually thanks, I really needed a reason to dig into that part of the code too and probably deep-rewrite it. I took it from the original mod from pre-sim and never touched it. It really looks like it wants to be rewritten, though.

Banjobeni commented 1 year ago

I see two bugs in here: a) Reserving more than what is available b) Changing a destination track to one that is already part of another dropoff without there really being a need for it (other S tracks are obviously free)

Mich3lin commented 1 year ago

Huh, really interesting. I need to debug.

Actually thanks, I really needed a reason to dig into that part of the code too and probably deep-rewrite it. I took it from the original mod from pre-sim and never touched it. It really looks like it wants to be rewritten, though.

No problem 😄. And thank you as well, DV without Persistent jobs is just not the same!

Mich3lin commented 1 year ago

One thing I noticed, after doing this job for the third time now, is that during loading I must have coupled the wagons in wrong order. On third try it assigned half to G1 and half to G7, but the wagon numbers were mismatched. I had to shunt the consist back and forth to get the "correct layout". I though that if you don't adhere to the SL order, it would sort of recheck the consist and create SU job based on the actual consist layout, than what it was supposed to be like. At least I don't think I ever had this issue in Overhauled, but maybe it's just a coincidence...