The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Rollmaterial on February 22, 2017, 08:52:44 PM

Title: Shaky view when following a convoy
Post by: Rollmaterial on February 22, 2017, 08:52:44 PM
When following a convoy, the views for travelling Northeast or Southwest are misaligned and make it very shaky.
Title: Re: Shaky view when following a convoy
Post by: jamespetts on February 22, 2017, 09:01:53 PM
I see what you mean - that is very odd, as I have not altered the graphics code from Standard. Does anyone know whether this can be reproduced in Standard?
Title: Re: Shaky view when following a convoy
Post by: jamespetts on April 02, 2017, 11:26:31 PM
I have recently applied the latest graphics changes from Standard, and this still appears to be an issue. This is very odd, since I have not explicitly changed any of the graphics code, and I have no idea how the graphics code works, so trying to work out the nature of the problem by debugging in the usual way would take a gargantuan amount of time.

May I ask the Standard developers - has this ever been an issue in Standard, or have there been any changes to the code in Standard in the last few months that might, if some other part of the code were not changed appropriately, cause this?
Title: Re: Shaky view when following a convoy
Post by: Phystam on July 01, 2017, 11:07:20 AM
I found the answer for this issue, it was very easy typo.
In "simworld.cc", there are some code to follow convoy around L4580. (in karte_t::sync_step() function)
"new_xoff" looks okay but "new_yoff" has small change compared with standard one.

Standard code:
new_yoff -= tile_raster_scale_y(-v.get_yoff(), rw) + ...
Extended code:
new_yoff -= tile_raster_scale_y(-v.get_hoff(), rw) + ...

When I changed this part, the performance became okay.
Title: Re: Shaky view when following a convoy
Post by: jamespetts on July 01, 2017, 01:22:30 PM
Excellent, thank you very much! I have tested this and it indeed works. That is very helpful. I have now applied this fix to the master branch.

Thank you again.