Demo:
[removed]
First off, run the Create_icons verb and let it run through 600 times. Notice how the dyn.rsc only gets to about 70k.
Next search for the code I have labeled 'PROBLEM A','PROBLEM A1','PROBLEM B' and 'PROBLEM B2' and uncomment those blocks. Compile and run it again. Notice how the dyn.rsc now inflates up way past 70k. Sometimes it'll stop generating icons around 200 iterations when it starts creating bad icons. The code will still generate them afterwards with no error, I chose to stop it there for the demo. If it doesn't stop, and gets up to 600 iterarions, the dyn.rsc will have inflated upwards of 1 meg.
The main bug is that this is causing inconsistent icons to be created.
goodH3.dmi and goodH4.dmi are how the icons are intended to be created by the code.
badH1.dmi and badH2.dmi are what are created after the rsc bloating occurs.
ID:87704
Dec 19 2009, 9:06 am (Edited on Jun 30 2010, 6:56 am)
|
|
Dec 20 2009, 6:01 pm
|
|
Did you ever retest this with TILED_ICON_MAP like I mentioned previously? You were doing some icon manipulation that was affected by the upgrade so this issue could simply be related to that.
|
That was Tsfreaks, not me.
Anyway, this occurs under TILED_ICON_MAP in the real game, and I also made sure to include that as the map format in the demo as well. It's a spotty bug to trigger under normal circumstances and I wasn't sure I could even come up a reliable demo. I can workaround it by pre-generating all of the icons, but I figure there's a real issue somewhere here so I better report it. |
Ah, my mistake.
After running your demo with the problem blocks uncommented I didn't see the dynamic .rsc getting appreciably bigger after the first run; it got a little bigger but not by much. But I also did not see any icons output, so I couldn't compare good vs. bad results. (You refer to files like goodH3.dmi and such but those are not included in your demo.) All I could do was run the program and look at the file size, which isn't so much productive. If there's a problem I'll need more substance in the demo to find out. I did get the "bugged" message, but the fix to your other issue made that go away. One thing I did notice is that none of the problem sections that are supposed to contribute to the .dyn.rsc file growing actually involve icon operations. I believe what is causing the dynamic .rsc to grow is that you're assigning /icon datums to an image which is being made into an overlay, and the act of assigning that icon is implicitly calling fcopy_rsc() to make that icon a cache entry--so if that's all there is to it, then that behavior is actually normal. As for the inconsistent icons I have nothing to work with in this demo. There is no way to tell if an icon is being made correctly or not. What I would suggest is that in your game, you should try keeping track of the parameters used to make the broken icon--e.g. what color selection was used, etc. Once you have that info you should be able to distill the issue down to a single test case. |
That's weird, they should have been in with the initial demo.
I reuploaded the same demo, but now it will ftp() over a copy of the two types of icons as they should be created and the two types of badly created icons. good1.dmi should be a four directional icon sized at 32x32. good2.dmi should be a single direction icon sized at 96x96 with the image having been scaled up to 96x96. bad1.dmi is the same four directional icon as good1.dmi, but it is sized at 96x96 not 32x32. bad2.dmi is a single directional icon sized at 96x96 but the image itself was NOT scaled up like good2.dmi was. The bad icons are ftp()ed over after receiving the debug output for bad icons. I highlighted the place where these icons are created with this text: /**********Creation and scaling if needed*********/ |
It also happens most, if not all the time with 'Players - Merchant Base.dmi', but during our beta test of NEStalgia, it was not limited to just that icon.
|
SwapColor() doesn't factor into this bug at all. The bad icons can still be triggered even if all of the SwapColor() lines are removed. The important part is keeping each line that appears before the SwapColor() blocks: var/icon/O = icon(SH) etc.
Creating a new icon from an already created dynamic icon seems to contribute to this issue. |
Here's the final version of a demo where I trimmed out everything but what is required to trigger this.
[Demo removed] I set up two icon cache lists and without them, the bug will never occur. They are named head_cache and body_cache. In the update_icons() proc I left the lines which create a dynamic icon from existing dynamic icons as they are also needed to trigger this issue. Here's the lowdown: After a base icon is created it is placed into one of the icon caches. Later, before creating a new base icon, it'll check in the cache and use that first instead of creating a new icon. Sometime after creating an icon using one of those cached icons, when it goes to create a new base icon it fails to create it properly either not scaling correctly or improperly setting the icon's size. |
I think this might be the same issue as this one: http://www.byond.com/members/ DreamMakers?command=view_tracker_issue&tracker_issue=1599
This issue triggers in 470.1075 but I can't get it to happen in 471.1076 which contains the LRS fix. |