RMMV 1.3.0 Change Tileset Issue

Due to the new bug template rule, I edited this threat containing the information of the error.


BUG EXPLANATION: I'm having issues with the "Change Tileset" after updating to 1.3.0. In a map previously created, the Tileset needs to change with a parallel process in order to create the animation of the water. Before the 1.3.0, that change produced a lot of lag and I was hoping that 1.3.0 could fix that and it does, but now I'm having a very problematic issue. See the video below:










The map literally dissapears. But when I tried the same Change Tileset method in a new project with the default tilesets, the error disappears:










ERROR REPORT: There are no error logs in the F8 editor.


EXACT STEPS ON HOW TO REPLICATE BUG: Using the sample project, put the Player Starting Position on "MAP003" and use the play test. The map contains the parallel process event to change the Tileset every 15~30 frames, and you will see the map disappearing after start a new game.


UPDATED DATA: After doing some test and thanks to the user @chalkdust, we've discovered that the passabilities are the problem. If you use Tilesets that uses the same passability configuration, the map disappears using this engine, BUT, if one tile changes it's passability on every Tileset, the map runs without more problems. For more information, please, read the posts bellow.


SAMPLE PROJECT: I created a sample project; one map without the error, and other two with the issue. Please, feel free to change the Player Start Position in every map to replicate the error with my custom tilesets included:


Sample Project


Thanks in advance for the help.
In your regular project with the disappearing map, open the debug console (F8) and see if it has any errors logged into it for images missing or something like that.
Why are you using change tileset in a parallel process to animate the water?
In your regular project with the disappearing map, open the debug console (F8) and see if it has any errors logged into it for images missing or something like that.



That's the weirdest thing, no errors are logged. That's the reason that I made a sample project.

Why are you using change tileset in a parallel process to animate the water?



Because this tilesets don't have water animation for A1. The only way to do the animation, not only for water, but for shores and other regions, is to change the tileset with a Parallel Process every 15~30 frames with 4 tilesets made specifically for this purpose.
That's the weirdest thing, no errors are logged. That's the reason that I made a sample project.



How large is the map you tested vs the sample map? It's possible give the small amount of time the map disappears (seemingly 1 or 2 frames at a time), that the tilemap is cleared when changing the tileset and redrawing everything, but it takes a couple frames to complete the process.
How large is the map you tested vs the sample map? It's possible give the small amount of time the map disappears (seemingly 1 or 2 frames at a time), that the tilemap is cleared when changing the tileset and redrawing everything, but it takes a couple frames to complete the process.



The original map size is 256x256, but in the sample project all the maps are 17x13. The sample project contains three maps: the first one with a functional Change Tileset process, and the other two contains the error (using the custom Tilesets).
On the sample project, copy over your map, remove any events to rule that out, and have the common event cycle the tilesets and see if that lags, because 17x13 is 221 tiles, whereas 256x256 is 65,536 tiles, which is 296 times the number of tiles in your sample map. That is very possibly enough of a different to prevent the map from disappearing for a moment.


If this does happen to be the same issue, then you'll likely need a plugin that will change how the tilemap works, which will likely be difficult. My assumption here would be to have a second bitmap that is drawn onto before being displayed on the screen so that it isn't cleared for each redraw, but that's probably not efficient and it's probably not going to be easy to mess with Pixi's code, as MV 1.3.0 has moved over to Pixi's tilemap code for WebGL, I believe.
On the sample project, copy over your map, remove any events to rule that out, and have the common event cycle the tilesets and see if that lags, because 17x13 is 221 tiles, whereas 256x256 is 65,536 tiles, which is 296 times the number of tiles in your sample map. That is very possibly enough of a different to prevent the map from disappearing for a moment.


If this does happen to be the same issue, then you'll likely need a plugin that will change how the tilemap works, which will likely be difficult. My assumption here would be to have a second bitmap that is drawn onto before being displayed on the screen so that it isn't cleared for each redraw, but that's probably not efficient and it's probably not going to be easy to mess with Pixi's code, as MV 1.3.0 has moved over to Pixi's tilemap code for WebGL, I believe.



I tried, but it's not working. Once I turn ON the Common Event with the parallel process (using the Debug menu to activate the switch), the map disappears again, but when I turn it OFF, the map re-appears (obviously, whithout the animation of the water). This error wasn't in 1.2.0, and the only issue was the lag. After updating to 1.3.0, the error appeared and I don't know why.
Hm, that's interesting. I tested this stuff on default tilesets, and now we see that custom isnt working. +1 case for me to debug 🙂  Thank you!
Hm, that's interesting. I tested this stuff on default tilesets, and now we see that custom isnt working. +1 case for me to debug 🙂  Thank you!



Please, if it is a common bug, it needs to be solved quickly, otherwise this will break all the projects that use the same engine or needs to change the tileset for another reason.
what is the tileset?
what is the tileset?



