Page 1 of 1

GAME/EDITING: Continual loops of teleporters will crash RTC

Posted: Mon Jan 26, 2004 10:07 pm
by Gambit37
Unsurprisng really, but if you create some kind of structure that uses teleporters to move items around a dungeon and then back to the beginning, RTC will crash with no errors.

This applies only when all teleporters have the same delay settings for activation/deactivation.

It's fine if you stagger the activation/deactivation.

Here's a sample of it broken:
http://homepage.ntlworld.com/matt_hill/ ... llsame.txt

Here's a sample of it working:
http://homepage.ntlworld.com/matt_hill/ ... tagger.txt

Put the chest on the pad in front of you.

I assume this error is due to some kind of overflow because everything is being processed at once.

NOTE: The staggered sample is a good text of RTCs performance. Simply stand still watching the chest being rotated --- on my machine (which is pretty powerful) it's generally fast but every now and then there is a hiccup and some lag, and the mouse goes all smooshy.

Posted: Tue Jan 27, 2004 10:24 am
by George Gilbert
I've actually fixed the overflow which causes it to crash without warning already - now it crashes and gives you enough information in the file to work out why (there's a stack of teleporter function calls that repeatedly loop around eachother!).

On the matter of it crashing in the first place, I think that this is the correct behaviour. In the sample dungeon you have told it to teleport an item from one place to another and then back again ad infinitum with no delay whatsoever - it tries its best to comply but it just can't! I happy to classify this as a bug in the dungeon rather than a bug in RTC engine especially now the crash diagnostics give you a shot at working out the offending teleporters.

Posted: Tue Jan 27, 2004 1:25 pm
by copperman
I took a look at this, and yes you CAN crash the engine with that particular teleporter set up, I looked at other ways of achieving the same (functional teleporters not crashes) @Gambit Look in your hotmail dude will that do your job. It is simpler but it does the same job.

Posted: Tue Jan 27, 2004 1:50 pm
by Gambit37
I didn't get any attachement from you on that hotmail email.

I wasn't actually trying to make a setup that have 0 delays, I was simply testing to see if RTC would generate warnings. I knew it would probably crash due to overflow issues.

Posted: Tue Jan 27, 2004 5:43 pm
by Paul Stevens
The folks at FTL must have gotten caught by this
at one time. They put a limit of 1000 moves....like
teleporting, falling into pits. Then it simply stops and
leaves the object wherever it was after the 1000th move.

Posted: Tue Jan 27, 2004 6:24 pm
by beowuuf
Really? I've had a freezing crash accidentally doing this in DM (havign a chain of teleporters linking to each other and forgettign to have a delay and break)

Posted: Tue Jan 27, 2004 7:38 pm
by Paul Stevens
Yes, really. But maybe it is only for objects and
not the party or something. Or maybe it simply
does not work. Here is a piece of it from Code11f52.cpp:

Code: Select all

    for (LOCAL_30=1000; LOCAL_30!=0; LOCAL_30--)
    { // Limited teleportation??? 1000 seems sufficient.
      pdA0 = d.LevelCellFlags[newX];
      D6W = pdA0[newY];
      D5W = sw(D6W >> 5);
      if (D5W == roomTELEPORTER)
      {
        if ((D6W & 8)==0) break;

      ........
      ........
      ........

    }; // for (LOCAL_30)