#Mico GBS Plugins
2503 messages · Page 3 of 3 (latest)
No, they arent. I'll add them to the common tileset
Thanks!
The difference might be negligible, but.
would drawing the overlay using text only, ando modifying the font files be more efficient (CPU wise) or is it just about the same
No that would be more intensive
drawing the tiles in the tileset VRAM is more costly than just updating the overlay's tilemap via submapping
understood, thanks!
Was just about to compile and got this error
I did rearrange the common tileset and the metatile scene
But it would usually give me the mismatch coordinate, I don't remember ever getting this error.
wow, did your build usualy take that long to make?
Not really, a minute at most on linux
2 on win
I reverted back to a previous build.
The issue here is that its taking more than 1 minute to run the event
I guess they added a timeout for plugins
I'm not really sure what I did to cause that, I just rearranged the tile set.
All good now.
Hey, I'm pretty new to the plugin, but how do I get a Metatile ID on the Metatile Plugin? And do I have to use the “Get Metatile at position” input for each tile I want to place that needs a Metatile? Sorry, I can’t seem to figure this out
(To be honest, a full-fledged tutorial would be very much appreciated, but I feel like that's too much to ask)
Also, I can't see the "Assign Metatile command"
'Get Metatile at position' isn't an input, it's how you find out the ID of a metatile at a specific position.
If you want a metatile to do something, the most basic way is to first 'Get Metatile at position' (the specific position you want to check), and then use a Switch to run events conditionally based on the returned metatile ID.
I recommend checking out the demo files that come with the plugin.
Oh, thx!
Updated all my plugins for 4.2.0 Beta3 for those that keep up with the current beta.
Still not updated on the plugin manager but if you get it from my github its updated for Beta3.
Also added a new onCollision event for metatiles, making the process more generic
Is there a way for a projectile to trigger this collission event?
No thats for the player only, if you need the projectile to trigger on collision that would be via the custom projectile plugin where you can run scripts when the projectile dies
Like you were probably already doing
So I'm taking another shot at this (Have plenty off backups now) and I'm still getting the error. I added some generic symbols to my tileset and changed a background to include them. Any thoughts on what's happening?
Make sure you have the common tilesets are set for both grasstileMeta scene and ScrollFieldOdd scene.
Double checked and they are. The common Tileset button is on and it's set to the Tileset I have in the Tileset folder
Only change I made was adding that 5x5 square if symbols to the Tileset, the meta BG, and the Scroll scene BG
If you are using the 16x16 tile version then your scene is wrong, because the scene is split in 16x16 tiles so each 16x16 tiles need to match a 16x16 metatile in the metatile scene
@somber patio
When you are making your scene using this plugin, I highly recommend using something like Tiled and use the metatile scene as a 16x16px tile tileset to build your main scenes. That way you wont end up with unmatched tiles.
Ooh gotchya. I'll take a look at this and move things around. Thanks!
Fixed it. Thanks Mico!
What I'm trying to do now is add a minimap underneath the HUD. It's all working well except for the Up and Down screen transitions, since it's a 20x22 bg instead of a 20x16. Is there something I can adjust in the scene_transtion.c file that would allow the scroll to act similarly to how it does standard (essentially ignoring anything below Y=16 for the up and down transitions)?
Your scene cant be taller than 18 tiles, Your hud is going to be in a separate scene and will need to be submapped to your overlay from that scene.
I've got a seperate scene hud submapped to the overlay. Maybe you'll have an idea here, I'm trying to best implement a minimap that you can all up. My thinking was to essentially hide it behind the hud and more the camera. But, trying to fit 3x3 in there has set the bg to 20x22. I certainly wouldn't mind a map on the hud itself, but I'm looking to call the tiles from a seperate map to tileswap.
the minimap could be hidden within below the hud itself, then you can just pull the hud up further to expose the minimap
Just like how Link's awakening does for dungeon minimap
Would it be possible to put filler tiles in there to swap them with the larger map? Or would all the map tiles need to be in the common tileset?
Yes you can put filler tiles in there if you want, its no different than if it were done on the background.
Oh really? Apologies if this is well know knowledge, but how would I swap tiles from another scene to the overlay?
You use the the "Copy scene submap to overlay" event from the submapping plugin to initialze your hud (which Im guessing you are already doing) And you can use the gbvm operation VM_REPLACE_TILE or this plugin https://github.com/Mico27/gbs-replaceTilesetTilesPlugin to replace the filler tiles to whatever tiles you want.
Cool, I'm getting this set up, very hopeful. Though I'm getting this error when trying to use the plugin.
Oh you arent using 4.2.0 Beta3?
Oh I'm on 4.2 Alpha0. I'll update
you can get it here https://www.patreon.com/posts/149831818
Amazing. Thanks!
More of a general question I think, but maybe you have insight, do you know what this error is about when I try to compile on Beta3?
Did you have an ejected engine? Did you update your plugins?
Engine wasn't ejected but I didn't do any plugin updates.
Released the extended scene stack plugin. (Requires GBStudio 4.2.0 Beta3)
This version wont work with the metatile plugins, I am currently working on implementing it within the metatile plugins as a togglable feature. (so that it doesnt take up space if its not used)
https://github.com/Mico27/gbs-SceneStackExPlugin
The metatile plugins got updated with the extended scene stack support (The example projects makes use of them for reference)
The SceneStackExPlugin also got updated with a fix with a saving/loading bug.
https://github.com/Mico27/gbs-MetatilePlugin
Also added a new plugin that add an extended version of the overlay move to event which allows pixel position and custom movement speed in subpixels.
https://github.com/Mico27/gbs-OverlayMoveExPlugin
I was browsing the new Plugin Manager and I see this message a lot:
Any other plugin that modifies any of these files will not be compatible with this plugin unless the files are manually merged.
What does this mean exactly? I feel like I've used plugins together in the past that modify the same section without doing anything special.
engine plugins replaces engine files. If more than 1 plugin replaces the same engine file, only one of the two will override it. So it will break the functionality of whichever plugin's engine file got overriden by the other plugin.
Hey, I was wondering, is there a tool you guys use to convert several background images into one tileset of 16 x 16 tiles?
I know Chris made this tool: https://codepen.io/roastb/pen/XJbyOWO but it digests images into 8 x 8 tiles, not 16 x 16. I tried modifying his code, but it had weird consequences (I don't know what I'm doing, in other words lol)
Even if you make your tiles to work as 16x16, the game still processes everything in 8x8. Even Mico's metatiles
I just use a 256x256 canvas with a 16x16 grid
Right, but how do you populate that grid? Surely you don't manually copy and paste all your unique 16 x 16 tiles, right? (I swear I'm not trying to be stupid, genuinely looking for an efficient solution)
You can create a 16x16 tileset with this tool
https://yukkitimmy.itch.io/tilemap-to-tileset-online
Perfect! That's exactly the thing I was looking for
I just make it myself
hey, trying to figure out the easiest solution to a problem I've run into with the Edit Active Actor Index plugin - I'd like to remove it, I don't need it, but if I delete the plugin folder no actors load into a scene. I refreshed assets and emptied the build cache, deleted folders for a fresh recompile etc, but no dice. I am not really surprised that it would affect something important with the sprites tbh, but I can't find any remaining uses of it in my scripts or prefabs. Any easy way to look for remnants or scrub it from the project? if no that's no biggie
using 4.2.0-alpha btw
Removing the folder should revert to the default behavior, the issue is probably elsewhere, do you have any other plugin or an ejected engine?
went and looked and Kirby's Render Projectile Above Actor plugin was in there; deleted it and it solved the issue. Which sucks because it was all working together before deleting the Edit Active Actor.... and I do want that one if possible
.... welp I'll play around with it
Thank you very much for the help; I really appreciate how much you do for the GBS community!
my project was working perfectly fine moments ago, but now it's refusing to boot and i always get this error. these are the plugins i had installed. i tried removing some temporarily, but the problem still persisted even when i stripped it down to solely metatiles. is there anything i can do? i'm on the latest supported version.
weird, it looks like you have the file that overrides the interrupt.c file which is only in the scree scroll version of the metatile plugin
Can you open the metatile16Plugin folder to see whats in it
which folders should i check?
engine/src/core
yeah it looks like you have a weird mix of the screenscroll version and the normal version of the metatile plugin
should i try deleting it and reinstalling the plugin?
Yeah delete the whole MetaTile16Plugin folder and redownload it
Just to confirm, its the screenscroll version or the normal version of the metatile16 plugin you wanted?
it works fine now
and yeah i wanted to use metatile16
i don't know how i managed to mix up the plugins tbh
thanks anyways
Hey Mico, there's a conflict between Fade Street and the Screen Scroll plugins. It's funny because wayyyy back in September 2024 you graciously modified the plugin so they'd work together. The funny thing is, I see now you manage the Fade Street plugin 😂 (I think?)
I tried to find the old messages because you explained what specifically was in conflict and how I could fix it, but couldn't find it in the search...
I really appreciate your patience, I'm sure with the update out you must be very busy
I only have the two plugins, no others. This is what the debugger says before cancelling:
Each plugin works individually, but when combined they don't. Let me know if you need more info :) (thanks again)
Something appears to be using an outdated variable name
No, scene_stack_count was added by the metatile plugin, the issue is that its added in data_manager.c which is also overriden by the Fade street plugin
Ahhh
Here I uploaded the merged version of the two conflicting files, just replace those in the fadeStreet plugin folder
https://github.com/Mico27/gbs-fadestreet/tree/main/FadeStreetScreenScrollMetatilePluginCompability/engine/src/core
Thanks!!
Your speed is very appreciated :) I can't thank you enough!
While I'm here, I should tell you that I ran into issues with the pointnclick and shmup state files. I don't need them for my project so the solution for me was just to delete them, but in the interest of sharing, here is what the debugger said for both:
Yeah thats already fixed, I fixed it a day after 4.2 came out.
Hello, I'm trying to compile a project using the ScreenScroll plugin (not the MetaTile16 one) in GB Studio 4.2.1, but it seems that it's not compatible with the new engine version, as it throws a bunch of errors. Is there any solution for this, or are there any plans to update it for the new version of GB Studio? Thanks in advance.
@unreal haven Hi, planning on moving my game project to GBS 4.2.1. Where do I put these metatile codes in platform.c?
You shouldnt need that anymore, you can check the example project of the 8pxMetatile to see how it handles coins in the script with the attach script to a metatile event
I'm using the 16px metatles version. My coin metatile is the second metatile in my metatile scene, what metatile id is it?
that would be 1
Tried compiling your example project. It gave me errors.
@unreal haven There seems to be a confliction between the configloadsave & scene stack ex plugins in my project.
Linking...
?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'load_save'
?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'vm_scene'
1
Cancelled Build
Warnings:
?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'load_save'
?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'vm_scene'
1
Yeah they arent compatible because they change the same engine file load_save.c
You can just delete the load_save.c file from the scene stack plugin.
Just did that. It gave me the same errors.
Can you list all the plugins that you are using?
Here's all the plugins the 4.2 version of my game are using?
You dont need the SceneStackExPlugin since its already integrated in the MetaTile16Plugin
And the ConfigLoadSavePlugin wont work with the metatile plugin unless you do some manual file merging.
Am I doing this right for coin meta tiles?
You dont need to store the engine field in variables to use them, you can compare the engine field directly
How do I do that?
@unreal haven Is ConfigLoadSave still needed for Metatiles in 4.2. Also my platformer has large scenes for levels.
No its not needed, you can just use the normal GBStudio load/save
@unreal haven I removed the ConfigLoadSave plugin from my project. Gives me the same errors
"?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'load_save'
?ASlink-Warning-Undefined Global '_scene_stack_count' referenced by module 'vm_scene'
1
Cancelled Build"
What am I doing wrong? I need help badly
what are all the plugins you are using now?
the spritesheetchangebufferplugin is the problem, it changes the data_manager file which is in conflict with the metatile plugin
Is there a way we can merge both dara_manager files?
Here I merged the plugins for you, you can use this and delete the metatile and spritesheetChangeBuffer plugins
Thank you so much! Another W for the GOAT (Greatest of All Time) 🙂
Is there a way to disable background priority with uiAltDisplayTextPlugin? because this is an issue for the kind of minigame i'm making, where the stats display in the background and sprites can overlap with it.
its the same as without using the plugin. Create a gbvm event with
VM_SET_CONST_UINT8 _overlay_priority, 0
text written after that wont have tile priority on it so sprites will display over it.
thank you, i'll try this later!
do i place the script with the setup scripts or before writing the text?
Sure it can be in a setup script as long as its set before writting any text
got it!
hi first time using the MetaTile8Plugin, i downloaded it from github and GB studio is up to date, everything is set like the readme file and i got a kernel panic :(
am i doing something wrong?
@torn lichen check your metatile settings
The main scenes must respect the dimensions described as such: (the width in tiles rounded to the upper power of two) x (the height in tile) must not exceed the maximum map size configured in the settings (width x height) cannot exceed (8px version) 7936 bytes/tiles (256 bytes are used for dynamic collision data, ex: 255 x 31 in 8px tiles) / (16px version) 7168 bytes/tiles (1024 bytes are used for dynamic collision data, ex: 127 x 56 in 16px tiles).
For example, in your screenshot, the scene is 85 x 39. So the upper power of two of the width for that is 128. 128 x 39 is 4992 bytes/tiles so you are within the limits. You then go in the metatile settings and put scene max width to 128 and max height to 39.
Now that I think about it, I might just remove that setting in the next update and always reserve the maximum size since I changed where save data is put now instead of sharing the same SRAM bank as the metatiles.
I updated the metatile plugins so now its not needed to specify the max scene width/height in settings, also added scene size validations in the load metatile event with a more verbose error message.
Will this work with the merged plugin you made for me?
lemme update the merged plugin I gave you real quick
Are you updated to 4.2.2?
Here's the merged version for 4.2.2
oh wow i didn't thought my issue was going to spawn an update 😅 , huge thanks for the explanation and the update! it works as intented but now i have another issue
when i try to use the fadestreet plugin with the meta tiles it gives me a multiple definition warning and when i tried to use the fadestreet screenscroll meta tiles it seems that it doesnt find the screen_transition.h
are these errors because of compatibility issues or because i'm doing something wrong? please let me know ^^
If you are using the screenScroll version of the metatile plugin with fadestreet, you download both plugins, then you take the files from this folder https://github.com/Mico27/gbs-fadestreet/tree/main/FadeStreetScreenScrollMetatilePluginCompability and replace them in the fadestreet plugin folder
ooh i see, but the thing is that even using the normal metatile plugin it gives me errors
You sure you didnt accidentally install more than one of the version of the metatile plugin? check your plugin folder @torn lichen
I was wondering if you had any pointers or examples on how to do an enemy movement event. MIne keep having issues.
nope, the only version i have downloaded it's the 8px version, here's my plugin folder (also your folder has the inputEX plugin) checking out i realized that there isn't a 8px version of the screenscroll metatile 
the error that i get its the multiple definition one
oh yeah, the fadestreet screenscroll metatile plugin compability is just for that version.
Gimme a moment I'll make a version for the metatile8 plugin
nice! so that's why i got those errors i thought that fadestreet had already compatibility with metatile8
also another thing that i almost forgot, when i used the metatiles, for some reason these tiles dont flip, i have the automatic flip enabled
is that a little 8x8 X?
You need to have the "Must match metatile color attributes" checkbox checked in the load metatiles event
yep! he also got mini like Mario lol
it worked, thanks!
Love it.
thank you, i want to have a little more stuff so i can show progress
rn i only have the simple movement, shooting and charging
Is it OK to use the Super Mario Bros mini custom actor plugin in my game?
Sure, feel free to use whatever from it
Thank you!
hey, i'm wondering if you ever have plans to make an updated version of this for the newest version. i really would like to use a trailing script like this for my project, but my version doesn't support it.
Hi, This might be on my end, but I came across a weird issue.
I have it so that opening the door changes the three tiles behind it
but, it always defaults to changing the tiles at some other random point
I've moved it to show where the metatiles change, instead of where they're supposed to
They show up in the same X coordinates regardless of where I put the door.
whose tile x coordinate its taking from? looks like it might be an offscreen door gate position used making the door appear at its screen warped position
Let me check exactly.
I see my mistake now. I deactivated the actor first.
So, it takes the position of the actor after it's been deactivated I'm assuming.
Thanks!
Hmm weird
I removed the deactivate actor event entirely and it still does the same
I might have messed something up with my plugins, I'll check.
It's odd, I'ts only the X coordnates that are wrong,
The Y coordinates area actually correct.
Put a breakpoint on your script where it assign the metatiles for the door, look at the gbvm in the debugger and look from which actor Idx it is taking the X position
WIll do
It's taking it it from this one
The morph ball
But I have it set to self.
It's definetly that actor, But it's odd. When I shoot the door and go frame by frame, I can't see the script on the door's on hit 3
It starts an empty thread it seems
Yeah, tried it again, when I shoot the door, an empty thread shows up in the debugger.
Ended up saving the values on variables
Has anyone experimented with saving scenes that have altered metatiles? From what I've read it seems possible, but a bit beyond my skill set.
Why does this happen?
If I have this script on INIT
The graphics are messed up
For a second when a new scene loads.
But if I disable that script, no problems
If I had to guess it would be a ram overflow
seems really weird, you checked if the fade in/out events? if it's in instant and if you aren't using common tilesets it can look glichty
Hi Mico, do you have any update on this? 
There some big things in the work for plugins combability in the next GBStudio update, I should have something soon after then.
i've seen what you shared about that, im exited! thanks for letting me know ^^
Oh btw, sorry about the text on the second room, It's a joke meant for my brother.
Thanks! I was struggling with that
is there a method for animating a metatile?
You can have animated tile (like animated water/waterfall/flower) the same way as before, but the technique is a bit different, since GBStudio default Replace tile at position, it will try to get the id of the tile at the position to know which tile in the tileset to change. But since the metatile changes the id for the metatile idx instead of the tileset tile idx, then it will not change the correct tile in the tileset.
The other technique to achieve that is by using GBVM with VM_REPLACE_TILE Or you can use this plugin https://github.com/Mico27/gbs-replaceTilesetTilesPlugin which implement VM_REPLACE_TILE in a usable event.
Unless you mean animating tiles separately, then you'll need to create a metatile for each animation frame and use the replace meta tile event (but that will be more ineficient if there are many tiles at once)
Alternatively it could be a mix of both! Like having a tile that represent a character that can walk, you can have a metatile of the character idle state, and one metatile of the character walking state.
Then you use the replace meta tile event when one character change between states and have a timer that replaces the walking state metatile's tiles to animate the walking for all characters that are in a walking state.
I'm officially a convert to this metatile idea. I had been struggling and frustrated when trying to adapt my old scenes to work with metatiles.
This week I started working on a new section of the game. I built these new maps and background tiles with the metatiles in mind, and everything is so much smoother. It feels awesome to make a map in Tiled, drop it into a new scene, and then be done. No more repainting the scene every time I update the background image. No more weird bugs because I accidentally added collision to a scene while dragging things around.
I just wanted to say thanks. It's a cool tool now that I'm getting the hang of using it.
It's crazy how streamlined level design becomes once it's all set up.
On the offchance someone might find these useful, here's a cheat sheet I made for the 16px metatile values.
It's sized at 256x256 pixels, so you can lay it directly over the metatile scene (e.g. in a graphics editor) and quickly find the value you need. I made it in two different colours, the purple is a bit more legible.
I need one for 8x8 😅 super useful!
Can I have metatiles that the are same but use a different palette?
Or do they all have to be unique
And is the 256 metatile maximum for both the metstiles16 and metatiles8?
No each metatile has a palette idx assigned to it, so if you want a metatile with a different palette idx, you create a new metatile with it.
Also if you do that, you'll have to make sure you have the "must match color attribute" checkbox checked in the load metatile event and you have to color you main scene to match the metatile scene so that it can find which color metatile to use.
Also 256 metatile maximum for both yes.
Awesome thank you!
Is it possible to use metatiles8 and metatiles16 in the same project? In different scenes, obviously
@unreal haven forgive me if this is inappropriate, but I was curious to know if there was a chance I could commission a version of the metatile8 plugin that is able to save the metatile data changes to the scene - if that's something you think is possible?
No its one or the other.
It could be possible. but that would reduce saving to only a single save slot.
If it's feasible, even with it bring reduced to a single save slot thats something I'd be interested in!
I'll see what I can do
1```
I get this error when trying to compile a build with Screen Scroll, any insight? I don't know what this means, and I searched 'current_text_layer' in the Discord with no results
Are you using some other plugins
yes,
- mikeliesz's Invert Background Fill plugin
- your UIAltTextDisplay plugin, the replaceTilesetTiles plugin, and SubmappingEx
- pautomas's AdvancedMenu plugin
- two custom plugins for SpellData to RAM and WeaponData to RAM
could that be the problem?
probably the Invert Background Fill plugin or AdvancedMenu plugin, whichever is editing the vm_ui.h file
ah ok. drats, I will see about fixing this by removing either and seeing if compiling works again
AdvancedMenu doesn’t modify the engine so might be the other one
started a fresh project with only the Screen Scroll plugin used as outlined in the README and I get this
should I try uninstalling + reinstalling GB studio?
ah it worked once I switched scene type to Adventure mode and then back to Top Down 2D
Is it possible for me to combine elements of the 8x8 meta tile plugin and the 16x16 screenscroll plugin to create an 8x8 screenscroll plugin?
I think I could use it to solve some scripting challenges I've been having.
I already made it possible to combine the 8x8 metatile plugin with the screenscroll plugin but that needs the new plugin patching feature which will be available when chris decides to release 4.2.3.
(in fact when thats gonna be released, all my plugins will be compatible with each others, so merging plugins manualy wont be necessary anymore)
That's awesome!
I haven't tried the 8x8 plugin yet. Should I expect any hit to performance due to the increased number of meta tile events being triggered?
This was a dumb question, or at least something I can find my own answer for. I'll set up an 8x8 version tonight and see how it does.
Regarding 'commit render' needing to be checked or unchecked when setting a metatile, I'm finding that some tiles which are located just offscreen will not be rendered once they do appear onscreen. Is there some sort of 'buffer zone' outside the screen edge where 'commit render' should still be checked?
(I'm still on 4.1.3 btw, can't update or I'll lose some plugin support)
This is for 16px metatile, non-scrolling
yes, in general just keep it checked as long as its within 10 tile from the edge of the screen
Ah ok that's heaps! Thanks
does the metatile plugin support setting collision to an 8x8 tile?
nevermind, I just looked at the git for it. will try it out to answer my own question :)
I have a monochrome project, and for whatever reason. It's taking AGES to compile, around 6 to 7 minutes. The only plugin I'm using is the metatile 8x8 plugin And I haven't even included any metatile events.
Could there be a reason for that?
This is the barest bones version of the project, only 1 BG and the metatile scene.
If anyone else that has used the 8x8 metatile plugin has any tips, i'd appreciate it.
I think I can kind of confirm the metatile plugin on monochrome it's what's causing the project to take so long to compile
I disabled the load metatile event, it compiled way faster
Shouldnt have anything to do with the fact that you are on monochrome, if you have a slow pc and depending the size and amount of your scenes compiling the metatiles with the load metatile event may take a while.
And like everything else, the first time you compile it needs to compile the engine so that will always take long the first time or when to edit the settings.
Problem is, this is the only metatile project that takes this long
Sent it to 2bitcrook and he seems to be having the same issue, with this project in particular.
My compile times on other metatile projects are fine. Which is why I'm baffled.
And yeah, you're right, monochrome has nothing to do with it, I tried enabling color..
Could I trouble someone here to try compiling that project
If you can send me the project I can try to figure out what might be different causing the problem
@rocky prairie Ok I figured out the issue, with the way your metatiles are layed out, it needs to traverse the whole metatile sheet to find matches for tiles that are used a lot in the scene.
I added a counter to see how many iteration it was doing to do the metatile match and it was reaching 946750 iterations.
I did a test by moving the most used tiles in the background (the plain white/grey/black tiles) that were at the end of the metatiles and put it at the start and that reduced it to 124609 (thats about 86% reduction of compile time)
It could probably be optimized to compile faster by checking which tiles are the most common in the main scenes and priorize placing them early in the metatile sheet
just doing that many iterations should'nt take that long, but the way custom plugins are implemented in GBStudio their speed performance is gimped by the QuickJS sandbox (see chris comment)
https://github.com/chrismaltby/gb-studio/issues/1966
Its been reported to me a few time for one of my plugin that they hit the 1 minute timeout that was set on plugin compilations Mico27/gbs-MetatilePlugin#5 This one can be particularly long to compi...
I see, so I should place the tiles that repeat the most first, and the ones that aren't that common after those?
yes, if you want to optimize compile time thats what you'll have to do.
From six mins to half a minute ain't half bad. @unreal haven Thanks!
I'll try and make a tool that tells you which metatiles are used the most and sort them in descending order. That should help compile times for big projects.
Dont worry about making a tool for it,
I just realized that I could just optimize the compilation code to create lookups for the metatiles during compilation instead of iterating them each time to check for a match on a tile in the main scene. That way you wont even need to bother with having the most used tiles at the start of the metatiles
that would make it constantly only do only 5590 iterations (in the case of your scene size)
I'll whip something up later and do some tests with the project you gave me
ok yeah, dunno why I didnt use lookups before, this will help for scaling projects without having huge compile times
gonna push the changes in a moment
@rocky prairie Here I pushed the optimisations, its much faster now and you dont have to worry about the order of your metatiles
https://github.com/Mico27/gbs-MetatilePlugin
Thanks a million!
Does having multiple, ON METATILE COLLISION/ENTER instances slow down the game? Are these done on update?
Its just like register on input, you can have one per directions. Obviously if you add more directions, will check more directions at a time, thus using more computation time. these are checked in the scene type code every frame.
Understood! Yeah, we switched to 16x16, because having each corner of the coin tile have a script on enter made the game chug,
for better optimization, you can put any interactable metatiles like coins and blocks at the end of the metatiles and increase these values in the settings, so that it doesnt have to trigger for every background tiles
WIll try it!
It's running much better now! Thanks!
Does this file work for getting FS to work with the non screen scroll metatile16 plugin?
No it would require some changes. There's a new patching system coming in the next update that will fix these compatibilities issues. So you'll either have to fix the compatibility yourself by removing any reference to the screen scroll plugin in it or wait for the next GBStudio update .
If I need it before then, I will manually patch, thanks
I was having an issue, where power ups would spawn off if I hit the right side of the 16x16 tile
It's sort of hacky and I think it might break but this is how I fixed it.
This way, even if I hit the right side of the block, it ''snaps'' back to the correct spot.
Is there another way to make the 16x16 tile collided represent the whole tile and not one of its quadrants?
Items now always spawn centered
yeah this is fine, if you dont care about which 8x8 position of the collision you collided with and always want the 16x16 position then that works.
I'm also making a Mario fangame. Can you please teach me the item spawn hack? Also, love the Rareware-esque Mario Land theme.
Sure, dm me and I can share the project files, it's actually a rather short script for the power ups and collectables.
I'm remaking my project in the latest version of gbstudio.
I'm using metatiles16sidescroll and submappingEX.
Previously, I had no problems submapping from another scene (it works here too) but when trying to submap metatiles to restore the scene to its original metatiles (removing the submapping) i'm having some issues.
the submap metatiles doesn't seem to be selecting the correct metatiles i'm trying to restore, and it will only render 1 tile worth of height regardless to what I have the number set to.
any thoughts?
Can you show the script that restore your scene
yup! at this point i am just trying to clear the top row (10 tiles width, 2 tiles high) and revert it to its original state.
it's the same method I used in 4.1
yeah looks like Im able to reproduce the issue, I'll fix it real quick
i'm gonna have to add you to the credits at this point haha, thank you!
Here I fixed it
https://github.com/Mico27/gbs-MetatilePlugin
Thank you Sir! Working perfect now. Just needs some fine tuning
Just wanted to say that I appreciate scene scroll plugin so much, couldn't be easier to use and got it working without an issue in under two minutes.
I'm noticing a bit of an elastic effect when traveling from neighboring scenes up/down, but side to side seems fine. Any ideas?
If you are displaying a hud at the bottom your background height needs to compensate for that, so your background height in this case needs to be 16 tile high.
Also can you show your settings
Hah, it was the bottom margin setting. I didn't know that was a thing, I adjusted it to 2 and it's fine now.
Now I'm just trying to work out my sub mapping on neighboring scenes since the coordinates are a bit different depending on the direction
You can use value of the scroll offset in the engine field (not needed for metatile submap since its already integrated in the plugin but its needed for the non-metatile submapping)
why don't i have the "+" to add to the offset to the value?
learned something new today! thank you!
is there any way to submap something to the background of a scene that is using metatiles from a scene that is not from the metatile scene?
If you are talking about the non-metatile submapping, it should work normaly as long as both scenes have the same common tileset
I think I can get around this. It appears that as long as the scenes share a common tileset, moving between them is fine - so if they have different metatiles loaded I can submap the different assets that i need, since each of the loaded metatiles shares all the same scene assets.
I think that's what I just discovered, it seems to work for what I need which is great.
scratch that, that method does not work lol.
You could have a switch and load different metatiles on init depending on the monster you're using? I'm just spitballing.
Though, instead of metatiles, you'd want to alter the tileset itself
The loaded metatiles don't seem to matter, if it's not in the common tileset it doesn't seem to want to render. I've only tried different metatiles on init, though. So maybe switching them after init could work?
Is there a command for that?
I believe Mico's "replace tileset tiles" plugin works
Metatiles are just logical associations of tiles in the tileset, so if the graphics aren't in the tileset, you won't be able to load them via metatiles. What I do is hold some tiles as "placeholders" and then use them in metatiles as necessary, and then swap the raw tile data when needed for the desired effect
I'll have to give it a try and report back. Thanks for the idea!
Can the replace tileset tiles plugin replace using 16x16 or is it strictly 8x8
Strictly 8x8
I figured, thank you!
How do you guys keep track of the IDs of your metatile tiles? That's the biggest thing holding me back lol
I just keep track of it from my metatile scene...
I have a fair bit of blank tiles in my metatile scene because I've been leaving space for new assets which throws me off because those duplicate tiles throw off the tile id for everything afterwards 😅
Is there a way to make duplicates have seperate tile IDs?
Use unique placeholder tiles :/
does the metatile plugin have a version that works with GBS 4.1.3?
All of it
i just attempted a quick proof of concept test using the replace tileset tiles to swap out some metatiles in my metatile tileset, but ended up with this error:
BankPack: ERROR! Area CODE, bank 255, size 16386 is too large for bank size 16384 (file /var/folders/cw/w9lvfkvn2wx00rzfw603zygr0000gn/T/_gbsbuild/obj/tileset_swaptest.o)
?ASlink-Error-<cannot open> : "/var/folders/cw/w9lvfkvn2wx00rzfw603zygr0000gn/T/lcc53360.lk"
I was only trying to swap one new unique tile onto the metatile tileset, i must be doing something wrong lol
The tileset you are using to swap tiles is too big
does it swap the entire tileset?
No, it has to store the tileset in the ROM when compiling so that you can actualy use it
and it exceeds the max size of a ROM bank
I'd suggest splitting your tileset
i used a 256x256 canvas size for the tileset i was swapping from, which seemed to be the problem lol. I reduced the size of the canvas and it worked fine!
Yeah its important to optimize your tileset, the compiler wont do it for you.
Cool, got it working. Took a second though lol. I've successfully swapped tiles onto the tileset - but now I'm trying to figure out the best way to replace these placeholder tiles with blank ones. I don't think I can remove them during the actual process because then it skips over the non unique tiles and messes up the placements.
I'll probably just have to see how smooth I can get a manual tile swap for each monster to look
I used a palette swap at the start of the tileset changes to hide everything, then set it back after the changes so the placeholder tiles never show. success!
First change is without the palette change, second is with it. There's a little flicker, but in practice it wont be swapping the palette of the entire scene, just the 56x56 area.
thanks for all the help (and patience)!
how exactly does the collision setting work? does it require metatiles to be placed first? can I add collision to tiles that were not placed by the metatile plugin?
- You can't mix metatiles and regular tiles in the same scene, and metatiles will override everything
- set collision in your metatile source scene
what does this mean?
Error: Compiling "EVENT_LOAD_META_TILES" failed with error "Error: Cannot find matching metatile for tile at coordinate 0, 0". {"scene":"small game/game","scriptType":"scene"}
There's a metatile which doesn't match any of the metatiles in your source scene
Specifically, the first one
so I have to make sure that they are in the scene...?
You can only use metatiles which are in your source scene, yeah
When you use the "load meta tiles" event, you choose a scene as the source. That scene is different from the one you use it in
so then what is the point of "loading" them from a different scene?
I'm very confused as to how this all works
Basically, it compresses individual scene sizes by using a reference to an existing meta tile set rather than saving each tile individually
When you use the load event, it tells the compiler to replace all "tiles" in that data bank with references to meta tiles, which are significantly less memory-consumptive
It does nothing in the editor, but it saves memory in the final compiled rom
The "source" scene will have its metatiles compiled to be used as the reference
can I be informed as to how this is incorrect?
Can you send a screenshot of the load meta tiles event?
It's because the other tiles in that 'game' scene aren't in the metatile source scene
You can't mix and match, you either do all metatiles or no metatiles
(per scene)
I copied it over from the external to the source though...
i'm working on optimizing my metatiles sheet and tileset - to my understanding for metatiles16, the metatile scene itself needs to be comprised of 16x16 tiles, but my tileset can be a map of 8x8 tiles, correct?
Yeah. The raw tileset is always 8x8 (that's all the gameboy hardware understands), metatiles are logical (implemented in code only)
fantastic. that's what I thought! thank you (again!)
I have the HUD submapped onto the background of Scene 1 - when I scroll to Scene 2 it never initialises the HUD again despite it having the same scripts in scene's INIT as it does in Scene 1.
Any thoughts on how to keep it persistent since its background? Should I copy it to Overlay before changing scene and then disable overlay?
If you are using scene scroll, your hud should be drawn on the overlay by submapping it from your hud scene
Gotcha, I'll have to work on it since it's just practice on a LA clone so background HUD was my first thought
Hey Mico how much did you modify topdown.c for metatile and screenscroll?
I want to incorporate your plugins but I have already heavily modified topdown.c
look at the code where there are metatile related #ifdefs, those are the things that were added
Great, thank you! I'll see if I can merge them.
Also is there an 8x8 screen scroll? I read that you're waiting for the next GBS to release it widely
What does must match color attributes do?
It means the palette data for metatiles in regular scenes must match the palette data for the metatile source scene, allowing for different metatiles to use the same tile data and differing only in color data.
But if you don't color your regular scenes, it'll throw an error because it can't find a matching metatile
Would it be possible with the "Submapping Ex Plugin" to also copy from Overlay to background ? I want to use the Overlay for a Zeldalike menu but also use Chatboxes. Idea was to copy the overlay on the background and then start the chat. At the end of the dialog i recall the other overlay (hopeful smooth enough that you cant see it 😉
No you cant submap something that was written on the overlay on the background, you can only submap from ROM data (ie from the background data)
If you are using the overlay for the hud and need the overlay to display dialogue, you'll have to rerender your hud on the overlay once you're done displaying the dialogue.
Or you can do like what the zelda game does and draw dialogue on the background.
Is there a setting to increase the speed of the screen scrolling?
Yes you can edit the SCROLL_CAM_SPEED in engine/include/scene_transition.h
You can ramp it up to 255, higher than that and it breaks.
I'll look into adding it as a setting to the plugin in a later version for easier access.
Awesome, thank you! I'll play around with it.
you might also want to increase scroll_player_speed to 32 if you increase the camera speed to 255
opened a blank project to do some testing with the sidescroll plugin - but it's acting a bit weird? there seems to be no issued going right/down but going left/up disables player movement and doesn't seem to be placing the player in the proper position. I do have round to the nearest tile checked, and i don't see anything weird with the sprite itself.
Any ideas?
the settings also seem to be missing some options, like the top scroll ofset for hud
I was using the plugin directly from the plugin manager inside gbstudio. just swapped it out with the latest version and its fine lol
but i am curious to see if there's a way to eliminate this little player flicker when going up. or if not - create it when going all directions. just for consistency lol
Not sure what you are doing different, works fine in the example project.
I've never seen that. Empty frame in animation state?
no empty frames, i'll have to see if i can figure out why it's happening lol
Hey I'm running into a problem with the overlay where submapping from the BG causes jumbled tiles on the overlay. (When the arrow touches that tile it sets the overlay and copies the BG to the overlay).
If I disable the Load Metatiles event on the scene it seems to work correctly.
Has anyone else run into this?
You cant submap from a background that was converted to use metatile into the overlay, because the ids are changed to metatiles instead of the actual tiles
Does metatile also incorporate additional custom collision tiles defined in engine.json?
And also collision tile overlap like a ladder over a solid?
collisions are the same as without the metatile plugin
Any idea why the overlay bottom part is like this?
This is the initialization
(my HUD does not have the scroll animation like in the example in the github, having a reduced size)
OH, maybe I know what's wrong
Could it be something along these lines?
Is it using the metatile ids for the current scene (still the overworld) for the overlay tiles from the HUD until it loads the scene completely?
But, why isn't it rewritting the numbers and the right part of the scroll?
They're also part of the HUD tileset
There's a reason why it does a scrolling animation in the example project when it opens the hud, so that it hides the tile glitching when changing tileset for the inventory menu. of course if you remove that it will show the glitching. if you design your own hud and tileset you have to into account these things
btw thats not just a metatile plugin thing, thats just tile management on the gameboy in general. if you want to switch view between a set of tiles A into a set of tiles B, you either
- hide the whole screen (fade out) before changing the tileset (basicaly the most basic method)
- have a common set of tiles at the same indexes between tilesetA and tilesetB that you display during the transition
in my example project its a variation on the second method, of which the tiles for the unscrolled scroll and top of the hud are shared between the main scene and the menu scene,
once the main scene is completely hidden from the overlay which displays the common tiles I load the menu's tileset (changing scene to the menu) then "unroll" the scroll overlay to reveal the menu
So by removing the scrolling of the menu, you are exposing non-shared tiles that were supposed to be hidden by it, revealing the glitching from switchinh tileset while old tiles nonmatching to the new tileset are still on screen
Is it possible to have a metatile that is visually identical but has a different ID?
Yes, but during the matching it'll will assign the first one it find that matches the visual (and color, and collision depending if you have those option checked)
If you want that other metatile that has the same visual but a different ID you'll have to assign it manualy after the load metatile event with the Assign meta tiles event
Okay, so if my top row of metatiles is all identical, but I manually assign them on init, I will be able to keep track of which one is technically "unique"?
yeah
Also the metatile submapping is not behaving as I'd expect. I'm putting in coordinates to submap from the metatiles scene but not getting the tiles I would expect. Is there a trick I'm not figuring out? I've been using your submapping plugin for a while.
Are you using the metatile submapping event of the non-metatile submapping event
The metatile version
There was a bug with the metatile submapping 2 weeks ago and fixed it, just update it from the github https://github.com/Mico27/gbs-MetatilePlugin and it should work correctly
I'm wondering if there's a straightforward way to do something like "find the nearest metatile with ID of x"
You can set an invisible actor and script it to loop: set position relative +1, check tile ID. End loop when ID is found.
I used that "scanning" method to set up some procedurally generated scenes. But you can make the scanning pattern whatever you want
I was wondering about something like this, but I worry that it will take too much processing time in my use case.
You can run it in a thread an see!
The tilemap 256x256(GBC) on the Scene, its never loaded itself on the screen so i could have more unique tiles on it then the warning suggest or i still need to stay in that range ? Also the Overlay Tiles dont need to be on it ? The ones that are Saved as real Tilesets can be smaller what is the Minimum and Maximum size? And did i need to have also all what i want to load on the UI in that tilset or is it enouth to have one only for UI ?
Any tile that is displayed on screen needs to be loaded in the tileset VRAM, for tilemap tiles (that means background tile and overlay tiles) they can have up to 256 unique tile (or 512 in color only) of which half of the tile estate space is shared with object/sprite tiles. In GBStudio, the default dialogue system reserves itself a part of it to write text/dialogue box into which is why there is a warning when the amount of unique tiles exceeds 192 (384 in color only). But that can be ignored and bumped to the actual limit if you dont need the default dialogue system.
So you have to take into account that the tileset you display for your UI needs to be loaded in VRAM as well as your background tileset. You can either make the UI tileset merged with the background tileset and use it as a common tileset for your scene (simplest way) or you load tilesets of your UI manualy separately at an offset in the tileset VRAM and submap the tiles by taking account of the tile id offset (require that you know what you're doing)
Is it possible to adjust the screen scroll camera's starting and ending point? Like if I wanted it to end 8px further into a scene instead of at the edge?
no
Thanks!
I am a littlebit confused since i update to 4.2.2 the "Copy scene submap to overlay" is not working as before anymore (i think i do something wrong but i cant figure it out). In you Example you use another Tilemap for the "HudMenu" when i do not use the same as in the scene that i am it breaks the UI and i cant figure out why 🤔 I think it was working before the Update
Your common tileset are different
If they are different the Hud tiles position in the tileset of UI_Tiles have to match the position of the hud tiles in the tileset of Indoor
So best is to have all the Tilesets at the same size so they get loaded in the same order ?
I've been trying to update my game after the 4.2 update. The scroll plugin worked perfect before but now, while up and down works fine, I'm getting some strange overlap when going left and right. Any idea of the cause?
You are using the metatile version right?
Yes, I believe so
So you are dynamicaly replacing tiles when loading a scene right?
Ah I see the issue, I forgot to add the check to commit the tile change to also check if the scene is scrolling when I refactored the function for 4.2
So since you have 'commit" checked in your replace metatile event, it updates the tilemap VRAM so you see it warped on the horizontal scroll because the tilemap VRAM is 32 x 32 while the screen is 20x16 (the bottom 2 hidden by the hud)
Ah gotchya. Anything I can or should adjust on my end?
No I'll fix it in a second
Thanks! I'll give it a test
Works great, thanks!
Unsure if this has been asked before. I'm using the scene scroll plugin and I am drawing text to the overlay (bottom) to easily update some information, it seems to stop the plugin from changing scenes?
How so?
The player just freezes on the border of the scene and nothing happens. When I disable the text drawn to the overlay, it works.
Is the text being drawn at the same time the player transition is happening?
It's on scene init, so I wonder if that's interfering - I'll see if that's what's going it
Tried delaying it, as well as putting it on a trigger so it doesn't occur on scene init or when the scene change occurs, but it's still the same result of the player freezing in place. it doesn't seem to like something being drawn on the overlay
Are you using the top down scene type?
How big is your scene? I assume it's 20x16 to allow for UI tiles at the bottom but it can't hurt to check. Also are you moving the player yourself or is it spawning at the edge of the screen?
Yeah 20/16. I'm moving the player myself as well. Just freezes in place before the screen is supposed to scroll
removed all the plugins but scenescroll, still occurs.
So i've got the attach script to metatile event working, but it only seems to activate when entering the tile when going up/left, not down/right. Am i missing something?
Outside of that, i'm wondering if i can speed up how fast the check is for the event. at 1/2 speed it catches every metatile change, at 1 speed it seems to only catch every other tile.
I wouldnt recommend using 16px grid mode in topdown view with the plugin as it is quite buggy
I'll try it in 8x8px grid and see how it works.
it works perfectly in 8x8px mode. checks the tile every step!
Now i just need to figure out why the screen wont scroll when there is text drawn on the overlay
I just tested this and it happens to me too if the draw event is in the scene init
I'm afk, but I didn't try doing it from an actors on init to see if it made a difference.
I just tested an enemy init script, looks like it will freeze with that too.
So far when you scroll to a scene that is drawing text to the overlay on Scene Init or Actor Init it will freeze the game
Text writing and dialogue will hold the thread wherever it is placed,
on init is a locked thread by default and in the code for scene transition, I am making sure the init script is completed before starting the transition process
So it then becomes frozen because of that. To fix the issue, in the init script just before displaying your text, add a script unlock and an idle event, this will fix the issue
Works like a charm. Thanks Mico!
Is it possible to merge 8x8 metatile with screen scroll? Where would I start?
Gotcha, thank you!
I'm thinking about using the AltDisplayText Plugin as some of my scenes use a lot of text, and I find myself having to "refresh" certain elements every time a choice is made via menu.
Will that plugin work in DMG or is it color only?
works on DMG yes
Is a metatile leave event something achievable?
Or am I being able to simulate something like that?
I want to change the player animation if they get close to an edge (simulated by a metatile enter event in a void tile), and then change back once I get back
Also, is checking metatiles in a radius around an actor something doable?
I added an example of scripting a hole like in links awakening in the example project
https://github.com/Mico27/gbs-MetatilePlugin/tree/main/MetaTile16_ScreenScrollPluginExample
Would probably be too heavy to do in script, would be faster to do in C in engine.
But also that depends if its something you are running just once or every frame.
Also you might want to consider if its really needed for what you are trying to achieve.
My goal is to have an actor of some sorts the player can push around that changes tile X to tile Y in a radius around it. The tile Y changes back to tile X when not in range of the radius
But ye, I never dabled with C and engine stuff 🥲
Ye, but the exit clause of this is basically just a "respawn" after actually falling. I wanted to change the animation once I enter that metatile, but not fall entirely, giving me a chance to get back before falling, changing the animation back to a default state
I'm guessing that's not possible
did you not check the example? you can see there,'s exactly what you describe in it, falling isnt the only exit clause, you can try walking off from the edge to get back from falling, its even in the video
Uh
I must have not seen that
I admite I didnt see the whole video, I thought it was just always falling down
Ill download it and re check it a
I'm still getting unexpected results when using the submap metatiles event. I updated from the repo with no change. Any thoughts? Thanks.
Make sure that both scene load the same metatile scene and have the same common tileset
I'm drawing text on the overlay, that fix doesn't seem to be working for it?
Even without drawing text and having show overlay active, it stops the transition
what are you doing in your scene init
I have everything disabled currently except for the display overlay which is in the scene init. When I disable that as well it works fine
yes if you use the overlay move to event, it generates a VM_OVERLAY_WAIT gbvm operation which waits the thread (which is the gbvm operation that is also generated when displaying text) , so if the scene init script isnt unlocked and idled like I said previously, it will freeze
So if you use the overlay move to event, you still have to do the unlock + idle before it
That all makes sense, but it doesn't seem to be working for me for some reason lol
Hah, there was a close-non modal diaglogue that wasn't disabled, and that must act the same. Got it working
This is probably super out there, but i'm looking for information to solve this incompatibility between the top down followers and scene scroll.
one scene scroll, the followers try to go to the players location, but they think the coordinates are the exit coordinates from the previous scene. Anyone got any ideas?
I was able to keep them under control in a previous gbstudio version using triggers at each of the entrances/exits for each scene, but i havent had much luck so far
You might want to activate the followers in the new scene only after the scrolling is done