The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: hnz_kkk on September 09, 2013, 01:11:17 PM

Title: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 09, 2013, 01:11:17 PM
On latest version in latest pak.german-exp.20382, on every autosave the map rotates. Strangely, I've noticed it happen only for one of the four rotation angles (I don't know how to describe which one is it).

Map size: 896x768... can add save if required.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: Sarlock on September 09, 2013, 02:45:56 PM
Can't recreate on pak.Britain-Ex.  Not sure why it would be specific to pak.german-exp.20382 but I tested pak.Britain-Ex and no issues over two full rotations, saving, closing program and reloading after each rotation.  Tried on a 256x256 map, perhaps map size matters.

Save game and pakset would probably be helpful for James.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 09, 2013, 04:01:32 PM
OK, zipped pak.german here:

http://212.4.152.218/MYWeb/ftp_root/_space/pak.german-exp.20382.zip (http://212.4.152.218/MYWeb/ftp_root/_space/pak.german-exp.20382.zip)

And savegame:

http://212.4.152.218/MYWeb/ftp_root/_space/jenik.sve (http://212.4.152.218/MYWeb/ftp_root/_space/jenik.sve)

Also, this is only related to autosave. The rotation itself is very weird, with graphics of rails being distorted and getting to normal over next few seconds.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: Vladki on September 09, 2013, 05:35:57 PM
I have experienced the same bug with pak128 standard. But i don't remember the versions and the game is over. I think it might have been fixed in standard already, as I dont see this bug any more.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: jamespetts on September 09, 2013, 09:54:15 PM
Thank you for the report - shall have to investigate. If any of the Standard developers know this to have been a Standard bug now fixed, I should be extremely grateful if anyone could point me in the right direction for the fix so that I can find it in the Standard code and apply it.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 10, 2013, 10:17:31 AM
Standard once did not cope with factories with has an empty tile (0,0) by rotation, so it rotates the map into a rotation where (0,0) is not empty. Standard however rotated it back and I think Dwachs also submitted code to make sure it can cope with empty (0,0) tiles; I would however still suggest to avoid these.

In pak64.german there was once an empty L-shape coal mine which got then an extra pile for the left out corner.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 23, 2013, 12:24:46 PM
Quote from: prissi on September 10, 2013, 10:17:31 AM
Standard once did not cope with factories with has an empty tile (0,0) by rotation, so it rotates the map into a rotation where (0,0) is not empty. Standard however rotated it back and I think Dwachs also submitted code to make sure it can cope with empty (0,0) tiles; I would however still suggest to avoid these.

In pak64.german there was once an empty L-shape coal mine which got then an extra pile for the left out corner.

Thanks for reply, interesting explanation. Should I investigate if this happens only on screens with factories in them? Also, what properties should these factories have, as I don't quite understand "has an empty tile (0,0) by rotation" - there are some buildings which miss a tile by some rotation angles, however the rotation problem happens on Sawmills, Paper mills, which visually are complete... Could try to trace this problem if you give me a hint how.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 23, 2013, 01:01:47 PM
It does not depend whether a factory is visible or not. It just depends on its existence on the map. The fatory most likely causing this are coal mines with an L shape. There is one rotation, which has no (0,0) tile.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 23, 2013, 07:08:39 PM
Quote from: prissi on September 23, 2013, 01:01:47 PM
It does not depend whether a factory is visible or not. It just depends on its existence on the map. The fatory most likely causing this are coal mines with an L shape. There is one rotation, which has no (0,0) tile.

The only coal mine on the map is attached below. There is no other mine type even in the "Build industries" function.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 23, 2013, 10:18:55 PM
I think there was also a farm or wineyard, which were asymmetric.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 24, 2013, 08:40:49 PM
Quote from: prissi on September 23, 2013, 10:18:55 PM
I think there was also a farm or wineyard, which were asymmetric.

Oh yeah, there are some very strange farms with missing pieces on every rotation angle. Is this the problem, possibly? Attached below...
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: Dwachs on September 25, 2013, 08:21:50 AM
These placeholder images are there to prevent the situation prissi described. They should not cause any problems.

You should look for L-shaped factories, where there are empty corners like in

FF
F.

F = factory tile, . = non-factory tile (click does not open factory window)
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 25, 2013, 01:34:50 PM
There could be also an addon, which has only a 2x1 shape and is only single rotation. In such a case the map will also rotate. The standard pak64.german did not include such buildings, but I am not sure about pak64.experimetnal.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: hnz_kkk on September 25, 2013, 04:50:20 PM
Quote from: prissi on September 25, 2013, 01:34:50 PM
There could be also an addon, which has only a 2x1 shape and is only single rotation. In such a case the map will also rotate. The standard pak64.german did not include such buildings, but I am not sure about pak64.experimetnal.

Seems to be an object called Bauernhof, which has a tile missing in the corner. Once removed, the rotation after autosave stops. I'm including a screenshot - red markings are factory tiles, blue is empty (probably the corner one).

There are empty spaces on some rotations and it even says "Not possible in this rotation" when I try to remove it from the map.

So that's it I suppose - what action do you recommend now?
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 25, 2013, 10:34:02 PM
I guess simutrans-experimental may not have merged the code dealing with this from standard completely.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: jamespetts on September 26, 2013, 12:15:42 AM
Quote from: prissi on September 25, 2013, 10:34:02 PM
I guess simutrans-experimental may not have merged the code dealing with this from standard completely.

Hmm - may I ask in which commit (a date would be helpful, or date range with phrases from the commit message) I can find this code to try to deal with this? I should be very grateful.
Title: Re: [11.10] [pak.german-exp.20382] Map rotates after autosave
Post by: prissi on September 26, 2013, 08:06:00 PM
Any commits targeting gebaeude.cc. That should not be too many. (This commit will then also target simfab.cc at the same time. I think this was more than 1 1/2 year ago, when Knightly was still active. The actual patch came from Dwachs, imho.)