ID:86250
 
This issue has been marked as a duplicate of id:97186
BYOND Version:459
Operating System:Windows XP Pro
Web Browser:Firefox 3.5.5
Applies to:Dream Daemon
Status: Duplicate

This issue has been marked as a duplicate of id:97186
Descriptive Problem Summary:
I get the following error in my game.

runtime error: BYOND Error: failed to write new icon.
proc name: RscFile (/icon/proc/RscFile)
usr: null
src: /icon (/icon)
call stack:
/icon (/icon): RscFile()

Numbered Steps to Reproduce Problem:
Use the code below? I'm not exactly sure if that's what's causing the error or not.

Code Snippet (if applicable) to Reproduce Problem:
obj
iconShow
layer = 10
screen_loc= "8,13"
New(client/C)
if(!C) del src
C.screen += src
proc/SetIcon(var/i, var/s= "")
icon= i
icon_state= s

mob/proc/DoSetIcon()
var/obj/iconShow/iS= locate() in src.client.screen
if(iS)
var/icon/I= new('icons/icon.dmi')
I.Blend('icons/icon1.dmi', ICON_OVERLAY)
I.Blend('icons/icon2.dmi', ICON_OVERLAY)
I.Blend('icons/icon3.dmi', ICON_OVERLAY)
I.Blend('icons/icon4.dmi', ICON_OVERLAY)
I.Blend('icons/icon5.dmi', ICON_OVERLAY)
if(src.colour)
I.Blend(src.colour, ICON_MULTIPLY)
iS.SetIcon(I)


Expected Results:
Icon change

Actual Results:
Byond error

Does the problem occur:
Every time? Or how often? Every
In other games? Unknown
In other user accounts? Unknown
On other computers? Unknown

When does the problem NOT occur?
v454 (I don't know if it works in any versions between 454 and 459)

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.)
v454

Workarounds:
None that I know of
Can you boil this down to a demo project? Some information that's missing in your report is what map_format you're using, and I think it'd help to have access to those exact icons you're using since this hasn't come up in previous tests. I can try to replicate this on my own but if you have a demo it'll speed things along.
I sent you my source code for "Dragonball Generations" a few days ago, if you still have it, that code should have the bug.

Edit: I found it happened in the second part of character selection.
The only thing I've been able to figure out so far is that it has something to do with the RSC file and dynamic icons.

I pinpointed the error down to assigning a dynamically created icon to the mob's icon variable (icon= dynamicicon) though when I copied the exact code to a demo and copied over the same icons, it did not happen...

During testing the bug happened:

When assigning the dynamic icon to the player's mob.

When assigning the dynamic icon to the screen obj which displays character creation icons.

When the dynamic icon of the player's mob attempted to be written to a byond save file.
All right, finally sent the source to [email protected]
Your source does not compile. I still think this will need some kind of simpler demo to solve though, because I'm not sure how far I'd have to go into your game to even see the error. If it happens all the time reliably that's something, but if it's intermittent there's little to no hope. Also I know from past experience that the debugger can choke pretty hard on your project because it's so massive, which limits my ability to test it. The memory and startup time of your project even in the release version of DS are prodigious. I got as far as creating a character in the .dmb you supplied after a very very long startup, but no bug appeared.

Other info that would probably help would be your system specs, like how much memory you have.
Really? That's strange.. It happens every time I create a new character. The error pops up at the stats selection screen (when it tries to display the character, at the top of the screen between the arrow buttons.) Also, the errors would be going to DBG_LOG.log

The second time is when you've created the new character and you wait about 20-30 seconds and it will warp some parts of the icon.

This happens every single time for me, it happened on Windows XP and since then I have recently upgraded to Windows 7 and it still happens.

My specs are:
Intel Core 2 Duo 3GHz, 4GB RAM, Nvidia GTX260 856MB (I have hardware acceleration turned off in options though?), P5K SE Asus motherboard, 3 HDD's totalling 2TB.

Hm I wonder if it has anything to do with turning off hardware acceleration? I recently upgraded my computer and upgraded to Windows 7 so this is a pretty fresh install and everything. It still happens to me 100% of the time, all the demos I have tried to construct to isolate the problem, it doesn't happen, though..

Edit: The code that generates the icons for players is in "MiscProcs.dm" in mob/GenerateIcons()
I took that code out and put it into a demo and the same problem didn't happen, so hm..

It doesn't compile? It compiles fine on my machine, what's the error it's giving you? That .dmb should have the bug happening in it anyway. Also from memory if the host is using the latest version of byond the bug happens then as well, even if the source was compiled in v454
I had this problem too in an image-generator loop, I solved it by adding a gratuitously large sleep() after sending the icon (a 1024x1024 image) to my client.
Well, I had some spare time just now and tried that. Didn't make any difference at all, Topkasa.

