ID:116496
 
BYOND Version:489
Operating System:Windows Vista Home Basic 64-bit
Web Browser:Firefox 5.0
Applies to:Dream Seeker
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:
This one is tricky, because it doesn't happen that often. That said, it happens often enough where it becomes an almost daily issue for regular players.

This example works just fine every time and the image always shows up as expected:

I = image('Icon.dmi',src,"icon_state",layer=10)
src << I


However, if you attempt to show a series of images in a loop, the first image that should have been displayed sometimes goes completely missing. All of the rest of the images show up normally. Example:

var/number = 1
while(number < 10)
I = image('Icon.dmi',src,"[number]",layer=10)
src << I
number += 1


This also happens in loops where the images have already been previously created. For example, say a monster had an image stored in a variable called "stored_img" and I wanted to show it to all of the players in a list:

mob/monster/proc/ShowImage(var/list/player_list)
for(var/mob/player/P in player_list)
P << src.stored_img


So for example, if I use a while() loop to draw a sentence of text onscreen character by character using images, the first letter of the sentence occasionally just doesn't show up.


Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
This issue has been around for quite some time. It seems to affect all players on all different types of systems.


Workarounds:
Doubling up and "drawing" the first image twice solves the problem. Here is a workaround version of my example from above:

var/number = 1
while(number < 10)
I = image('Icon.dmi',src,"[number]",layer=10)
src << I
if(number == 1)
I = image('Icon.dmi',src,"[number]",layer=10)
src << I
number += 1
So if I follow your ShowImage() case right, you're saying that if you call ShowImage() in a loop itself, the first image you call that for doesn't show (and for all players) but the others do?

[edit]
Another question: Does this occur at all in Flash, or is it strictly a DS thing?
mob/monster/proc/ShowImage(var/list/player_list)
for(var/mob/player/P in player_list)
P << src.stored_img


Grrr... I swear that I proofread and double check these things before I post them. The example I meant to use is this, where the player is shown a series of images assigned to different monsters:

mob/player/proc/ShowImage(var/list/monster_list)
for(var/mob/monster/M in monster_list)
src << M.stored_img


In that example, the first monster's image will occasionally go missing.

However, I just realized that the monster's stored_img var we're using is actually created in a while() loop that assigns a new image to each monster in a list, so it could still be a problem at creation. I'll do some more digging on that.


We already have my given workaround in place for every instance where we create images in a loop in the NEStalgia code, so I can't verify whether or not this happens in flash. I can remove those workarounds for the next flash compile if you'd like.
I think this issue is related to this one:
http://www.byond.com/members/ BYONDHelp?command=view_tracker_issue&tracker_issue=609

Ever since the bug in the link was fixed this has been happening.

One thing we've never tested is whether or not the bug happens when we display the images by adding them to the client's image list(src.client.images += I) rather than the output operator. It's more convenient for us to use the << operator since we often need to output images to a group of players when displaying text.
That doesn't really fit, tenkuu; images are fundamentally different from screen objects, and the problem in that issue was a simple case of the screen object list not updating as it should. Images on the other hand should work as soon as they're received because they're displayed in a different manner.
Maybe, maybe not. The loc of all of the /images we use in NEstalgia are /objs and /mobs that are contained in client.screen, though.
Hmm, that's an interesting observation. I still don't think it'd be possible for the image simply to not show up in that case though.
I know that you guys are going to get back to fixing bugs in the coming weeks/months, so I just wanted to see if there is anything else that we can do to help pinpoint the source of this issue and get a fix if it's doable.
I don't know if i understand it well but i've done this:

mob/verb/A()
var/number = 1
while(number < 11)
var/icon/I = image('A.dmi',src,"[number]",layer=10)
src << I
number += 1
sleep(2);


It shows the loop of images fine, i've repeated it an success.
As explained in the description, this is a glitch that pops up randomly. It does not occur 100% of the time.
Could it be happening due to a loading error? Since it happens to be popping up randomly. Maybe it's due to how big of a file your game is that the error keeps occurring.
In response to Icicard
Icicard wrote:
Could it be happening due to a loading error? Since it happens to be popping up randomly. Maybe it's due to how big of a file your game is that the error keeps occurring.

Nope. We've verified that this happens with compact demos - it's just a matter of randomly seeing it.
Ive seen this happend in Dead World many times sometimes the images didnt show and could not figure it out pretty weird huh?
We'll do our best to fix it, but what would help most self-contained demo that illustrates the problem (even if it takes a while). Have you tested the snippet posted in the original report in its own demo? And if so, could you provide something for us to try?
Its not something thats easy to produce but i notice it happens when theres alot of players on a single server. But ill do my best to try and reproduce the problem.