In the Database of the sample project, you mean? It's the "World_Map_Frame001" to "Frame004".


And I have some news about this bug: I tried to make an experiment with the parallel process, using the change of tileset with the default tilesets and the custom ones. This is the picture of the event:


Sin_t_tulo_1.png



The default ones (that I didn't touch) are the "Outside", "Inside", "Dungeon", and "SF Outside".


And this the result in video:










When the event tries to change the custom tilesets, the map is completely in black. BUT when the event loads the default ones, the map shows the default tiles but it keeps the region with the custom tiles when this are not used. This is crazy...


This is the map that uses the "World_Map_Frame001":


Sin_t_tulo_2.png



And this is the map using the "SF Outside" Tileset:


Sin_t_tulo_3.png



I don't understand what it's going on. The changes you see in the video should not occur like that. 
I've done some testing and I think I've found part of the problem. This occurs for me when you switch to a tileset that was created as a copy of the tileset you're switching from. If you overwrite tileset 3 "Inside" with tileset 2 "Outside", the same error occurs, even if you change the name and pictures. Since all four of your custom tilesets are copies of a single template, some behind-the-scenes identifier is trying to treat them as the same tileset. I've tried to create them from scratch without copying though and there's still something wonky...
I've done some testing and I think I've found the problem. This occurs for me when you switch to a tileset that was created as a copy of the tileset you're switching from. If you overwrite tileset 3 "Inside" with tileset 2 "Outside", the same error occurs, even if you change the name and pictures. Since all four of your custom tilesets are copies of a single template, some behind-the-scenes identifier is trying to treat them as the same tileset. I know it's a lot of legwork, but erase them and create them from scratch without copying and report back with the results! Good luck!



I created new Tilesets from scratch like you said, but nothing. The same error occurs...


EDIT: It's 3:15am in my country, so I won't be able to answer until tomorrow. Sorry for the inconvenience.
Yeah, I'm still tinkering... these are some strange findings:


Testing on Map 1:


Make a backup copy of Inside


Overwrite Inside with Outside


Black screen


Rename and reconfigure the overwritten version to match the original


Black screen


Make a single passability change on the overwritten version


Works! Maybe the problem is that the passabilities are identical?


Move to map 3:


Make passability change


BOOM IT WORKS!!!


Identical passabilities cause the bug!


Just pick a tile to sacrifice and alternate it from passable to impassable from frame to frame.
@Oscar92player Shaz is asking about what tileset you are using, because these appear to be the default world water tiles, and they are animated. She's just confused, as I am, why you are going to so much trouble to have animated water.


However, it does not negate that there is an issue with this command. We're just curious as to why you're making it so complicated. I see though that the land pieces are different so perhaps it's the water at the edges of those that you are trying to animate?
@Oscar92player Shaz is asking about what tileset you are using, because these appear to be the default world water tiles, and they are animated. She's just confused, as I am, why you are going to so much trouble to have animated water.


However, it does not negate that there is an issue with this command. We're just curious as to why you're making it so complicated. I see though that the land pieces are different so perhaps it's the water at the edges of those that you are trying to animate?



I'm so sorry, I didn't want to be rude. Look, I made a gif with the Tileset in question. It's attached at the end of the reply.

Yeah, I'm still tinkering... these are some strange findings:


Testing on Map 1:


Make a backup copy of Inside


Overwrite Inside with Outside


Black screen


Rename and reconfigure the overwritten version to match the original


Black screen


Make a single passability change on the overwritten version


Works! Maybe the problem is that the passabilities are identical?


Move to map 3:


Make passability change


BOOM IT WORKS!!!


Identical passabilities cause the bug!


Just pick a tile to sacrifice and alternate it from passable to impassable from frame to frame.



I didn't try this before. I will make a test in a moment and update the reply if there is any change.


EDIT: God dammit! It works, it really works!


=======================================================================================


This is the gif of the Tileset. It corresponds to the World_Map_Frame001 to Frame004 TileD:


View attachment 44934


This is the main reason that I'm not using the TileA1, because A1 uses 3 animation frames for the water, and this Tileset uses 4. Other reasons are the edges of the land, the river and the waterfalls. This means that I won't be able to use ships in my project (and I think I will not use them because of the plot of the game).


Again, I'm so sorry if I was very rude before.
Can you guys give me a TL;DR version so we can fix it? 🙂
TL;DR: Change Tileset (both the built-in event editor version and the script call) turns the screen black if the passability of the new tileset is identical to the passability of the old one. I also sent a message to Hackerham with this info.
TL;DR: Change Tileset (both the built-in event editor version and the script call) turns the screen black if the passability of the new tileset is identical to the passability of the old one. I also sent a message to Hackerham with this info.



Thank you, @chalkdust, I've edited the main post too, due to the new bug report rule. I hope this will be fixed in future updates.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-1-3-0-change-tileset-issue.66643/