Damn I really wish there was an easier way to solve this. I can't make a demo of it because I honestly don't know how it even happens, I've wasted hours trying to replicate the bug.
If this doesn't get fixed I'm going to be stuck on v454 literally forever, which could be a problem.

I can try sending the source again, the only problem is that it's huge, the skeleton source that I sent to Lummox Jr compiled on my machine but I guess I can take another look at it to make sure. Then make changes and send it again if it isn't compiling.

EDIT: Yep, the source I sent compiles fine. I just moved it to the desktop and compiled it. Clean compile works and everything, only thing I get is a warning about the findText being phased out.
I have sent another version of the source to you Lummox Jr (LummoxJR (at) aol.com). I also have a section of a screenshot to show the problem which happens. (It's from the character creation screen, Earthling race tan.)

http://i47.tinypic.com/69gl8y.png
Your code still does not compile. It's throwing errors about "grabbable" and "canSave". I have all the libraries listed in your .dme file, so it isn't one of those that's the problem. It doesn't really matter anyway though because as I said, your game's size chokes the debugger. I'll need a simpler demo that reproduces this issue reliably.
Lummox JR wrote:
Your code still does not compile. It's throwing errors about "grabbable" and "canSave". I have all the libraries listed in your .dme file, so it isn't one of those that's the problem. It doesn't really matter anyway though because as I said, your game's size chokes the debugger. I'll need a simpler demo that reproduces this issue reliably.

Oh, I edited the bigatom library, that's probably the problem.. Let me send over my libraries too.

Hope it doesn't run too slow, 'cause seriously I can't write a demo for this, I've tried for so damn long.
Libraries aren't meant to be edited. You're better off appropriating the code and just putting it directly in your project if you do that. But again, a simpler demo is what I'll need. Your game is too hard on the debugger and I've never managed to get the error to appear there anyway.
Have you tried with the new source I sent though? There's seriously a BYOND bug right there I even sent a screenshot of it, it's been half a year since I started this topic and I haven't managed to build a demo of it and believe me, I've tried!

If you could just try the new source, it's the only chance I've got to figure this thing out, or else I'll most likely never be able to upgrade my BYOND version again..
If the old .dmb never produced the error for me and did for you, it stands to reason that the exact same project a little later in its evolution isn't going to be any different. And since catching this properly means debugging, I need a demo that won't choke the debugger.
It most likely did happen though, it just was writing the error log to another file so you didn't actually see the error. I tried to explain it before but obviously you didn't get it. So this time, I changed the code to display errors in the main output box (like default). This error happens on other computers I've tested it.

This bug happened immediately after another bug ( http://www.byond.com/members/ DreamMakers?command=view_tracker_issue&tracker_issue=718 ) with the newer BYOND versions which you fixed (once I sent the source), could be related. So it is possible to fix errors with debugging my source I know that for a fact.
Please, can you just try it? That's all I'm asking.

The person that hosts the game can't run the latest version of BYOND even if I compiled the game in v454, if the host runs the latest version of BYOND to host it, it does the same error, which leads me to believe that it is definately a BYOND error. Since v454 compiled .dmb doesn't give the error in v454, yet a v454 compiled .dmb still gives the error in a new BYOND version.
Sweep wrote:
It most likely did happen though, it just was writing the error log to another file so you didn't actually see the error. I tried to explain it before but obviously you didn't get it. So this time, I changed the code to display errors in the main output box (like default). This error happens on other computers I've tested it.

Once again, I can't catch this happening in the debugger because the game is way too huge. It's often a crap shoot as to whether it will fully start at all and if it does, it takes nigh on half an hour. I'm suggesting that if you can't make a simpler demo, you should at least make a separate copy of your game and start paring it down as far as you can to make the bug still appear, particularly where it comes to stuff that gets loaded at the beginning of the game. Working with the full source of your game is simply not feasible.
I have managed to break my source down and finally I found that it was in fact the BigAtom library which was making this happen.

http://www.byond.com/developer/Shadowdarke/BigAtom

I guess that means if you debug the library instead of my game, you'll find it? Not sure. I just know that every time I include this library (even if I don't use anything from it) this bug happens.


EDIT:
If it's not possible to debug the library I can send a stripped down version of my game's source that still produces the bug. Let me know if you need this and I'll send it to you as soon as I can (I'm without internet at my house for about 32 hours, so after that), if you need it.
Any news on this problem? I found where the problem is and sent the skeleton source, so it should be an easy debug now right?
The source was still too big to handle anything in the debugger, but I believe this is likely to have been fixed with the resolution of issue 1599. Please retest in 471.
Page: 1 2