ID:1279607
 
Resolved
BYOND Version:499
Operating System:Windows 8 Pro
Web Browser:Chrome 28.0.1500.20
Applies to:Dream Maker
Status: Resolved (499.1191)

This issue has been resolved.
Descriptive Problem Summary:

The map editor will at times not display the map properly. Things will be missing or with blank icons in the "object" tab at the side, or the entire map editor display will not show the correct icons on the map. I have a screenshot of probably the craziest thing I've seen:



Numbered Steps to Reproduce Problem:

The problem appears to occur after I edit code or an icon file and compile. This is merely a guess, I haven't seen any pattern except that.

So:
*Edit code or an icon file. Or both maybe.

*Compile

*Check map editor

Does the problem occur:

The problem doesn't occur all the time, it seems. Like I said, I haven't found any solid pattern. It's been frustrating trying to work with this.

Workarounds:

Restart DM and it displays properly again.
Sounds like it could be this bug again.
If you could do the legwork and see if you could get this to happen with a simple demo (even if it takes a few tries), that would be great and something I'm sure I could fix. I have yet to see it in action myself and I've tested a lot of games, including some huge ones with very big maps and long compiles. I'll also see about adding some extra validation code just the end, if I can ensure it won't slow up things much.
I'm trying, but I'm having a very hard time replicating the results. It continues to happen in my Bit game's source, however. Sometimes it's more dramatic than others, sometimes nothing happens and it's functioning properly.

I'm trying to find some sources or libs to check, but the download button on the site doesn't appear to be working, nor can I access any of my demos/libs via the pager seemingly. My guess is that if you find a well developed project that has many different objects and turfs on the map, it may screw up if you try editing some icon files a bit. That appears to be how it screws up in my Bit source.
UPDATE:

Bit's source has a single icon file labeled "Tiles". This file contains the majority of the game's turfs and objects that can't be interacted with so far. Since this icon file has so many icon_states which are currently being displayed on the map, this may be the reason why it screws up so much. When I edit some other icon files and compile, the map remains unchanged. When I edit the Tiles icon file, any object on the map belonging to that icon file becomes invisible. That goes for any other icon file. If I edit an icon file which contains my healing items, all healing items on the map become invisible after compiling. The only workaround is restarting DM.

After some fooling around, this appears to be the only cause of the problem. Editing code alone will not screw up the map editor.
In response to Fugsnarf
Fugsnarf wrote:
The only workaround is restarting DM.

The previously reported similar bug could be fixed by the 'Update' button - doesn't help at all in this situation?
In response to Super Saiyan X
Super Saiyan X wrote:
The previously reported similar bug could be fixed by the 'Update' button - doesn't help at all in this situation?

That's a no, it doesn't help at all.

Do you think you can provide me with some sample code using the icon, and an instruction on what to try to reproduce this? Once I can reproduce it, I can test some things. I can try without but it would be easier to have something to illustrate the bug.
I've tried a few attempts, but none of them replicate the issue. It may have to do with having more objects coded and in the map, I don't know. That's why I suggest trying with an already-made source. I did it with my Megaman framework and the problem occurred as expected.

Get the source for a game or lib that's well developed with plenty of different objects and turfs. Go into one of the prominent icon files and add a new icon_state. Name it something, go to the map, then compile and watch everything change or vanish.
Ok, I'll see what I can find. If you have a source you're willing to provide to me and tell me what to do, I can also try that.
I stripped down Bit to just the tiles and the map. The problem still occurs for me, so hopefully it does for you too. I had trouble making it work on anything else I had.

http://puu.sh/351xY.zip
Ok, thanks! I'll try it out tomorrow.
In response to Fugsnarf
Works fine when the icon_size is 32 instead of 24. However, with 24, I'm seeing everything on that map from Tiles.dmi disappear after making an icon state there and compiling. When I delete the new icon state and compile again, the things reappear.
No wonder I couldn't replicate the problem then; I was always trying with games that had an icon_size of 32.

That also explains why the problem occurred in my Megaman framework because that uses an icon_size of 16.
Tom changed status to 'Verified'
Thanks for the good report. This is easy to reproduce so I should be able to fix it for the next version, prob. later today.
Tom resolved issue
As noted, this bug only showed up when changing from the default icon-size. Basically it was trying to change the imagelist in a non-thread-safe way. Incredibly aggravating!