ID:1918661
 
Resolved
Images didn't always align their appearance changes with server map ticks, causing them to change, appear, or disappear out of sync if the client did a separate map tick.
BYOND Version:508
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 44.0.2403.155
Applies to:Dream Seeker
Status: Resolved (510.1340)

This issue has been resolved.
Descriptive Problem Summary:

Image objects' appearance updates don't seem to be synchronized by the frame. I can't explain it much better than this, but I would expect every single added/removed/changed appearance to appear during the same render frame, rather than the visual flickering that's happening to me with certain objects.

It seems like changing image appearances works fine, but when you change the object that the appearance is linked to after changing the image, the old image appearance is used for one frame, and then the next frame, the new object's appearance changes are processed.

EDIT: I've found the source of this problem: Image objects' appearance changes are communicated and cause render updates on the client immediately, even if it's between frames. Meanwhile, atomic appearance updates wait until the next frame to change.

Numbered Steps to Reproduce Problem:

Lummox, PM me for the source code that demonstrates the problem. Basically, you need to update multiple image objects in a single frame to get this to happen.

Expected Results:

All changes to image objects during the frame should update instantaneously.

Actual Results:

Some objects update before others.

Image of problem in action at 40fps:







Image of the problem in action at 1fps:

I lowered the FPS of the world to 1fps to more clearly demonstrate the problem. The ticker at the top of the screen is updated once per frame. You'll notice that any object location/appearance updates wait until the next frame to render, while appearance updates on images are instantaneous.

The last gif shows the problem, as the color of the image objects is being changed on mouseover of a valid move destination, and the direction of the corner object that two /image objects are linked to is being changed in the same frame. This results in the direction being changed later than all the colors.

The first two gifs show the problem of image updates occurring in the color and icon_state changes to existing image objects, while their root objects being relocated from my object pool onto the map waits for the next frame.





http://files.byondhome.com/Ter13/ImageBugreport_src.zip

This demo should show the problem. The demo runs at 1FPS to demonstrate that FPS is not respected at all by image updates.

This is not an issue of the object appearance updates being late. It is an issue of the image appearance updates triggering a redraw instantaneously.

It should also be noted that smooth tile gliding also triggers redraws at 1FPS, so I think image objects' appearances are actually tied to the glide redraw, and not the actual frame redraw.
I see the problem, at least where it concerns low-FPS worlds. The client tick is in fact a minimum of 10 FPS, even though the map updates are only sent once per actual server tick. (This is actually hugely good news for my future plans to make client-side ticks faster if the user wants. It means basically the client and the server are already capable of ticking at different rates with minimal changes!)

In higher-FPS worlds, I think the issue is only showing up when the map data is slightly out of sync with the client tick. This is tricky, because when map data is delayed, the client still wants to update so that it can display animations (if any); but image info is updated immediately, because the turf/obj/mob/area info messages that are sent on a map tick are separate.

I believe the solution is going to have to lie in 1) making sure there's always some message sent on a map tick, which I think is the case but I want to be clear on it, and 2) queuing messages that could impact the map until the next map tick comes. I also think solving this will be critically important to my faster-client concept, so I've put this on my priority list.
Lummox JR changed status to 'Verified'
Lummox, this issue doesn't just affect low-fps worlds.

I'm seeing the premature updates at 40fps.

Can we get this issue addressed soon? It's really demoralizing.
Yeah, I'll see if I can come up with a way to improve this.
I've decided to take a client-sided approach to this. Since the only image changes possible are creation, appearance changes, loc changes, and animation, I can address the first three cases by keeping track of any changes and applying them after a server-sent map tick is detected. I can keep a linked list on the client end of all images that are changing (including new/deleted).

Animation is a trickier beast, but it might not be as big a deal.
Lummox JR resolved issue with message:
Images didn't always align their appearance changes with server map ticks, causing them to change, appear, or disappear out of sync if the client did a separate map tick.