ID:2383072
 
Resolved
Turf images and vis_contents didn't always get preserved after a Z-level jump.
BYOND Version:512.1435
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 61.0
Applies to:Dream Seeker
Status: Resolved (512.1436)

This issue has been resolved.
Descriptive Problem Summary:

In SS13: when the AI switches its view (which involves a lot of turfs sharing one same object in their vis_contents, which then has one corresponding entry in `client.images`) to another z-level and back, Dream Seeker begins to stutter, and incorrect output may result. Because our input subsystem continues a player's last known inputs if they lag, this brief stutter is turned into a seconds-long hang as new turfs keep being transmitted, until the camera hits the edge of the z-level or an area of the map where most turfs do not have that object in their vis_contents.

In addition to the lag, a test project revealed that there are visual glitches and heap corruption (crash on exit) similar to the previous bug.

Code Snippet (if applicable) to Reproduce Problem:
Minimal test project.

"Toggle Z Shifting" will enable/disable a random chance of toggling to the same x/y on the other z. It's off by default - use it after a loop or two of good behavior to cause the problems to start.

"Stop Gliding" and "Restart Gliding" can be used to start and stop gliding. Hitting any movement key will also stop gliding.

The problem can be exacerbated by using the "Speed Up" verb. Our AI eye has an acceleration feature which gradually speeds its movement the longer it continues (to a cap), which this verb emulates. The "Speed Down" verb undoes this.

The bottom-right of the screen includes some debugging information and a brief animation loop where the stutter may perhaps be more obvious to the eye than in a field of numbers.

I should note that the lag in the test project is much less severe, and slower to manifest, than in SS13, likely due to the lower complexity.

Does the problem occur:
Every time? Or how often? Randomly.
In other games? Yes, in a test project.
In other user accounts? Probably.
On other computers? Probably.

When does the problem NOT occur?

This particular problem seems to not occur if the eye never changes z-level.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Unknown when it started; I believe it was present in 1434 as well, but have not confirmed.

Lummox JR resolved issue with message:
Turf images and vis_contents didn't always get preserved after a Z-level jump.