The International Simutrans Forum

 

Author Topic: Crashes on rotating  (Read 5212 times)

0 Members and 1 Guest are viewing this topic.

Offline Colin

  • Devotees (Inactive)
  • *
  • Posts: 663
  • Certa Cito
Crashes on rotating
« on: May 14, 2009, 11:33:17 PM »
Also still getting random crashes especially when rotating the map.
Petty I know but it's frustrating.

Moderator: Split this topic as it did not relate to the topic from which it was split.
« Last Edit: May 15, 2009, 06:20:25 AM by jamespetts »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #1 on: May 15, 2009, 06:21:13 AM »
Colin,

are you sure that this is a problem specific to Simutrans-Experimental? I have not done anything to the code relating to rotation, or the display of objects on the map at all. It would be very surprising if this problem was caused by any of the changes that I have made to other areas of the code.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4607
  • Languages: EN, DE, AT
Re: Crashes on rotating
« Reply #2 on: May 16, 2009, 07:28:54 PM »
hello James,

if you introduce new variables in classes like koord, koord3, etc this variables have to be rotated as well. I dont know if this applies to ST-experimental.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #3 on: May 16, 2009, 07:46:36 PM »
I really don't think that I have changed koord or koord3d...

knightly

  • Guest
Re: Crashes on rotating
« Reply #4 on: May 17, 2009, 03:19:54 AM »
James,

Just a thought. Maybe Dwachs is saying that, if you use koord or koord3d in your new features (e.g., halts for waiting times), you need to translate those koord or koord3d objects to fit into the new, rotated coordinate plane in karte_t::rotate90().

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #5 on: May 17, 2009, 09:58:51 AM »
I don't think that that's what Dwachs is saying, and I'm not sure what sort of use that you imagine here - how would one "rotate", for example, a passing reference to a co-ordinate in a method?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4607
  • Languages: EN, DE, AT
Re: Crashes on rotating
« Reply #6 on: May 17, 2009, 10:41:45 AM »
Like Knightly said,

When simutrans rotates a map, everything is rotated. Especially coordinates will change. That is, if you have in your class member variables like koord etc, you have to ensure to rotate these member variables in the rotate function too. That means, after rotation unrotated koords will point to the wrong location.

 

knightly

  • Guest
Re: Crashes on rotating
« Reply #7 on: May 17, 2009, 01:36:56 PM »
I don't think that that's what Dwachs is saying, and I'm not sure what sort of use that you imagine here

This is the International Simutrans Forum, and many people are not native English speakers as you do. Thus, when you read other people's posts, you cannot expect everyone to express their point in English as clearly as you do, and sometimes you need to guess what other people actually mean and be patient.

When I expressed to you my understanding of Dwachs's previous post, I did that out of kindness, and I don't think I deserve a rude comment like "what sort of use that you imagine here". Actually, it seems to me that it is you who fail to understand my point, and that is not my fault.


Quote
- how would one "rotate", for example, a passing reference to a co-ordinate in a method?

I haven't read all your ST EXP code, but at least with respect to waiting times, you do record koords for directly reachable halts. You record those halts' koords as a key and record a fixed list of waiting times for those halts, and save these key-data pairs in the hashtables of waiting_times[c]. They are even saved in the save game. So, can you say that you don't need to translate those koords when the map is rotated? I am not saying that this is the cause of Colin's crashes, but at least this is a bug that need to be fixed, and it serves to illustrate Dwachs' point.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #8 on: May 17, 2009, 01:45:41 PM »
Knightly,

I was not intending to be rude - I think that you misunderstand me. I was only stating that I did not really understand what you meant, and that what you wrote did not appear to me to be what Dwachs had meant. Apologies if it came accross the wrong way.

In fact, you are right about the co-ordinate storage for the waiting times lists: I have added a method to rotate those. There were some other rotation issues, too, that I could not trace back to any Simutrans-Experimental specific code, but have put in place work-arounds so that rotation no longer crashes, which will be available in the next release.

Thank you to all those who have helped to track down the problem :-)

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3661
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Crashes on rotating
« Reply #9 on: May 18, 2009, 06:13:45 AM »
Knightly - I didn't read his phrase as rude -- I think it's a misunderstanding. :)

knightly

  • Guest
Re: Crashes on rotating
« Reply #10 on: May 18, 2009, 11:12:54 AM »
Thanks for your explanation, Issac. I am not a native English speaker myself, so I will trust your expert opinion ;). In any case, I am not unhappy anymore after reading James' reply.

James, my apologies for misinterpreting your post. :-[

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: Crashes on rotating
« Reply #11 on: May 18, 2009, 11:30:13 AM »
Back to the topic, Colin's savegame, (Experimental 3.4.2.sve) which was uploaded before, still crash on rotating in v3.9.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #12 on: May 18, 2009, 12:00:56 PM »
Z9999,

thank you for the report. Hmm, this is a difficult one to track down...

Offline tick tock

  • *
  • Posts: 52
Re: Crashes on rotating
« Reply #13 on: May 18, 2009, 11:20:39 PM »
James -

I don't know if you've yet determined whether this bug is due to ST Exp or not, but just to let you know, I still experience a crash in v3.10 when trying to rotate the map.  (Actually, the game just freezes up.)  I was able to rotate 180 degrees fine, but now I can't rotate it back at all.  Very disorienting, having to view the map from 180 degrees difference when you've played for hours looking at it from a particular viewpoint.   :D

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #14 on: May 18, 2009, 11:28:13 PM »
If you save and reload, can you rotate again?

Offline tick tock

  • *
  • Posts: 52
Re: Crashes on rotating
« Reply #15 on: May 18, 2009, 11:31:02 PM »
No, unfortunately

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #16 on: May 18, 2009, 11:32:57 PM »
Hmm, sorry that you're having problems. I'm afraid that this one is very hard to track down...
« Last Edit: May 18, 2009, 11:39:15 PM by jamespetts »

Offline tick tock

  • *
  • Posts: 52
Re: Crashes on rotating
« Reply #17 on: May 18, 2009, 11:37:14 PM »
At least it's playable.  Thanks for your efforts, is there any more information I can provide that might help?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #18 on: May 18, 2009, 11:39:20 PM »
Can you upload your saved game for diagnostic purposes?

Offline tick tock

  • *
  • Posts: 52
Re: Crashes on rotating
« Reply #19 on: May 18, 2009, 11:52:59 PM »
Sure.  I used a pak128+pak128.Britain mix in this particular game, but I think you can still open it using pak128.  I tested it that way and it opens fine, but many vehicles/stations are missing or replaced with other versions.  I still experienced the rotation bug though.  (Also, the notes in simuconf say that savegame compatibility is affected by using different catchment values, so if it does make a difference, I use "2" instead of your default "3".)

Save is now uploaded:   http://simutrans-germany.com/files/upload/1907.sve
« Last Edit: May 18, 2009, 11:59:03 PM by tick tock »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #20 on: May 19, 2009, 06:27:17 PM »
Tick Tock,

thank you very much for uploading that. I have had another go at fixing the problem in 3.11, which seems to work for your saved game. Could you give it a try? Thank you very much for your testing and reporting.

Offline tick tock

  • *
  • Posts: 52
Re: Crashes on rotating
« Reply #21 on: May 19, 2009, 08:01:23 PM »
Yes, it seems to work fine now!  Thanks, as always, for the quick response.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Crashes on rotating
« Reply #22 on: May 19, 2009, 08:34:41 PM »
Excellent - glad that it works for you :-)