#Mico GBS Plugins
1 messages · Page 2 of 1
i realized these plugins are made for a newer version of gbs, the latest being 4.1.3 but the plugins are made for 4.2.0????
it doesnt even exist yet
It does exist. It's just not as easily downloadable as it's the development branch of GBS and thus more experimental.
The metatiles plugin should work just fine in v4.1.3, you just can't open the demo projects with it.
it doesnt want to
either that or its because of the scene size being 128 z 128
Try making it 160x144 and try again.
okay so i tried it
finally
and it leads to a cancelled build
this is all that happens
Usually I get that when I cancel the build on accident. Does this happen consistently?
If it's just once, you may have accidentally cancelled the build.
(Ctrl+B both starts and cancels testplay building.)
yes
If it always happens and you're not somehow interrupting the build, that's not something I can help with, unfortunately. Maybe Mico27 knows what could be going on.
alright
im trying to figure out how this works
rn
im looking at the files of the demo project
Attach Script To Input Ex always shows its name as this for me, which is a bit confusing. Is this a bug?
Fixed
Thanks!
hey @unreal haven im sorry to bother you, but i was using the metatile8 plugin and when i tried to compile the game it shows this
Well I dont know your setup, have you created a new project with just the plugin? whats the scenes you have, what does the scripts look like? It cancelling without any error is weird so I need more info
alright
these are all the plugins i have
metatile room
testroom
this is what happens when i run it
ok, first off, the metatiles you are using was designed for color only mode, because it contains 512 unique tiles, if you want to design for DMG only you can only have 256 unique tiles max
(and make sure its "color only" mode, not "mono + color" mode)
Second, unless you have tiles with similar graphics with different collision data, you can uncheck the "must match metatile colision" checkbox in the load metatile event. If you have that checked, you have to also paint collision data in the main scene to match the metatiles collisions.
@dense notch Fix those 2 issues and check if it build after, if it still fail, try deleting the other plugins 1 by 1 to figure out if its an issue with other plugins.
alright
My game is "Mono + Color," Is it possible to have more than one common tileset for different levels?
No, common tilesets are always limited to one per Scene.
I meant having a different common tilesets for a different scenes.
Sure, that's possible.
But if you're trying to use the submapping plugin and have shared tiles in different locations for common tilesets it may give issues. I'm unsure about metatiles, though.
Wanted to share my info regarding using metatiles for coins. It's pretty barebones but it may help others looking to do something similar. Feel free to correct me if I got something wrong
(Fixed below)
Just want to correct that the tile_id is the index of the metatile (the nth tile defined in the metatile scene) and not the VRAM tile.
It just may appear the same in the 8px version of the metatile plugin if all of your metatiles happens to reflect what the VRAM displays.
Hi there, I noticed a conflict between GBS-simulateInputPlugin and GBS-SetProjectileRenderOrder. If the latter is present in the project, the former won't work at all
Yeah, both replace the core.c file
Ah, darn. Is there any way I could combine them?
yeah, just merge them manualy
Once I've merged them, do I replace the core.c file in both plugins with the merged version?
Seems like that worked. Just thought I'd ask, as I haven't done this before. But it works. Great!
Hi everyone. Metatiles are working great for Mario coin-like collectibles in my game, however the collected coins wont be saved when changing scenes. This allows the player to effectivley farm infinite coins.
I have devised a solution where Flags are used to remember collected coins throughout scenes. When hitting a coin metatile, its X and Y coordinates will be saved through platform.c. Then, a switch/if statement will check to see if $hitblockx and $hitblocky match up with predetermined coordinates of coin. If so, a flag will be set, and the coin will be replaced with a blank tile. This script gets called at the start of the scene and every time a coin is collected, so at the start of the scene, if a coin has a flag, it will be replaced with a blank tile On Init.
This requires 1 variable per 16 coins and is a bit strict to set up, but its the only way I can think of in order for the game to remember what coins have been collected. Anyone else have a better solution or other ideas?
Sounds about the right way to do this
@unreal haven I think that using Player X or Player Y coordinate fields in the Metatile plugin's events does not function. Using this setup does not work,
but using this setup functions well.
hi, the attach button ex isnt showing up on my events tab im using 3.2 does it work on 3.2? may i ask what to do to use it on 3.2?
New plugin to add to the heap
https://github.com/Mico27/gbs-flickerActorPlugin
Very very cool. Is there any performance hit with this?
I’d check but I’m on a train !:(
looking forward to trying this.
There shouldnt be any significant performance hit.
as all Im doing is poping the last actor of the active list (rendering list) and pushing it back after the actor rendering loop
this basically shift the actors sprites rendering order in the OAM every frame
By doing so, the "culled" sprites will change every frame (because it is dependant on OAM order)
Fantastic work. I’ll give this a spin for sure.
where is this check_player_metatiles function for scripting? is it part of Metatile16?
what plugin is this ?
This is not part of the metatile plugin, its just something custom I scavenged from the mario mini for the demo project.
To get the metatile on which the player is, you use this event with the player tile position
ok so after I did that and get the metatile how would I replace that single metatile?
essentially checking if an actor is touching a specific metatile I want to replace it and do logic
To replace a single meta tile you use this event
commit render is checked if you change an on-screen tile, and unchecked if its an off-screen tile
so I would feed that $local 0 var into the x and y?
no, in the screenshot I posted, you'd use local 0 to check if it matches the metatile id you want to do something on, then in the assign meta tiles (assuming you are changing the same tile you are checking) you put the player tile position in the X and Y and put the new metatile Id you want at that position.
like this for example
thank you
I am trying this on a pinned actors update script but my $tile var isn't changing from 0 as I move around and through metatiles.
I am using player tile X and Y
try doing this instead
the player coordinates are updating the variables correctly?
yes
What does your scene look like?
well most of your tiles are using id 0, when you move over the question mark block it doesnt set the variable Tile to 3?
it does not
try removing the assign metatile event
I even took the collision off it so I could go inside it
to test
ok
still zero with that removed
okay further testing it does sometimes
was my issue perhaps the update script running to fast?
and it was switching it to zero
is doing all this on a pin actors update the best way to do it?
yeah I am adding a "test" dialogue on collision with id3 and its working
So it should work if you change your switch case to 3 instead of 2, not sure if you have anything else setting the tile value to 0, but if you change the metatile to 0, it will immediately set the variable to zero on the next frame when it reads it again
tbh, idealy it would be best to check it in the scene type in c code so that it checks only when you change tile, but script only wise, you'll have to put it in a thread loop or in an update (and add waits if it becomes too heavy on performance)
ok great
Works a treat and doesn't seem to have any noticeable effect on FPS so \o/ Thank you!
#works-in-progress message
hey! @unreal haven found a big issue with the copy scene pallete, if the copied area is off screen it doesnt seem to copy it correctly!
copy scene pallete doesnt copy an area, it copies the color pallettes of another scene, did you meants the submaping plugin?
ohh yeah i think so! mixing it with that causes issues 😵💫
Submapping wont work for offscreen stuff
no it does work! like it prints the tiles, but they dont copy the colors, anyway around this mico? 😊
No thats what Im saying, it copies the scene colors, but when you submap tile it'll copy the color idx to tiles too, so if you submap those offscreen, when you scroll the camera it'll reset those color informations
ahhh any solution? you know possible @unreal haven
cant u copy palletes off screen at all @unreal haven
Like I said, the issue if the scrolling code that resets the color palette indexes on the tiles that were offscreen.
So there could be two solution to this, either disabling the normal scrolling rendering for this specific situation but be limited to a 32 tile wide scene
or have a place in the code somewhere where you save the background data to edit dynamicaly (like the metatile plugin)
But sadly thats out of the scope of this plugin
if i keep the palletes the same i assume i can submap off screen? as i think i found a solution without the need to change palletes 😊
Yeah with the Copy scene submap to background tileset event this should work
thats all i needed to hear 🫡 thanks mico as always!
actually wait!
question! with the submap thing
if i copy over a image even with the same pallete but the colors are in different tiles, does that matter?
or do they just require the same colors anywhere on screen?
They's have to be same colors anywhere on screen because the issue is that when it'll rerender the offscreen part it'll use the original color positions
okay but if the palletes are the same, in the image i post in the pallete can be anywhere?
The palletes isnt the issue, the issue is which tile has which color
Question regarding the metatile plugin: Is it possible to have two identical-looking tiles with different collision values?
I've tested it, and it seems to be possible. "Must match metatile collision" has to be turned on so that the compiler knows how to differentiate between the two identical tiles. Draw collision on both the metatile scene and the actual scene, then it should work.
Is this the best/most efficient way to do it? It requires one extra tile and collision must be drawn on the actual scene instead of being automatically set (due to "Must match metatile collision")
Yes that is the way to do it
Alternatively if you can use an extra unique tile and dont want to be bothered to set collision in the scene, you could add to the tile with collision a different color pixel at the corner of the tile to differenciate it
That way it can act as a small tell that it has collision while mostly looking the same
do you just add it to the plugin folder and it works automatically or do you enable it with an event?
You just add it in the plugin folder
Hello. I was wondering if GBStudio 4.2 is necessary for using the Metatile plugin? I am on 4.1 and and I cannot seem to figure out how to make it work.
I use the metatile plugin on GB Studio 4.1.3, and it works well. What issue are you getting?
Hi! The biggest problem so far is that when I have the "load metatile" event in a scene, it effectively disables the collisions assigned to the scene. So, I decided to assign collisions to the metatile scene as well, and I also activated the "Must matched metatile collision" option, of course, but whenever said option is active, I get an
"Compiling Events... Error: Compiling "EVENT_LOAD_META_TILES" failed with error "Error: Cannot find matching metatile for tile at coordinate 0, 0". {"scene":"sc_ch0_page_c","scriptType":"scene"}"
I do not know how to proceed. :(
For starters, you'll need a common tileset (the puzzle-piece icon) for the two scenes. The same common tileset must be used for the metatile-only scene (metatileset_a) and the scene metatiles will be used in (sr_ch0_page_c)
Note that (as of GBS 4.1.3), background tiles count as unique even if they are flipped
The "Must matched metatile collision" means that the compiler will define metatiles based on the scene's collision. It looks like your sr_ch0_page_c scene has no collision and has some tiles not found in metatileset_a, so the compiler is getting confused
-# Additional info can be found in the plugin's github repository https://github.com/Mico27/gbs-MetatilePlugin
Thank you, KirbyKing! The scene does have collisions, by the way! But, I totally skipped the common tileset setup step, so I will be fixing that and the apparently missing tiles in metatileset_a.
I had given up on using the metatile plugin, but decided to give it a try again about two hours ago, because it would be quite useful for creating breakable bricks and such. Sadly, I am failing to set it up over and over again. The collisions simply do not work. I even downloaded the Super Mario Bros. Mini source code, booted it on GBStudio and poked around to see how Mico27 set up things, but honestly, their code is a bit too complex for me.
So, after that, I reorganized my tilesets to match Mico27 organized theirs [and, broke all of the backgrounds I made in tiled in the process]. I tried it with and without "must match metatile collision", the metatile tileset is assigned to both the metatile scene and the main scene as the "common tileset", the debugger is not complaining about mismatching/missing tiles, and I made sure to apply collisions to both scenes to [but, only in the tiles I wanted collision, of course].
So, here are a few screenshots showcasing what I explained above, as well as the plugins I have in the plugin folder and some other stuff. Please, am I missing something obvious here? What exactly am I doing wrong, surely I cannot be THAT dumb?
I suspect you are using plugins that conflict with the metatile plugin (Solid Tile Group sounds like its probably the culprit here, if not either check which plugins are modifying the same engine files or remove/add them one by one to pin point which one is creating the problem).
Id suggest not using any other plugin when you want to start testing stuff like this, plugins that replace the same engine files can lead to plugins not working at all.
Yeah, that was it. Thank you, it works now. Gosh, I will miss the Solid Tile Group plugin...
Honestly, I worked with RPG Maker MV for hundreds of hours, an engine very reliant on plugins. I should have tried removing other plugins during my testing. I have no excuses.
Hello again. I have two questions.
1st. Do pretty much all tile IDs change when you add new tiles to a metatile tileset? I set up the HUD with a bunch of "assign meta tile" events, then I added a few new tiles and the UI now looks like a garbled mess. It took me over a hour to grab all of the tile IDs in the metatile, do I have to do it all over again whenever I make changes to the meta tile tileset? :(
2nd. After I set up the meta tile plugin correctly for the first time [about two hours ago], the game was compiling just fine without the marked placeholder tiles being present in the metatile tileset. But now, the debugger complains about missing tiles if the placeholder tiles are absent. Any idea of what I am doing wrong here?
tile IDs are the index order of the tile in the metatile scene, starting from the top-left being 0 then to the right and down.
As long as you dont change that order, the ids will stay the same. for the hud, instead of doing it via scripting tile by tile, you can have the hud on a separate scene using the same common tileset and submap it instead, the hud shouldnt need to be using metatiles anyway.
Tiles used in the main scene HAVE to be also in the metatile scene, otherwise it wont work even if they are placeholder.
What is the advantage in submapping the HUD?
like I said, the advantage is not having to build it tile by tile, instead you submap it from a separate scene.
Ah, sorry. I am a bit slow. 
I really do not get it. For reference, I removed all plugins with the exception of Platformer Plus and the Metatile one. The scenes are not exceeding the unique tile limit, there are no missing tiles in the scenes, I made sure of it. Yet, this happens.
Which PlatformerPlus build are you using? Certain ones have compatiblity issues with metatile
I am using the one from your demo.
Are you using "Color only" more or "Color + Monochrome" mode?
Color + Monochrome. Should I change it?
no it should be fine, not sure how changing the palette causes this tho
I toggled on "must match metatile collision" and it is a little more consistent now [for instance, the default palette does not break the scene], but some palettes still garble everything.
I spoke too soon.
At this point Id need the project to see whats going on, there might be something amiss
I'd have to spend more time investigating it, but I think the issue might be some weird compiling order.
changing the the 6th pallete of the scene back and forth seems to fix it,
Also not having the load metatiles event being in a custom script and put directly in the on Init of the scene fixes it too.
I'd suggest not putting the load meta tiles event in the init_level script and put it directly in the on init of the scene before calling the script.
Thank you so much, you are the best!!
It works great now! I was able to implement cute collectibles, as well as properly update the collectible counter in the UI with the metatile plugin + Cormorant42's XL Switch. Thank you so much, @unreal haven and @severe isle !
Now, I was wondering if it is possible to create a case/switch thingy where what triggers the metatile swapping is a projectile? My goal is to create breakable blocks without wasting actor slots.
You'd need a plugin that allows projectiles to collide with background tiles and allows you to run a script with the collision coordinates. Not sure if there's something like that out there.
I think this plugin can do the trick
https://nokotin.itch.io/custom-projectile-plugin
you can specify the collision behavior and even get the projectile position when its deleted and run a script
On projectile removal/deletion, should I use "get meta tile at position" and do something with that information then?
Also curious as you how i can get the projectile position when deleted, how would you go about it?
In the Custom Projectile event, you can set 'Collision Behaviour' or 'On Projectile Removal Behaviour' to execute a script
in the same fields, you can select 'update variables' to store the x and y pos of the projectile
I'll test this, thanks!
Hi, Mico. Are the fire bars in SMB. Mini made with metatile swapping or are they actors?
They're actors, I painstakingly animated each frames of the rotation of the bar by hand (which is why its a bit choppy)
Alright, thanks for responding! Another SMB. Mini-related question: I noticed the HUD scrolls just fine in the vertical levels such as 12-1, how did you pull that off? I was told there is no vertical parallax in GBStudio yet.
Its not parallax, its the overlay with a scanline cutoff
I do not understand the funny words you said, but I am glad there is a way to have the HUD in vertical levels :D
The GB screen is rendered from left-to-right, top-to-bottom, pixel by pixel (each horizontal line is called a "scanline"). The overlay, which is the only movable graphics layer other than the sprite layer, can have its rendering be stopped, or "cut off", after a specified scanline.
So in this case the overlay layer has been placed at the top of the screen, and a scanline cutoff script has been implemented that cuts the rendering of the overlay off after a certain number of scanlines. If the scanline cutoff script hadn't been ran then the whole screen would have been covered by the overlay.
Thank you so much for explaining, Mico and Cayenne!
Just to piggyback on this question, am I correct that you can't use both the overlay cutoff (e.g. a HUD at the top) AND parallax in the same scene?
(I can move this elsewhere if we're getting too off-topic)
correct, the parallax code does not use the overlay cutoff
It is me again! This time, I am trying to set up the Scroll Scene Plugin. The debugger is giving me this error shown in the screenshot. This time, I used my brain and tried debugging by removing all plugins [except the metatile one, because the game wouldn't run without it]. For reference, I looked around and saw that someone else had this problem, but they had ejected the engine, which is something I never did.
There's a value missing, there should be a plugin which allows you to set the background offset. It's necessary to use metatiles with scrolling afaik
Hey, thanks for the XL Switch plugin, it is nothing short of extremely useful! Back on topic, which plugin am I missing?
Thank you!
I still get the same error even after adding that event to the "on init" script of the scene. I am not using the submapping plugin, btw.
The scrollscene plugin is not compatible with the metatile plugin, which is why there isa version of the metatile plugin that incorporates it
I know it was a while ago, but thank you for your Platformer+ fork! I had a playerstates too big error pop up out of nowhere last night and switching to the fork fixed it completely
Hey there, I'm finding that I need to replace a metatile which could be either onscreen or offscreen at the time of the change. I therefore need the associated 'replace meta tile' event to have 'commit render' either checked or unchecked based on that.
Is there a good method for determining if a particular x/y position is currently onscreen? Or am I going about this wrong?
Ah ok, I worked it out using Pautomas' Camera Fields plugin to get the camera scroll position
How do I create new metatile states? I am hoping to set up bigger collectibles [in this case, 16x16 collectibles] like DK Coins in DKC games. I only have one "Collectibles" state that was already sort of set up when I installed the plugin.
You'd need to modify the plugin yourself to include additional states
Its not really part of the metatile plugin itself, I think KirbyKing created that custom event to be able to have collectables, but you'd need to find the event file to add new states and have to modify the platformer file to add that state too and manage when to call it, in the case of additional collectables, most likely by modifying the switch case where it looks for the collectables and manage the additional cases
The direct line of C code in platformer.c that activates the "Collectibles" metatiles state is:
script_execute(specific_events[COIN_COLLECTED_EVENT].script_bank, specific_events[COIN_COLLECTED_EVENT].script_addr, 0, 0);
-# The collectibles state is a fork of MarioMini's "Coin Collected" event, so it shares the same naming convention.
As Mico said, although you could add a new script_execute-related metatile state by defining the change in the platformer engine and extending those changes to the event plugins, it’s also possible to reuse the same metatile state for multiple collectibles
For an example on doing larger collectibles with metatiles, I’d suggest giving the MarioMini source code a look:
https://github.com/Mico27/SuperMarioBrosMini/blob/main/plugins/PlatformerPlus/engine/src/states/platform.c (line 323). By doing the switch statement within the C code, you can use the same metatile state event for multiple collectible sizes
Thank you so much. I was able to implement big collectibles. In a later date, I would like to ask for help in implementing classic platforming spike enemies [that would trigger a 'death' event on contact] as well, which I assume will require a new script_executed-related state.
hello mico! 😊 i apologise for disturbing u! just wondering how u did the coins in your mario demake!!! trying to use the metatiles plugin but not sure how it works, could u give me a small idea of how to do it? :))
i apologise for disturbing u, its just i believe my project would be impossible to do without it 😊 any help is much appriciated!
@unreal haven Hello! I believe I have found a bug regarding the Metatile plugin (specifically 8px) and Color Only mode.
In most cases, Color Only mode works well with metatiles. I have seen that it works well for the first 128 tiles of a scene/tileset. The issue is when the metatile plugin tries to access the last 128 tiles of a scene/tileset (aka, any tiles on the right-side of the VRAM). Instead of showing the 129th tile of a tileset, it shows the 1st tile. Is a fix possible?
(image and project files are attached)
Yes this is due to tiles in the second VRAM bank that is used in color only mode that share the same tile id as the tile in the first bank but with a tile attribute that specifies which bank the tile uses.
To fix that issue you can either
- check the "Must match metatile color attributes" checkbox when loading metatiles
or - make sure your common tileset doesnt contains tiles that will be used in the metatile in the second VRAM bank
@unreal haven think u could try explain it for me, i would really appriciate it, im happy to even pay a small ammount if needed :)) ❤️
Its pretty much explained extensively on the github, however I'd suggest implementing this only on new projects. And some things require coding knowledge, like coin collecting (although KirbyKing did make a version of the platformer+ plugin includes that)
maybe u could help me through it tomorrow if possible? :)) its just im making a sonic game and it would be really impractical and bad for performance to make them sprites 😊
my issue with the github is i struggle to understand what it all means, its worded in a way i dont quite understand, english isnt my native language :))
Hi! I'm currently working with metatiles and can provide some help.
I believe the MetatilePlugin's GitHub page explains it best, but to summarize; you'll need a "main" scene that uses metatiles, a "source" scene that has the metatiles for the main scene, and a Common Tileset between the two scenes. The main scene will also need a "Load meta tiles" event, which will instruct how the metatiles get assigned from the source scene to the main scene.
The MetatilePlugin also comes with some limitations in terms of the tile amount/scene size allowed, which are shown in the GitHub page.
The "CollectibleTest" sample project available below can provide a simple pre-made example of working with (metatiles and collectibles).
Once you get metatiles working, in order to get collectibles working, it mainly comes down to aligning collectibles with a certain Tile ID, and continuously checking if the player interacts with that collectible-related Tile ID within the platformer engine.
I'll also use this opportunity to release v1.1.0 of the "PlatformerPlus (State-Split + Metatiles)" fork, along with a sample project with collectibles, named "CollectibleTest". The project has comments explaining how the project's collectibles work. The plugin's platform.c file (specifically lines 214 to 228) also has some comments to try and help explain some of the C code as well.
Although the below plugin is a framework for some basic collectibles, some familiarity with the C coding language will most likely help in making the most out of metatiles.
-# If I got anything wrong, feel free to correct me.
Resources:
MetatilePlugin GitHub page: https://github.com/Mico27/gbs-MetatilePlugin
Doc for the on_metatile_enter function: #1270176849393221783 message
thank u, ill look into it :)) would help alot!!! :))))
hey @severe isle im not quite understanding it, not sure what im doing wrong? could u possibly help? :)) downloaded the example scene and it basically has no code and dont really understand what its telling me to do
im just not quite sure what im really ment to do, the example scene has very little to go off, and my reading ability for large paragraphs isnt the best
Did you open up the Initialize Metatile Code event group and see the comments/events inside?
yes im looking at it, and im confused, so sorry,
im not very good at this or very good at understanding alot of english 🫂
like im bad at reading parapgraphs in general due to dyslexia and it not being my native language makes it even harder.
like im not sure what it means by on_metatile_enter, or platform c, not sure what collectible value is, like
im just not understanding it very well
really sorry
The error means that the "Load meta tiles" event could not find the tile at coordinate 0, 0 from the main scene inside the metatile source scene.
Attached is an example from the CollectibleTest project.
To fix this error, make sure that all tiles that are used in scene "1-1" are present in the scene's metatile source. Screenshots of your current metatile-related setup may help as well.
all tiles? or all metatiles?
like do i need every tile in the metatiles stage?
Yes, all tiles used in the stage should be in the metatile-source scene.
I would recommend starting out with metatiles in a less complex scene, possibly in a different project. That way it's easier/simpler to debug an issue
hmm okay, ill set up a simplier seem to test
From my knowledge, when using the "Load meta tiles" event, all standard tiles get loaded into memory and converted into metatiles.
does it double the tile count then? or am i wrong
No, the scene tileset stays the same when loading metatiles
Looks like a good foundation. Question, which metatile plugin variant are you using?
im not sure? is there a way to check?
this is what i see :))
It looks like you put all three metatile plugins into the project. There should only be one of those folders within your project's plugin folder.
It's up to you which plugin you'd like to use. MetaTile8 uses 8px tiles, while MetaTile16 uses 16px tiles. The GitHub page goes further on this:
im using 16x16 i think :))
whats the screenscroll one? :))
ohh
okay
ill just use metatile16 :))
how exactly do i download it,
i think im stupid
like i dont see a download button, and code downloads all 3, but they are like actual scene tests?
not sure what i dowlnoad
so sorry for all this
Don't worry, you already have it downloaded. Go into the "MetaTile16" folder, go into that folder's "plugins" folder project, and find the folder named "MetaTile16Plugin".
Move the folder named "MetaTile16Plugin" into your project's plugins. The MetaTile16Plugin should be successfully installed. Once done, you can delete the "gbs-MetatilePlugin-main" folder.
okay done! :))
Could you show me your project's plugins folder?
That looks good, but if you're using the Metatile16Plugin, then all tiles must be aligned with a 16 pixel grid
oh, well if i use 8x8 does that not mean i cant get the rings working?
the rings are 16x16
8x8 metatiles come with stricter scene-size requirements, but it's possible to use them for 16px collectibles. It requires some additional C code not found in the default "CollectibleTest" sample project, though
is it very complicated?
The short answer; no, but some familiarity with C coding may make it easier.
If all you're planning on doing is have a ring collectible, then you can just amend the platformer engine code with that interaction for each part of the ring collectible.
amend? 😅 not sure what that word means, so sorry 🫂 but yes, basically just rings :)) nothing else really i dont think :)) at least not for a long while
Just circling back here, because my response will reference these;
platform.c is the engine file that the Platformer scene type uses to function. You can find this file inside PlatformerPlus/src/engine in the "**PlatformerPlus (State-Split + Metatiles)" plugin .
on_metatile_enter is a function found inside platform.c. This function supports code for different metatile interactions.
$CollectibleValue is a variable found in the CollectibleTest sample project. Every time you collect something, this variable is incremented. It is hard-coded inside platform.c, but it is possible to modify/delete this variable if needed.
I would recommend downloading the "PlatformerPlus (State-Split + Metatiles)" plugin here, since it comes pre-built with metatile interactions for the platformer engine.
okay one sec :))
let me do that!!
all downloaded :))
so how would i now do the collectables?
the options from before are gone? @severe isle any idea why?
do i keep both
What options are you referring to?
most of them
One moment, I'll script an example
okay thank u :))
Could you show your plugins folder please?
here u go :))
Where did "MetaTile16Plugin" go?
No worries! Returning the plugin should fix the issue
In the PlatformerPlus folder, go into engine, go into src, go into states, and remove platform.c. Download and paste this file to replace it
The following platform.c is the exact same except the switch statement inside on_metatile_enter. It's similar to the old code, except now there's 4 cases, each for the four tiles of the ring collectible.
For best compatibility, please set up your metatile source scene like this. The first tile should be blank, the second should be the top-left of the ring, the third should be top-right, fourth bottom-left, and fifth bottom-right. The rest of the tiles can be anything, but with the current platform.c code, it's important that the first five tiles are set up like this
so is this correct?
Looks good, but note this warning:
The 8px metatile plugin can have a maximum of 256 metatiles. The compiler will warn you about it, but 128px by 128px is the maximum "real" size for a metatile scene
oh okay? wont it give me the error message that its missing the other tiles? why are we making all tiles metatiles?
Oh, I see what you mean. What you did was a good foundation for collectibles, but in order for everything to work, you'll need to include all the tiles that will be used in the scene like you did last time
No, its 128 pixels by 128 pixels. In other words, 16 tiles by 16 tiles, or 256 maximum tiles. 256 is the maximum amount of tiles allowed by the plugin. DMG/Monochrome limitations stay the same
oh okay haha, makes sense :))
Looks good. You can delete these two tiles, since they're duplicates.
Make sure that the metatile scene has collision on the tiles you want, then compile the project
do i need to add that to the common tileset aswell? :))
Add what, collision?
no i mean the thing we did
like
hold on
this is the shared tileset, or do we not need a shared tileset right now
im confused
like this
Yes, you'll still need a shared Common Tileset between the scenes. You can also delete the two duplicate tiles from there, if you want.
yes but do the common tileset and the scene need to be identical, im confused why we need both the tilset and the scene is all
I'm not sure the exact reason why a common tileset is needed, but some features become broken without a common tileset. The same image that you use for the metatile source background can also be used for the Common Tileset.
Could you please show the test scene and the metatiles scene?
Not sure. It looks like coordinate 0, 0 in the test scene is available in the metatile scene.
Could you send the files to the test scene and the metatiles scene?
Could you try using this image for both the common tileset and the metatile source?
yes! :))
getting these errors now ❤️
Not sure why this issue is happening. I used the same images and they work in my game.
Try downloading the three images that are attached above and placing them in your project.
Random question, what software do you use to edit your images?
krita :))
and okay i will! 🫡
should i reinstall the plugins? anyway u can wrap up ur plugins and send them to me? i might of messed up somehow?
@severe isle Sorry for the late reply!
I believe the plugins are the same. Have you tried redownloading the three images?
yes but it just is not working.
issue has moved though?
If I recall correctly,16, 8 is the top-left part of the ring tile. Can you verify that the metatile source scene has the same Common Tileset as the test scene?
how do i verify that?
Click the "metatiles" scene and make sure it uses the same Common Tileset as the "test scene" scene
botha re using the same tileset
can i send u my project in dm's ,cuz i have no idea what im doing wrong.
That's alright
(Edit: Situation resolved! A fresh install of Metatile16Plugin was needed.)
How am I meant to use the config save load plugin? I've been having issues... I'm setting 20 variables in the save config event, then running the game data save event, which immediately freezes the game. I assume I should just be running the config event, then the save event, but yeah... What am I doing wrong?
Hey, @severe isle ! Hope you are doing well today. So, sometime ago I asked you about whether or not I needed to create a new metatile state for big collectibles in my game.
#scripting-help message
Since then, I abandoned the idea of big collectibles [at least, background tile-based ones], but I still need help with something similar. And, that something is something similar to the Pink Coins from Super Mario Maker:
https://www.mariowiki.com/Pink_Coin_(Super_Mario_Maker_series)
Now, setting up scenes so the player needs to collect a [x] amount of collectibles before being able to move to the next scene is simple enough, and I already set it up. What I would like help with is making sure the game tracks each of the coins individually.
Each scene will have these six "GOET3A" coins, and I need to be able to track each one of them so I can show the exact collectible that was collected by the player on the HUD. Screenshot 2 shows the hud having six blank spaces in the middle, where the collected coins should show up.
So, in the linked post of yours, you said this:
"When platformer.c checks for the collected metatile’s tile_id, you can store tile_id into a variable (we’ll call it something like “HITBLOCKID”)."
I would like to know how to set up platformer.c so it can store the tiled_id of each of the six different coin types, so I can cross check it with a switch statement in-engine. Is that something you can help me with?
Pink Coins are a type of coin that appear in Super Mario Maker and Super Mario Maker 2. They were first introduced in Super Mario Maker through a software update released on March 9, 2016. These coins have a key icon imprint on them like Key Coins from Super Mario 3D World, which work in a very similar way.
Also, the user Sam asked a question before I did and it remains unanswered, so I am totally okay with waiting until their problem is solved.
(Unfortunately, I am not informed enough to assist Sam’s question)
If you want to use the same collectible metatile state for all collectibles, you'll need a method of differentiating between each different collectible type.
One solution to this is storing the current tile_id into an variable. The exact line of code that you'll need to add is:
VM_GLOBAL(VAR_TILE_ID) = tile_id;
I named this variable "Tile ID", but you can name it anything. Make sure it's used in the project, then copy the GBVM symbol name.
Then, in the "Collectible" script, run a switch statement based on the currently-collected tile ID. This is an example of something you could do. So in the Special Collectible "G" script, you could put the letter G on the overlay and set a variable/flag to remember that "G" was collected, something like that.
Thank you. Do you spot anything wrong in these screenshots? I get no errors when running the game, but collecting the G does not trigger the events [I put the "change scene" event in the script for testing purposes only]. For reference, the script in screenshot 2 is attached to the "On Init" of the scene I am using for testing.
For each case that is related to a collectible, you'll need to add the following code before the break; in order for the "Collectible" metatile state to activate:
if (specific_events[COLLECTIBLE_EVENT].script_addr != 0) {
script_execute(specific_events[COLLECTIBLE_EVENT].script_bank, specific_events[COLLECTIBLE_EVENT].script_addr, 0, 0);
}
The following code is based "PlatformerPlus (State-Split + Metatiles)" v1.1.0. If you haven't updated, I reccomend doing so and importing your personal changes to the platformer engine. #1270176849393221783 message
If you want to stick with the older version (v1.0.0), then just rename all uses of "COLLECTIBLE_EVENT" to "COIN_COLLECTED_EVENT".
Like this [but, for each of the cases]?
I am using your version of the plugin, but it is unlikely that it is the latest version. I will make a backup of my game and import the new version of the plugin.
That will probably work EDIT: In order for the event to start, you'll need to add the script before the break;
To migrate, you'll need to update the plugin along with importing your personal changes. If you've only edited code inside the on_metatile_enter function, then you just have to download the new plugin and replace the on_metatile_enter function of the new plugin with the older one.
Do I change [COLLECTIBLE_EVENT] to the name of the event I set within the switch statement? If I leave it as is [COLLECTIBLE_EVENT], it gives me an error.
Did you update the plugin yet? The old version has a different internal name of the Collectible state (new: COLLECTIBLE_EVENT old: COIN_COLLECTED_EVENT)
I am a stubborn mule and tried this, but it still did not work [nothing happens upon collecting the collectibles]. I will update the plugin and let you know how it goes. I come from a RPG Maker background and I have had my fair share with issues updating plugins, which is why I was hesitant.
Oh, you'll need to add the code before the break;. The line break; tells the switch statement where to stop.
Thanks. I updated the plugin and replaced the "on_metatile_enter" function with the one I had before. It is not working still :( I know the collectible event is being called, as the "G" coin disappears and the sound effect plays when the player character enters the metatile, so the problem must be elsewhere.
In case I messed something up, here is how it looks now.
What about the collectible isn't working?
The overlay does not update with the new tile. Screenshot 1 shows the event, and screenshot 2 shows the event being called in the collectible event.
To make it more precise, delete the VM_GLOBAL(VAR_HITBLOCKID) = tile_id; line, and instead set the variable's value to an integer inside a collectible case.
So for instance, inside case "G", do VM_GLOBAL(VAR_HITBLOCKID) = 2;, for case "O", do VM_GLOBAL(VAR_HITBLOCKID) = 3;, etc. As long as the values are distinct and are correctly reflected in the switch statement, it should work.
You can rename "HITBLOCKID" to something like "Collectible ID" (VAR_COLLECTIBLE_ID) if you'd like
Is there a specific place I should put the "VM_GLOBAL(VAR_HITBLOCKID) = tile_id;", so long as it is before the "break;"?
Try putting it before the if (specific_events.... It's not a huge difference, but it allows for the value to be stored right before calling the event
No luck. I will rest my brain a little, perhaps I will find the root of the issue when I am rested. Thanks, KirbyKing!!
in screenshot 1, the switch should be checking the variable HitBlockId, not tile_id.
Also, in this case its best not to assign the hit tile id to a variable since its possible for the player to hit more than 1 tile at once, and this can be a problem if you hit 2 different currency tile at once since the returned block id will be either of the two (unless you design your level to never have different currency tile next to each other)
Thank you for pointing that out!
Would you reccomend any other solution?
I would think that putting each collectible type into different script_execute would absolve this (requires more custom Metatile states, however)
Heres an example:
writing an example on the script side, just a sec
this setup will work correctly (assuming you design your level to not have 2 different coins directly next to each other, but you can have the same coins directly next to each other)
If I’m understanding correctly, you set a specific collectible type variable to a value inside each collectible-related case, then call the Switch statement from the GBS event interface. Is that different from what I suggested up here?
You set it for each specific cases otherwise it will be overwritten by unwanted tiles
If you were to absolutely want to be able to have different coin types directly next to each other, instead of having a cointype variable, you'd need a different framecoin variable for each types and change the part of the code where it checks for a non-zero amount of framecoins to also check for the additional framcoins like this:
Thanks for all of your help! While I’m here, I’d also like to discuss a potential bug I’ve witnessed with the gbs-flickerActorPlugin;
When using a custom camera offset value, (Camera Offset Y = 24 is shown in the video, above 16 also occurs) sometimes actors will dissapear and not come back.
When hitting the shown green line, about 70% of the time, most actors will dissapear and not reappear. It doesn’t happen every time, however. Furthermore, it’s not always the same actors who dissapear.
I have not noticed the issue before using the gbs-flickerActorPlugin. After installing the plugin, this occurs. The project provided above has no plugins other than the flicker plugin.
thanks for letting me know, the issue wasnt specific to the camera offset but was due to when actors were being deactivated after getting offscreen, the active actor list would desync.
Found out that it was also the same issue that happened in the EditActorActiveIndex plugin. I pushed the fix on the two plugin
https://github.com/Mico27/gbs-flickerActorPlugin
https://github.com/Mico27/gbs-EditActorActiveIndexPlugin
Plugin to enable actor flickering when too many sprites are being render (either by scanline limit or by OAM limit) - Mico27/gbs-flickerActorPlugin
Collecting one of the letter coins [the 'G' aka tile_id 208] and having it show up in the overlay now works, but not the others.
can you post your platform.c file?
thats the header file
Sorry!
here, update your platform.c file with this
I updated it, and nothing changed. I am so sorry :(
put a breakpoint on the switch event in your script to see if it triggers
I have no idea how to do that, so I put change scene events in each of the switch cases instead. They all trigger, in spite of the overlay update not working. But, at least I know the problem is no longer with the platform.c file.
I figured it out. The problem was not with the script, the problem is I am a dumb idiot and I messed up the overlay submap settings.
Thanks, Mico and Kirby!
How do I make a new metatile state? I would like to replace the triggers I use for spike hazards for metatiles.
To start making a new metatile state, access the following four files of the PlatformerPlus plugin:
platform.c (executes the metatile state events)
platform.h (defines the metatile state events)
eventPPMetatileScript.js(attaches a script to a metatile state)
eventPPMetatileScriptClear.js (removes a script to a metatile state)
In the examples below, I create three new metatile states.
First, define the state in platform.h by giving it a value inside the "Specific event types"
Next, reflect the event values inside "Attach Script to a Metatile State" (eventPPMetatileScript.js) and "Remove a Script from a Metatile State" (eventPPMetatileScriptClear.js)
You can name the metatile state in the event whatever you want (like "Metatile A", "Metatile B", etc.). What matters is that it matches the value given by platform.h.
Finally, call the new events within platform.c. Examples are provided below.
The basic format is that it first checks if a script has been given to a state (like METATILE_A_EVENT, METATILE_B_EVENT, etc.), and if there is a valid state (... .script_addr != 0), it executes the event.
Hello! Thank you so much for fixing this bug!
I have found another potential bug regarding the gbs-flickerActorPlugin. Using both your MetaTile8Plugin and gbs-flickerActorPlugin causes the metatile load event to not function.
Erasing the code shown below allows for metatile functionality to work well. When the code below exists, for some reason, the load metatile event displays abnormal behavior. This abornal behavior is not present when the gbs-flickerActorPlugin is not in use.
A project replicating the issue is available below.
Thanks for the report, turns out that actor->prev sometimes isnt 0 even when the actor is at the head of the active list (garbage data maybe) so I changed the code to compare with the head of the active list instead
https://github.com/Mico27/gbs-flickerActorPlugin/commit/e0ee1fef1669eaa4dcc530df19cefb12e6927c93
Thank you! I will try implementing new metatile states later today. I do have to ask, is there anything I should know about adding new metatile states, in terms of potential drawbacks? Things to keep in mind?
hey @unreal haven ur scroll plugin doesnt seem to work with auto color at all, any plan to fix this if possible? :))
I'm not aware of any major limitations regarding adding more metatile state events. For some further information, PlatformerPlus was able to do 22 state events.
Not possible. When you use auto color, the color slots wont be consistent between scenes, so it will result glitchy color when transitioning scenes. You'll have to do manual coloring if you want to use the scroll plugin.
oh okay, thank u! :))
I cannot seem to find the if (specific_events..." line in platform.c, unless it is this line and it looks a bit different in my version of the plugin file?
script_execute(specific_events[COLLECTIBLE_EVENT].script_bank, specific_events[COLLECTIBLE_EVENT].script_addr, 0, 0);
}```
Yeah, that looks a bit different. The C code you posted has additional logic to first check if a variable ($FRAMECOINS) is not equal to zero. It still has the specific_events line, but also needs to check a global variable in order for the collectible script to run
Removing the script_memory[VAR_FRAMECOINS] && means that the metatile state event no longer needs $FRAMECOINS to be a non-zero value to run. The collectible event in your platformer.c file most likely needs this logic in order to know when to run, but you can remove or modify this logic to your discretion if other metatile events are unrelated to collectibles.
I opted for leaving the code this way, do you think I should change it?
Also, creation new cases for the new metatile is a required step as well, right?
Most likely. I'm not sure what aloe is in the context of your game, however. If it's a collectible, you may be able to "piggyback" off the above collectible cases. Also, make sure to attach a break; line when the aloe script should stop, otherwise every tile that istile_id > 10 will be treated as aloe
It is a basic platforming spike hazard that deals damage when the player enters the metatile. The new metatile is working now, as in... It triggers the event, only problem is all tiles are being treated as spikes xD
It seems like the platformer.c file Mico27 gave you (#1270176849393221783 message) moved the execution of collectible-state events from on_metatile_enter to platformer_update. If you want to keep all metatile events in platformer_update, you'll most likely need some way to track if the player is in aloe in order to tell platformer_update when to run the script.
Otherwise, every frame will call the aloe spike script (as you stated above)
I'm not sure what the best way to go about this would be. I'd usually recommend executing the ALOE_EVENT code under case 10: in on_metatile_enter, like the older platformer.c
I'm not sure what the pros/cons are for having metatile events executed by platformer_update instead of on_metatile_enter. If the metatile events stay in platformer_update, you may need a way to keep track of the player's entered aloe, such as with a global variable like with what $FRAMECOINS does with the collectible event.
I'm not greatly experienced with this specific method of calling scripts, so I'll wait a bit for Mico27
It did not work, but it was worth a try xD
Thank you so much, KirbyKing! Let us wait for Mico then.
Wait, scratch that, it actually did work! However, I am open to suggestions for a better approach, if there is one.
Nope, never mind. Unscratch that. It works in that one scene, but not in others, for some reason :3
Help me, @unreal haven :3
Well, my only option is trying to revert to Kirby's version of the platformer.c file, and see if I can get it working.
If it worked for one scene but not the other, chances are the issue isnt with the code but with something else, either your script or scene setup
Scenes are all set up the same way.
Please? Can you take a look at the code and tell me if there is something wrong with it? I would do it myself if I knew how, but sadly I do not.
I second what Mico says
hey mico! with your pallete swap plugin is there a way to make palletes fade into one another? sadly fade street no longer works on the most recent version of gb studio, was wondering if this is something u offer 😊
You can get color data from the palette and also set the color data. But if you want to do fading, you'll have to lerp that color data yourself with some math
how would u store the color data? :))
You use the get colors of a palette event, store the color in variables, do lerp calculation on those variables and use the set palette colors event for each step of the fading
thank u!! :))
hi @unreal haven , quick question- is the "copy scene submap to overlay with tile offset" event compatible with the second vram bank in gbc only mode?
i ran out of space in the text buffer to add more tiles to my ui
so trying to figure out how to potentially add more
yes
that's awesome, the plugin is so useful. can i just use VM_LOAD_TILESET to load a tileset into the second bank then?
Yes
thanks thanks
@unreal haven Hello! Question, what are the plugins of the MarioMini project licensed under? I wanted to make sure it is allowed if I use and adapt the actorBehaviorPlugin to my project.
Its all open source, feel free to use whatever
looks like VM_LOAD_TILESET doesnt support the second bank, it just wraps around to the start of the first one, unless im misunderstanding
VM_LOAD_TILESET loads from a background tileset, if that background has tiles in the other bank, it will load it
oh duh
i need to wake up
thank you
wait... but it loads them at the tile id given in the command
now im confused
i can avoid this by moving some other stuff into the second bank instead, so i guess it doesnt really matter
But, like I said, all scenes are setup the same way. I literally copy and paste them.
Hi Mico, I'm using this in 'What if OutRun' and it's really been very very useful.
I have a question please !:)
- Could this be edited to skip over the Player? i.e. never flicker the Player
changing the plugin code to this should do the trick
Also make you update the plugin, there was a fix for when actor get activated/deactivated
Wow that was quick! I’ll give that a shot later. Thank you! I tried it myself and just ended up breaking save games ….. somehow ¯_(ツ)_/¯
oops forgot to add an additional check if theres only the player and exactly one actor
Ta !:) I’ll let you know how it goes.
@unreal haven worked out really great. Thank you! 🍻
For whatever reason, when I'm messing with the colors in the metatile scene, it freezes gb studio.
It still lets me open tabs, but not anything else
It also won't close
Messed with the tile priority and it finally compiled, I dunno why it froze before tho
Read the error message, that means that the tile at position 22, 3 in your Brinstar 1 scene could not match to any tile in your metatile scene, which if you have "Must match metatile color attributes" checked will also need to match with the tile color & tile priority
Thanks!
I came across an issue, when vertical scrolling these blocks that are supposed to render back on after 5 seconds, would appear somewhere where they're not supposed to while vertical scrolling.
I sort of fixed it by having it only commit to render if the player is close enough to see the blocks. But I'm wondering if there's another way to avoid that
No, thats the way to do it
Your plugins are awesome. So many useful features
Is there a way for me to create a script that would allow me to track if a metatile is hit by a projectile using the metatile plugin? I'm trying to turn a collision tile into a not collision tile when hit by a projectile if that helps
If you're using the custom projectile plugin, you can run a script when a projectile gets deleted by colliding with a tile, when that happens it stores the position of where the projectile got deleted (collided) with that you can use the event that gets the metatile with the position to check which it hit then replace it with another metatile
That should be exactly what I need, thank you!
I want to experiment with your pinball engine, is there an easy way to access the nightly build of GBStudio?
here this is the latest nightly build
https://github.com/chrismaltby/gb-studio/actions/runs/16809902757
you need to be connected to a github account to download it
do you have experience using the custom projectile plugin? it doesn't seem to update the correct position of where the projectile is removed.
Also - I'm using 4.1.2, just updated to the newest version of the meta tiles plugin and if the "load metatiles" script is active it just cancels the build. Do I need to update gbstudio to a newer version?
I had no issues with the previous version of the metatiles plugin so I figured that might be the solution
Latest official release is 4.1.3
There's a known glitch with that plugin where it only works with the first two global variables
that's great news. thank you
Extending more on this, it’s not specifically the first two global variables that work, but those two are most likely to work.
I believe the variable references passed by the CustomProjectile event are mismatching with what’s actually in game_globals.h. I’m not sure the specifics on how to fix it, but I do know a work around. Dumping the raw GBVM code for the CustomProjectile event, then replacing the X/Y references (constant values) with their actual references from game_globals.h allows the variables to be used correctly. Note that this solution won’t update with game_globals.h, so it’s not great
Yeah, I found that out here #plugins-help message
the plugin was passing the variable this way
instead of this way
They dont seem to have a github repo for this so I cant pull request a fix so ho well
Here it is (CustomProjectile is in here, amongst other plugins)
https://github.com/fredrikofstad/GBStudioPlugins
oh thank you! (pretty well hidden)
put up a pull request with the fix https://github.com/fredrikofstad/GBStudioPlugins/pull/7
Hi @unreal haven, I was wondering if your Edit Actor Active Index Plugin is compatible with adventure scene type?
It seems to work well when I was testing it except for some odd behavior when using the vertical sorting event on a loop.
Player position relative to the bottommost placed actor's y position would cause the player and all actors at that row to flicker.
The plugin should work with adventure type (The example project uses that scene type)
Do you have the latest version of the plugin? when did you download it?
I'll try and see if I can reproduce the issue
Should be the latest version, downloaded it yesterday to a 4.1.3 test project with no other plugins enabled
Yeah I can reproduce it, looking into it
I figured out the issue and fixed it, you can update the plugin and it will fix the problem
I can't seem to get any Metatile plugins to compile and build, even from the example project. I'm not exactly sure what I'm doing wrong...I did download the latest I could find of 4.2.0. This is me trying to build from the example project with nothing changed.
Use a different build, it won't work with the latest build due to a datatype change (unless Mico has updated already, but I don't think he has), but that's also not the problem that you're having
And set the x and y scroll values in settings, I believe
Ah, that was it. Thank you, friend. I really appreciate your help
I'm having some trouble animating a 16px metatile using the Replace Tile from Sequence event. It doesn't animate the tile at the selected coordinates, but rather the bottom-left corner of some unrelated metatiles.
Replace Tile event isnt compatible with the 16px metatiles, because the tilemap it reads to to get the id of the tile in VRAM to change is now the id of the metatile, not the id of the tile.
See here #plugins-help message
Ah dang. I remembered you talking about it a while back, was that specific to the 8px version? #works-in-progress message
Its the same for both version, the only exception is with the 8px version if the metatile match exactly like the tileset.
The solution is to, like its said in the plugins-help conversation above, that you use VM_REPLACE_TILE or the plugin that adds the event to use it
Thanks for bearing with me, I'm still getting my head around all the stuff this plugin can do.
I just wanted to ask why my submapped metatiles occasionally get jumbled around like this (image). I'm submapping the pink metatiles to the background based on the camera scroll X and Y. Could this camera event be causing the 'victory' tiles to get split and flipped like this? It seems to happen about half the time or more.
It looks like you are submapping off the 16px grid in the second screenshot, which is why you see it like that
When you are submapping metatiles in the 16px version, make sure you are rounding it to even tiles
You can round it easily by just doing this:
Yesss that did it! Thanks so much
I feel like I've seen this documented somewhere but I can't recall - what are the maximum scene sizes for the metatile8 and metatile16 plugins?
Should be on the GitHub pages I believe
If I swap metatiles in a scene and save it to a stack, change scenes and return to the stack with those tiles still be swapped?
No, afaik when you restore the scene it will rerun the init script in which you load the metatiles (so any previous metatiles changes will be lost)
One thing you could do if you want to put the scene on a stack to switch to a non-metatile scene (for menu purpose for example), you can save the metatile bank and pointer in variables and assign them instead of using the loading metatile event. I'll write a quick example in a moment
@mossy star Heres how you can do it, in the main scene where you load the metatiles, you add a condition to check if you are comming from a scene stack or not, if not, load the metatiles, otherwise, just assign the metatile and attributes banks
and in the part where you put the scene on stack and change scene, you save the current metatile banks in variables, set the variable to say that the scene is put on stack then do the rest
Note that for this to work, the scene you are changing to must not be using metatiles
That's incredibly useful. sounds too easy to be true!
Do you think I could I workaround that by having multiple scenes that use metatiles, saving each of their banks to different variables and then using a transitional non metatiles scene?
No, it can only store one entire map at a time, so if you change to another metatile scene, it will be replaced.
Okay cool. Thanks for the help, I'll definitely be able to use that information.
I could only find this regarding scene size limits.
Does that apply only if using the additional plugin?
The scene size limit applies regardless of additional plugins
I haven't had a chance to test this and was hoping to be able to before asking lol, but I was wondering if saving game data would save any metatiles changes made to the scene by default? Or would loading the game save would revert all metatiles changes back to the scene default? If that makes sense.
I'm not Mico but from my knowledge of how the metatiles work, no
An addendum to this question...
Sometimes the camera position means that the screen will show half-tiles at the edges, rather than whole 16px metatiles tiles (see images). This means that the submapped area will be offset to one side even with the bitwise operation, since it can't be submapped onto a half-metatile position.
I think I need to move the camera to an 'even-numbered' scroll position before submapping, to ensure the screen isn't showing any half-tiles. But I just can't figure it out. Is there any easy way to do that with an expression?
As so often happens after I ask a question here, I did ultimately figure it out myself.
I swear, I'll struggle with a problem for a week, finally ask about it on Discord, and then solve it before anyone responds.
The solution was, I had been doing the modulo wrong, plus camera field issues.
Except no, it looks like it's not working! Ahh gosh...
Yeah ok, I solved it properly. 😅 Sorry for all the rambling, I must be a bit burned out. I'll keep future questions on topic to the plugin, and head over to scripting help for stuff like this in the future.
i've got this up and running, but is there a way i can have the stack saved when i save/load game data? or save the metatilebank and metatileattrbank to variables and have those variables saved an loaded when loading game data?
basically, trying to save metatile data between game saves.
I attempted to save game data on the "menu" scene and then loading the game save data, swapping scenes back to the previous stack with the metatile scene but that didn't work for me.
The metatile plugin wasnt really designed to be able to save the map data, so this is a bit outside the scope of what it can do.
If you want to be able to have such a feature, you'd need to code a version of the plugin with such functionality
Dang, might be a bit beyond my abilities at the moment 😅
It says the metatile plugin has a limit of 256 unique tiles - is that the same regardless of if they are 8x8 or 16x16?
I also read that color only mode may allow for more unique tiles?
The metatiles are separate from the actual tiles. Color mode doubles the amount of unique 8x8 tiles (192>>384), but the metatiles are "patterns" of those tiles stored in memory. The amount is fixed, both because Mico chose to fix it, and also (I imagine) because the metatile patterns take up valuable memory that needs to be saved for code, sprites, tiles, dialogue, etc.
And yes, it's the same regardless.
It's really not that bad of a restriction tbh. Forces you to be creative in how you distribute tiles in your tileset, make more efficient tiles that can serve multiple roles, etc. Restriction breeds creativity lol
To make a tileset that works well with those restrictions, I'd start by collecting as many tiles as you want, making metatiles out of them, and then run it through the online tile counter. It'll probably surprise you at how much over 192/384 it is, but then you can do a pass through and consolidate similar tiles between metatiles. Keep doing that until you're satisfied both with the variety and amount of 8x8 tiles you have.
Oh, also, I'd avoid using too many tiles that are designed for 16x16. While those often look pretty and you can get away with them on a color-only game, it's incredibly inefficient for designing under restrictions. It's 4x the memory used for a single metatile than if you design one really good repeating 8x8 tile
Awesome! I'm working with 8x8, so the 256 limit is pretty huge. I was just in the process of dedicating 40 of them to top/bottom HUDs and wanted to see what i'd be left with after the fact.
Thanks for taking the time to explain it to me, i appreciate it!
Are you not using text on the window layer as your UI?
originally I was, it only works for the case of a top/bottom ui, not both simultaneously.
Hmm, interesting
sort of a temporary workaround for the time being while i sort it out
How big are your UIs that you need 40 tiles? Lol
haha 2 tiles in height, one across the top and one across the bottom.
You'd probably be able to get away with less than that
Also, depending on how much you move around the scene, you could just submap the background to the overlay
It's pretty quick, but you wouldn't want to do it if you're constantly scrolling
that's most likely what i'll end up doing. the ui itself uses a lot of repeated tiles, so i can definitely map it out properly to make it more efficient than what i have currently, just working on a proof of concept of sorts. there's no scrolling whatsoever, everything takes place in one 160x144 screen.
i'm not sure if it's appropriate to post what i'm working on in this thread, to give you an idea of what i'm doing.
Just DM me if you want
If it's one scene, then yeah that should work just fine. If you wanted to have horizontal scrolling, you could use the parallax feature to freeze the top and bottom UI in place
So, I;m having trouble trying to get the Metatile16 plugin to work with a scene. So I made a colored scene for my Mono + Color project. When said scene is loaded on an emulator, it freezes. Can you guys help me please?
Whats the size of your scene
If the game crashes it is likely that the size of the scene is exceeding the size configured in the plugin settings
2032 x 512 is the size of my scene.
what do you have configured in the plugin settings
Max scene height is 16, max width is 128.
16x16 is 256, 128x16 is 2048. Your scene is bigger
Whats the biggest size possible that you recommend?
The maximum size configurable is just as described in the previous screenshot, the widthxheight (in 16px tiles) cant exceed 8k
So for example if you set the maximum width to 128 16px tiles, the maximum for the height will be 56 16px tiles max (but you wont have any space for save data)
You said your scene is 2032 x 512 so if you set the configuration to 128 width and 32 height you'll be fine.
Adding this one to the pile
https://github.com/Mico27/gbs-CameraBoundsPlugin-4.1
You're the plugin king! 🤣
@unreal haven I did what it says on your GitHub to a 8 tile game.
- I created the stage1 scene of the game in assets/backgrounds.
- I created a 128x128px “metatile” scene in assets/backgrounds.
- I created the tileset in assets/tileset.
- Both scenes have a tileset in common.
But when I run it, the following error appears:
?ASlink-Warning-Undefined Global ‘_vm_load_meta_tiles’ referenced by module ‘scene_1_init’ ➡️ stage1
?ASlink-Warning-Undefined Global ‘b_vm_load_meta_tiles’ referenced by module ‘scene_1_init’ ➡️ stage1
1
Translated with DeepL.com (free version)
What am I doing wrong?
You probably, put the whole example project in the plugin folder instead of just the plugin
I'm doing it in a new project.
I just copied the plugin "MetaTile8" to assets/plugins and included the “Load meta tile” event in my scene.
Yes, and Im saying you probably downloaded the folder which contains the example project
Go to your plugin folder and open the MetaTile8 Folder
if it looks like this, it means you put the whole example project
Its fine, its my fault for putting in the example project in and expecting people to understand that they have to get the actual plugin from within the example project instead
My fault. It's just a matter of paying attention.
I going yo use this plugin rist time. I want place several coins and when player passes over the coin, it disappears and adds its value.
I cannot do that with triggers because I will exceed the triggers limit
I understand with your plugin I can do that, right?
Using the Metatile 8px plugin. The event for changing collision for an entire metatile type is very useful. Is it possible to do the same but with background palettes? Essentially changing a specific type of metatile to a different palette
To emulate this effect, I had an idea to make two metatile scenes, one with the specific tile having Palette A and one with the specific tile having Palette B. Unfortunately, this did not work, as I load metatiles with "Must match metatile color attributes" (my game uses Bank 1 tiles and my tileset is larger than 128 #1270176849393221783 message)
In my experience, yes, its possible. I documented an example of how to do this here
#1270176849393221783 message
No, because unlike the collision data, the palette index of a tile is read directly from ROM, even then youd still need to redraw every tiles in VRAM with the changed palette index.
The best way to do what you are trying to achieve would be to change the palette color data instead (and reserve that palette slot to only be used by the tiles you want the color swap to happen to).
@unreal haven Hi Mico, your metatiles plugin has opened up gbstudio like crazy for me. Awesome work!
I'm working on a factory sim game now, and I just realized there is no way to actually *save * metatile updates. "Game Data Save" doesn't include metatiles at all, right? The player starts with blank floor and updates metatiles to place objects. Those objects need to persist. Any patterns you'd recommend, or will I have to get clever with saving to variables?
Correct, the metatile data is stored in RAM whereas tilemap data is hard-coded in ROM. Fortunately, you have a max of 256 metatiles, which means you could easily store 2 metatiles in every 16-bit variable, so a theoretical max of 1024 changed metatiles. Though, if you did that, you wouldn't have ANY other available variables, so don't do that.
One way you could optimize saving is if you use submapped metatiles when possible. Basically make a scene containing common patterns, which should definitely be possible since it's a factory sim, and then use those submapped regions whenever possible
& honestly I bet a lot of your game will use components that are larger than one metatile, so you could even build the entire game around using submaps instead of raw metatiles. That would really alleviate storage issues and would also provide more flexibility in terms of making game graphics
(I'm not Mico but I figured I could answer lol)
Hi there. I am trying to make breakable blocks with metatiles rather than having the blocks be actors. It seems like the idea might be doable, but the metatile being replaced is never the correct one [it should be the one marked with the pink square]. Any ideas of what I am doing wrong?
Make sure the projectile position is using the same units as the metatile plugin
pretty sure the projectil position passed to the variables are in pixel, so you have to convert them to tile when passing the values to the metatile event
Can you teach me how to do that?
$variable >> 4
Edit: had the bitshift backwards
Something like this?
Ye
Hey there. Is there a maximum possible area of metatiles that can be submapped? My more ambitious attempts have been unsuccessful
Ah no worries, it was a different problem. Solved.
I'm using the 8px metatile plugin, and my game just turns black when loading metatile. Is there a reason for it?
Oh, I need to increase the height value.
The problem is that the scene ingame now doesn't have collision.
Even when the metatile scene and the main one has it.
It'd help if you gave more screenshots
Not much anyone here can do just based on "something's going wrong"
Ok, here's the screenshots.
So I have the collision block like the 1st and 2nd images, but ingame (3rd), the player just sinks into the bottom and moves around like collision doesn't exist.
So is there a condition to apply collision from the metatile?
Does it work if you turn off metatile collision matching? It doesn't look like you're reusing the same times with different collision
The collision doesn't work at all in any condition. 🙁
The default didn't work so I turned on the matching, and it didn't work either.
How are your player's hitboxes set up? I recall encountering an issue where using the "change player hitbox" event can make collision not work.
Also, can you make sure collision works on a non-metatile scene? And what engine version are you using?
The player's sprite is stable, nothing changes.
Also, other scenes work normally, except the metatile one.
I'm using the latest version.
4.1.3
Are you using color-only mode?
You are most likely using another plugin that overrides the collision file
These're the plugins I'm using:
Basically the game is broken. :((
This is my project file.
Are you using the metatile + platformer plus version?
Yes, the 1.1 modified version.
Btw, if you have time you can try out the Demo2 project and see if my game has serious problem.
Ok, it works now. Somehow I just need to adjust the height value to 31 tiles and the collision works.
This plugin is so easy to be broken, like some kind of spaghetti.
There's no support for plugins to validate settings so 🤷♂️ gotta deal with it.
Btw, what's the different between Replacing and Submapping metatile?
replacing is if you want to replace just one tile, submapping to replace a section of it from abother scene.
Are the submapped tiles got replaced back to before when going offscreen?
Like how submap background works?
No
i'm using metatiles16 and am attempting to create a HUD on the top of the screen using parallax. it works well, except the first tile glitches out when the camera moves. i see that it doesnt support parallax, is there anything i can do about this?
the scene is only a few tiles larger than the default 160px in width so the camera isnt moving very much
Use a window layer UI instead of tiles, problem solved
There's plenty of plugins which can help, but I think that functionality is included by default in the latest releases
would that not interfere with any dialogue/menu boxes?
It would, yes, but you didn't give that as something to be avoided xD
I think it'd also be possible to copy the overlay to the background before using dialogue for anything else, and then redraw the background afterwards
I guess I can take a look at the parallax issue,
Just to make clear, you are using the metatiles16 version and not the metatile16 screenscroll version correct? The later will not work with paralax no matter what
Yeah just the metatiles 16. I was using the screen scroll version but figured that's where the issue came from, swapped to metatile16 and had the same issue.
The scene I'm using parallax in doesn't actually use any metatiles.
Then... The metatile plugin isn't the problem
I mean it could be since its modifying the scroll code, I'll look into it
without the plugin installed there's no issue!
What kind of glitch are we talking about?
here's a video. i'm using metatiles in the first scene (overworld) but not in the second scene (battle scene). the battle scene uses a top parallax.
the little glitch is the very top left of the sceen when the camera moves.
it occurs on the fixed parallax layer
I see
But it doesn't happen in the intro, when the monsters slide left. Looks like the tiles are being replaced by another tile which uses the active monster palette
that's what i thought too, so i disable all pallete changes and set the entire screen to one pallete, and it still occurs.
It wouldn't be a palette problem, I don't think. It just helps diagnose the problem
What are you doing to highlight the monster? Are you doing any tile swapping or are all of them set to a different palette to begin with?
just simple palette swaps
Do you recognize the tiles it's being replaced with? Where are they in the VRAM? (Can find out by opening the debugger)
& what happens if you change the targeted enemy?
It also looks like there's a frame where all of them change to an all-white tile before three of the five tiles change back to the UI, but with the wrong palette
How are you implementing the UI using tiles? Tile swapping, I assume? Is there an update UI script?
right now the UI up top is just static, part of the backround. i'll be impleneting tile swapping down the road.
I don't see anything off in the debugger, i don't even see the tiles that are appearing in the top left.
the glitched tiles appear as soon at the camera moves, before any palette changes.
Yeah but for some reason they're using the monster palettes
It's just a row of blank tiles, then three of them go back to normal albeit recolored
What are you using for dialogue? A plugin, or built-in?
i'm using the advanced menu plugin. i'll see i'll disable it and see if its what's causing the interference.
however, without the menus it still occurs so i dont think drawing them is the issue.
here's just camera movement.
nothing occurred in the debugger, either.
it didn't occur when solely using the advanced menu plugin, only when i added the metatile16
Interesting. The palette of the very first tile seems to be influenced by the camera position
i am moving the camera by moving the player to get a smoother transition. im not sure if it would make a difference
Probably not. My guess at the moment is that the blank tiles are being read from an area with no data, though idk why three of them return to normal.
The palettes are a mystery as well. I assume there's no palette shenanigans going on with the UI palette?
none that i can find.
when moving the camera instantly, the error doesnt occur. its only when moving.
when altering the speed of parallax layer 2, it gets sigificantly worse
Define significantly worse
Oh very interesting
Yeah that really points towards the scroll.c file, but idk what changes Mico made there so I'll just shut up xD
Though I would hazard a guess that the change which is affecting this has to do with where the data used for scrolling is drawn from
it's a shame it's literally 3 tiles being affected lol, for what i'm trying to do
Oh it's a lot more than three tiles lol
well i appreciate the time and effort you've given me trying to sort this out
absolutely worst case, i will have to remove the camera scroll and move it instantly. visually less appealing, but it will get the job done, maybe
I was able to reproduce and fix the issue, it was indeed a bug with the plugin, thank you for reporting it.
I pushed the fix on the github
https://github.com/Mico27/gbs-MetatilePlugin
Amazing! Thank you!
Does tileswapping still work as usual in the metatiles plugin?
Yes and no, its been discussed here: #1270176849393221783 message
What are the chances that change you made would be applicable in the screenscroll version for scenes that dont use the metatiles or screenscroll?
the bug fix was made for all the versions of the metatile plugins
Hey I'm planning to make some alterations to your P+ State-Split plugin for my game. How do I change Dash Style from Down+Jump to Down+Interact?
can you set the speed of the scroll in metatiles16screenscroll?
check in the code where it check for those inputs and change them to what you want
Yes in the scene_transition.h file, you can change SCROLL_CAM_SPEED, the value is in subpixels (16 per pixel), right now its moving at 1 tile per frame which is already as fast as you can get without any tearing/lag from the scroll rendering not being able to keep up.
If it's already at max I think I'll just leave it 😅 thanks for taking the time to answer my question, I appreciate it and all the hard work you've put into these plugins
i might be missing something - but how did you get the screenscroll to initiate without the player moving underneath the UI?
Scene size is 160 x 128 (2 tiles smaller vertically) and uses non-modal window for UI
I was never able to set up the breakable bricks/blocks/tiles with projectiles and honestly, I felt ashamed about asking for more help. But, I am having a particular shameless day and I wanted to ask for a tutorial or a demo for that.
Both Mico27 and Cormorant42 tried to help me, but there was a clear knowledge gap between their knowledge and mine, and so I could not understand the instructions.
Please?
How does screen scroll affect actors? I noticed when scrolling to a different scene, the actors vanish.
It's loading the actors for the new scene & the old ones are unloaded. Pretty sure it's unavoidable
Well, I say different scene but I'm scrolling into the current scene.
If that's the case, scrolling into from the current scene into the current scene is probably what causes the issue - I'll test it with two separate scenes.
I'm trying to get actor followers to work using the screen scroll plugin, currently.
It'll happen regardless of the scene
It's not gonna work how you want it to work, but you can do some workarounds to get a similar effect. Easiest way I can think of would be respawning the followers every time you enter a new scene
That's what I did previously, and i did have some success but the actors started to vibrate so I was playing around with actors in general with the screen scroll plugin to see how they work.
Vibrate?
that's how i'd describe it haha,
I used both the top down follower plugin as well as the actor behaviour plugin, they both act the same. using actor 1 is fine, but upon screen scrolling to a new scene, actor 1 seems to be erased in that scene - upon returning to the previous scene, it acts a bit strange.
Probably has something to do with how player position is handled during the transition and when loading player followers, if I had to guess. You could create a timer script which doesn't repeat and use it to activate player followers after the transition is complete
the two plugins definitely do not get along lol. after some tinkering, i think i've got it set (with one follower lol). ill have to test out adding more tomorrow.
Hmm damn, was hoping to combine those plugins myself
It's doable, but it was a lot of testing to figure it out.
Would it work with 3 followers, do you think?
It should, that's my plan!
I'll let you know how it turns out
Hi, is there a guide on how to set up a HUD with the metatile and scroll scene plugin? I'm trying to figure it out but just going in circles. I have no idea what a non-modal window is and i can't find further info on it.
It's a dialogue box option
making HUD stuff should be the same regardless if you are using the plugin or not
Would large scenes work with the scene scroll plugin?
no, screen size scene only
Ah. Okay. Im not sure how to make an overlay that's grabbing tiles from a different scene. I will look into that.
Is there a version of the metatile screen scroll plugin that uses 8x8 tiles?
I believe it's just 16x16.
I'm having an issue with Sort Actors Vertically. If my player is above an actor, player projectiles don't effect the actor below them. It was working fine until i started using the metatiles16 and screenscroll plugin. If i remove my sort actors vertically function, it works fine. i can't figure out what exactly is causing the problem.
The sort actor plugin and screen scroll plugin clash with each other because they both replace the actor.c file, so if you want to use both plugin, you'll have to merge both plugin's modifications done to the actor.c file into on of the two and delete the other.
In this case its not too difficult, you can copy the "#include "scene_transition.h"" at line 20 and "check_transition_to_scene_collision();" at line 396 from the screenscroll plugin's actor.c file into the sort actors vertically plugin's actor.c file, then delete the other file.
cool! i'm glad theres a simple solution. thank you.
actually i spoke too soon. The issue is still there. I'm using the "MetaTile16_ScreenScrollPlugin" as well. would i have to do something similar to that plugin's actor.c file?
I mean, yes, by screen scroll plugin I meant the one in metatile16_screenscrollPlugin, you shouldnt have both that and the standalone screen scroll plugin
ah. Okay, i removed the extra unneeded plugin and edited the actor.c files. then i got this error in the debug:
?ASlink-Warning-Undefined Global '_initial_player_x_pos' referenced by module 'scene_transition'
?ASlink-Warning-Undefined Global '_initial_player_y_pos' referenced by module 'scene_transition'
So grabbed those from the metatile actor.c script too and put them in. It works now but every time the characters are sorted the sprites flicker.
The actor.c file for metatiles also includes this under player_init:
if (initial_player_x_pos){
PLAYER.pos.x = initial_player_x_pos;
}
if (initial_player_y_pos){
PLAYER.pos.y = initial_player_y_pos;
}
So i added that too and it didn't stop the flickering.
mmh there might be some other thing in the scenescroll part of the code that might need fixing lemme check
in the scene_transition.c change whats in the first image to whats in the second image
unfortunately, it's still flickering.
Hi. I was having another look at this to see if i missed something. I noticed that in this part "if (actor !== &PLAYER)" i just had it as "!=". So i changed it but then the debugger gave me this warning:
just wanted to check if this is why your revised code didn't work for me.
oh yeah, it would be just != and not !==, my brain was in javascript mode when I typed that
not sure why it would give you an error tho
I got allot of errors whe i try to use your MetaTile16 Plugin -> Any idea what the problem could be
Are you using the platformer+ version of metatile?
No Idea 😅 I used the MetaTile16 Folder from his Github
There's a version on his github which is compatible with platformer+, looks like that's probably the issue
I am More Interested in the ScreenScroll Version but this one have even more Errors 😅 so i tryed the MetaTile16 first but i am not able to get any of them to work. So much errors... Did the MetaTile16_ScreenScroll did have/need a Settings window ? Cause the MetaTime16 have one and the _ScreenScroll version dont.
From looking at the error, it looks like you are trying to open the example projects, and as Ive stated before they are still not yet fixed to be opened in 4.2, you only need to import the plugin itself
you just need to download this folder and put it in your project plugin folder
https://github.com/Mico27/gbs-MetatilePlugin/tree/main/MetaTile16_ScreenScroll/plugins/MetaTile16_ScreenScrollPlugin
if there's still error and its the only plugin in your project plugin folder, then its more likely that there was a change in 4.2 and I havent gone over fixing it for that version yet
Ok, one more question. can i use tile swopping In the "MenuMap" to update Hearts and the Weapons ?
Sure, if it done on the overlay there shouldnt be a problem
Ok, thanks for your work 👍
this is still coming even if it is the Only plugin, maybe you can like me the last alpha with that it was working
Yeah if you're using the dev build, you gonna have to wait a bit, Ive been in the process of migrating my plugins for 4.2, but I dont think I've done the metatile plugins yet
you have a normal screen Scroll is that working ?
Probably the same issue, a lot of the plugins will need updates to work with 4.2
Thats why its recommended to stick to the official release if you want to use plugins
did some of them work with 4.1.3 ?
They should all work with 4.1.3
oh ok i was only updateing cause in the Plugin window it says
then i will go back to 4.1.3 and all will be fine xD
That was most likely the example project which was using a defunct dev build, but the plugin itself works with 4.1.3
Ok then i will only lose the better adventure features like push animation and 8 way
haha. I changed it to just !=, but the flickering is still present. Might just turn off the sort actors script for now and move on.
Is it okay if use your Mario Mini code for some of my projects? You will be given full credit.
Yeah go ahead, thats why I made it public
A bit of a niche plugin this time
https://github.com/Mico27/gbs-ReserveSpriteTilesPlugin
I was trying to change Redo some of you project from the MetaTile16 but i am not able to change the Metatiles of the Overlay if i use Position X 02 and Y 16 i think he Targets a Tile under the Overlay Got it 😉
I have some problems to understand the "Set Overlay Tile" event 🤔 As you see on the Pic i replaces position 2/0 and 3/0 with Tile 0 But its not the Same Tile How is the Logic behind this ?
could it be that the 3/0 Uses the 0 Tile from the GB Area and the 2/0 uses the 0 Tile from the Additional GBC Area ?
Ah right, color only mode. So what is happening here is that you initialy did a submap to create the hud, which some of the tiles where using tiles from the second tileset bank. So upon submapping, it sets the tilemap tile attribute to use the second bank. So when you use the set overlay tile, it only replace the tile Id from tilemap and does not change the attribute of the tile. Which is why the first set overlay tile picks the tile at index 0 from the first bank at 2,0 and from the second bank at 3,0, because when submapping, the tile at 2,0 was at bank 1 and 3,0 at bank 2
In retrospect I shouldve added an event to change the tile attribute, or added the option to specify the bank when setting the tile id. But for what you are trying to do, Id suggest having a list your items in the hud scene you are submapping from and submap the items from there.
I want to use this HUD Scene also as a menu for choosing the Items i have on A and B but your right i could make 2 Scenes one i use for the real Menu and one i use for the Copy to Overlay function
Is there a Way to fix this or is it imposible to use the text window like this with the plugin ?
It has nothing to do with the plugin, the displaying dialogue uses the overlay, which you are also using for your hud. Also your tileset oversteps the reserved tile space for GBStudio default dialogue ui.
So either you
A. display the dialogue menu at the bottom, make sure your tileset doesnt take up GBStudio default dialogue reserved tile space and redraw your hud once the dialogue is closed
B. Do like how Links awakening does and draw dialogue on the background instead of the overlay (and make sure your tileset doesnt take up GBStudio default dialogue reserved tile space) and redraw the background once dialogue is closed
Yeah i am still not complete in the GBStudio Logic what take up which space at what time. A sounds good, then i need to have the Dialoge border inside the tileset so he loads it too ?
I have a pretty big Tileset (still in testing and optimizing) how can i prevent to use the default dialogue reserved tile space ?
The engine needs the reserved tile space to display dialogue, either you save the space for the dialogue, or you cant use dialogue.
If you are struggling with making the tileset smaller, you can use this plugin which will make it so that it will optimize the tileset and background for flipped tiles
https://github.com/Mico27/gbs-AutoTileFlipPlugin
If you are using it with the metatile plugin, make sure you put the "Auto flip tiles" event in the init of the metatile scene and the main scene
Do you plan on updating the Metatile plug-in once the new GBStudio version finally becomes public?
yes
Hi! I'm trying to figure out the screen scroll plugin, but there isn't really a proper tutorial. I'm confused by all the variable stuff. Would you be able to make a beginner friendly tutorial?
This is what I'm trying to achieve, an infinite loop that when you click on a door, it scrolls in that direction.
The scroll is triggered by the player reaching a screen threshold, but you could configure the triggers to cause that to happen. To set the scenes up for scrolling, add the scroll scene transition event (Set Neighbor Scenes) for each scene
Ohhh that make ssense now.
Unfortunately it seems to glitch out, is this expected behaviour? Or unavoidable due to the scene complexity?
so backgrounds don't work?
If you copy the background to the tilesets folder and then set the tileset used by both scenes to that image, it'll work
It's in the details menu in the upper portion of the scene details pane
would I need to do this for every scene in the game?
Every scene that uses a common tileset, yes. There are ways to work around it but it's a more advanced technique (where you change tiles that are loaded in memory without changing the memory addresses), and Mico has a plugin for that iirc, but you should first get familiar with how the architecture works before attempting it
If you don't use the same common tileset, the graphics won't be as smooth. You can try to get around it by sharing a lot of tiles between tilesets, but you have to make sure they're in the same order in your tileset image, otherwise there'll be glitches
well my game is basically 99% backgrounds, it doesn't use tiles in a conventional sense.
I am aware of that.
You mean, basically, every tileset is mostly unique?
But what I mean is, it's not like the whole game just uses a few select tiles (like say Pokémon), each scene is a different background- Yes ^
That's not as feasible on this hardware without some graphical error.
I see.
You have 384 tiles in color-only mode & I recommend using it, and then reusing as many tiles as possible. It forces a more economic approach to your design, but as the saying goes, limitations breed creativity
So you're saying screen scrolling isn't feasible on this hardware?
for this kind of game?
If you have more than the required maximum number of tiles you won't be able to use the scene transitions for your entire game. Pokémon solved this by having the tunnels and stuff where the screen fades, Link's Awakening also has some places where the screen fades
No, screen scrolling is fine if you reuse a lot of tiles
So what isn't feasible?
Having your backgrounds be mostly unique and avoiding glitched graphics
The glitches only happen when using the screen scroll. Are you saying if I continue using unique backgrounds for each scene I will encounter more graphical errors?
Irrespective of whether I use screen scroll or not?
Is there a limit to how many tiles a GB game can have intrinsically or is it limited by just memory alone?
The glitches happen because it's trying to load more tiles than the GB has memory for. On a normal GB it can store 192 tiles, GBC can store 384. Mico can correct me if I'm wrong but I don't believe it reloads the tileset when you scroll the screen, and so the new scene is using a "new" tileset but still uses the graphics of the old one. (The glitches would still happen even if it reloaded the tileset, you'd just see them when you leave the first scene.)
That's largely a physical limitation, as GBStudio does a decent job of optimizing tiles (but it's going to be better in the next update, though it won't change the issue you're experiencing much).
You won't get graphical glitches if you don't use screen scroll, and as long as you're staying within the tile count, because switching scenes the "normal" way hides the tileset change during the fade. You'd still see the glitches if you did it fadelessly, though.
So just to clarify, we're talking about RAM (vram?) in regard to the 192 limit, the actual limit to how many tiles the game can store but not strictly use at any given time is determined by the amount of storage space on the cart? (Up to ~8MB worth of tiles?)
Yes. And SRAM in regard to the 384 limit. Sorry, should've said "load" instead of "store." But even then you'd have less than ~8MB on the cart because you also need space for the code, for text, actors, and also for the actual scenes themselves. Mico's Metatiles plugin is great for minimizing scene ROM size because it groups tiles into groups of 4, with an upper limit of 256 metatiles, essentially reducing the scene ROM size to a quarter of what it usually is. Common tilesets also reduce the ROM size of scenes since it doesn't need to remap memory for a new tileset.
Of course.
Is this something I can do later on if I feel I might not have enough space? Or is this something best done early on?
Using unique backgrounds for every scene just about doubles the memory that those scenes would use when compared to common tilesets, both because the tilesets and the scene data (tilemap) have to be saved. If you use common tilesets to their fullest extent, you'd only need to store the tileset data once, so the only thing consuming storage space at that point are the tilemaps.
Best to plan the entire game that way, because retrofitting it in the future would probably cause you to redesign many (if not all) of your graphics. It's doable, it's just a chore, and the larger your game gets, the more of a slog it'll be. You may be able to get away with it, but that depends entirely on how much detail you're putting in every scene (as more detail usually means more unique tiles and therefore more ROM space).
Addendum to this thought: the reason why it's doubled is that, with maximum uniqueness, you're looking at 360 unique tiles per scene, and those tiles themselves need to be mapped
360x2
Let's say I didn't bother with the plugin, how many unique backgrounds will I be able to get away with before I run out of storage on the cart?
192 unique tiles consumes about 50% as much additional memory when compared to common tilesets
Tough question, but you could probably get away with 100/200+ scenes, assuming you're using almost all unique tilesets. But even at that point the game's physical data retrieval speeds will be an obstacle before you run out of ROM.
I think the hypothetical limit is somewhere around 500 depending on the complexity and optimization of your graphics, but it's been awhile since I've looked at that calculation
I see. I'm sure it won't be beyond 300 so, for my first project, I'll risk it.
If push comes to shove, I'm sure there'd be a few scenes I could panic compress.
Once you start going down the optimization rabbit hole, you can't go back lol
@unreal haven Every time I enter a new scene the collectables amount on the hud keeps resetting back to zero. What can I do to make sure it remembers the amount for every scene change?
seems to me like you are resetting the value to 0 on scene init
By golly your right, what should I change the value to?
Don't change it 😂
could I get the sample projects for the metatile plugins? I don't see them on the github downloads anymore
They were made on an old dev build that doesnt work anymore, Im currently working on updating the plugins and example projects for 4.2
Pretty much almost all my plugins have been updated for 4.2.0Beta, they have also been updated via 4.2.0Beta's new Plugin manager so you can see them updated there too.
That's very welcome news
any consideration of implementing metatile save/load for a single scene? really interested in seeing it happen and happy to trade work for it or something that was a motivator
That would be an interesting problem IMO. You could do it by using a custom safe file config, and then dynamically allocating save space for each scene, but you'd need approximately 45 variables to store an entire scene (at least, from what I understand of the metatile plugin). It'd be much more economical to instead save individual metatile changes, encoding the metatile as one byte and the position as the second byte, but even then you'd run out of storage space quickly. And if you end up changing the entire scene, you're using a full 90 variables at minimum (assuming you're using close to the smallest scene size possible)
I was thinking since the metatiles are already stored in sram maybe there's some way to just restore from that but I don't have a proper understanding of gb architecture tbh
Its possible since like you said its already in sram, Id need to change how loading the tilemap work, so that I can load the metatile data without reloading the tilemap.
But it would probably be better to have a proper space in sram to actualy save the tilemap data instead of using the "live" one
For the assign metatiles event, how are the 8x8 metatiles numbered? From top left to bottom right?
yes
Hello, I am getting this error even in my newly set up project. What did i do wrong ?
My guess is using the wrong coordinate when referring to either a metatile or a regular tile
I have no script or logic running only set up some scenes, not even connected
Interesting
Actually now that I look at it, it's a syntax error in the file itself. Could be caused by loading metatiles without a metatile scene set up, or just a forgotten ; or something
...and ofc GitHub starts having issues right when I open it up
In the Version befor i could use Scenes with Metatiles and Without, did i now use it in all scenes ?
Aight there doesn't seem to be any issue with the code itself, at least on a syntax level. My (revised) guess is that there's some funky unexpected interaction which Mico needs to address
Thanks for your first watch at it 
Np
which version of the metatile plugin are you using?
the one loaded from the new Plugins Tab
there are 3 of them, which one
Metatile (16px + ScreenScroll) Plugin
ok, gimme a sec Ill lookat it, might be an error from when I updated it for the plugin manager
everything looks fine, I created a new project and dowloaded the plugin via the manager and it compiles, are you using some other plugins too?
only your "Submapping Ex Plugin"
Ha I see there was a missing ;
Not sure why on my end it compiles correctly
Oh I see why, I didnt test it in color mode
Was always good in braking stuff and finding things (Do Testing for a Medical Software Company too)
But i work on the Hardware End
I fixed it but it wont be udpate in the plugin manager until they accept the pull request. If you want to fix it right now, you can go in plugins\Mico27\MetaTile16_ScreenScrollPlugin\engine\src\core and edit the meta_tiles.c file and add the missing ; the end of line 158
ah ok i will do that no problem
thanks for the fast help
Is there a way to replace all tiles of the same type for another one?
Metatiles or regular tiles?
metatiles.
Unfortunately not, at least according to the last time I asked Mico about that
I can do it one by one, but it would take a while
Ok, i'll do it 1 by 1 then
Thanks!
If you're trying to do something kind of like the P switch in mario 3, you can replace the tileset tiles used for your metatile (example, changing the block metatile to use the coin tileset) and change the metatile collision if needed with the Replace Collision event (example changing from solid to no collision) and when you interact with that metatile, you check via a variable that you previously set to mark that you changed the metatile to change the behavior accordingly (example, when colliding with the block metatile, if the variable that specify that the P switch is actived, run the script as if it collided with a coin)
Thanks! It's actually simpler than that, I just need all instances of a particular tile to change color when entering a trigger, to show that you have been detected.
Oh in that case it can be just a palette change
Wouldn't that affect all other tiles that share the same palette?
Just have a palette slot reserved for that tile
That makes a lot of sense actually, thanks.
If I change scene, and the scene has a different palette, but it's in the same slot
Would it still work? Or would it tell me it can't find a matching palette.
It checks for the palette slot index for match, the color is irrelevant
Brilliant! Thanks.
new plugin, thanks @coral vault for the idea
https://github.com/Mico27/gbs-SpritesheetChangeBufferPlugin
Is it version specific or can it be applied to 4.1.3/4.2b? As always, a really helpful plugin!
this one is 4.2b only, further new plugin I'll be making is gonna be 4.2, my previous plugins are still available for 4.1.3 by selecting the branch on github
Is there a downside to it?
It seems like the kind of thing that should be there by default
Its written on the github, the downside is that it doubles the amount of reserved tiles for actors that have a "set actor spritesheet"
Thats how the buffering works
So, say for example you have an actor with a spritesheet that has 8 unique tiles that you want to change to different spritesheets with the biggest one being 16 unique tiles,
then without the plugin it would reserve 16 unique tiles in the tileset VRAM, but would have the tile glitch as shown in the video on the github.
With the plugin, it would reserve double the biggest spritesheet, which would be 32 tiles in the tileset VRAM and will use half of that as a buffer to prevent the tile glitch from happening.
You absolute star! I've just been having a discussion about this very issue in #scripting-help
(Also quite funny that your example is Wario when my usecase is for a Wario game)
On your ScreenScroll Plugin i get from time to time this error ? how can i fix it ? Also i am unsure what i do with the ScreenScroll Settings. is the Transition distance/Threshold in pixels and measured from where ?
The transition distance is how far the player will be moved into the new scene. The threshold is how far away from the edge for the scroll to activate. So basically, you walk up to the edge and as soon as you cross the threshold, the plugin starts the scroll and automatically moves you over to the next scene according to the transition distance
Those are all warnings, I wouldn't worry about them too much. The conditional flow warning just lets you know that the optimizer changed some logic around, and the unreachable code warning means there's code that can't ever be run
yeah I should go and try to clean those warnings eventualy, also the thresholds and distances are in subpixels (32 subpixels for 1 pixel)
Awesome. This will help a lot of people out.
Is there a way to copy part of the tileset onto the overlay?
I believe so iirc
Mico27 have another plugin with that you can copy Background into the overlay (I use it for a Zelda Type UI)
i'm using metatiles16 and the submapping plugins,
I'm attempting to submap from the metatile scene, which works great. however, i'm trying to remove that submapped portion and replace it with the original background tiles, but it doesn't seem to work as usual. any tips?
as usual - ask a question and then you figure it out on your own lol. I wasnt using the "submap metatiles" event, i was using the copy scene submap
i'm looking for a solution for this problem(bit of brain fog this morning), any advice would be appreciated!
When using metatiles to replace a collision object, after calling a submap and then removing it (to get the scene back to normal) the obstacles come back too. What can i do to work around this?
my first thought is to create a true/false statment for if the obstalce is there or not, and place it after the submapping is removed and replaced by the orignal scene, but that's a bit intensive.
You could use #plugins-help message to redraw the background while keeping the changes but that rerenders the whole screen, I guess I could look into making a function that redraw only a section of the screen.
@mossy star may i ask you how you did that ? i working on a Zelda Type game and would like to cut Bushes and Gras, but i couldnt find a good solution where not every bush is an actor
for sure! i'm using metatiles 16 and the custom projecitile plugin. I have the projectile set to destroy on contact, and only be one tile in front of the player. There's an option to run a script when the projectile is destroyed. I run a coodrinate check, and if those coordinates match with an obstacle, I remove the obstacle using the replace metatile event
that would be cool, but only if you think it would be something useful in general
ah ok so you still use 4.1.3
Thank you very much i keep it in mind when Custom projectile Plugin is updatet to 4.2
You could achieve a simlar thing without the custom projectile plugin, when pressing a button, get the current player position and depending on the player direction its facing, add an offset to the position and check what metatile is at that position, then replace the metatile.
that's probably a better alternative. I have a few things i plan on doing with projectiles, so it made sense to use it for my situation.
@unreal haven I use your metatiles16, On the Scenes and the Tileset files do i also have to have all Data that will be loaded on the Overlay ? If not it would save me some space. Do it only need to be the used Backgrounf stuff or also all what could apear in the Overlay ?
The tiles in your metatile scene are only used for the background but the tileset needs to have the tile you need for displaying on the overlay
is there a way to initiate a screen scroll without the player touching the border of a scene? i'm looking to do a zelda (NES) style menu.
what gbs version are you using?
Would it be possible for you to use the window layer for that? You wouldn't even need to scroll the screen if so
4.13
i'm not sure, actually. I just thought using the screen scroll transition would be simpler,
I think it would be harder because you'll have to make sure everything in the scene goes back to the way it was before the player opened the menu. I'm not sure if pushing the scene to the stack saves all the stuff you'd need. If you use the window layer, you can deactivate them all and reactivate them when the player closes the menu
i'm using metatiles16scenescroll, i'm trying to draw text. it works in the starting screen, but when i move to another scene it seems its unable to draw text onto the background?
When the scene scrolls, there's an offset added to be able to achieve the effect, so when you draw to the background, you need to take into account the offset. To get the offset you can use the 'Assign current scene scroll offset to Variable' event and use the variables to add to the position to where you draw your text.
that makes sense, thank you!
worked perfectly. thanks for the help!
the draw text event only allows me to set the y location up to 17, and since the offset is 16 it doesn't give much room for placement options. Is there a gbvm command for drawing text that will let me put whatever number I need for the y location?
The position field in the text event is limiting it because you usually draw text on the overlay.
But since you are drawing to the background, that's not an issue.
You can draw text to the background via position stored in variables with the following GBVM:
VM_LOAD_TEXT 2
.dw VAR_TESTX
.dw VAR_TESTY
.asciz "\003%c%cTEST"
VM_DISPLAY_TEXT```
That reminded me that I can just expose the engine field instead so the next update will have it and also added to the example project
Updated all my plugins, just waiting for the pull request to pass so that its updated from GBStudio's plugin manager
Thank you!
Was just about to ask, I'm using the latest GB studio version and I'm getting this error with the 8x8 metatile plugin
mmh thats weird, have you tried saving, closing gb studio and openning it again and build again?
Let me try, I'll export the engine as well
Same error
Also, I remember this message not showing on my other meta tile projects
Yeah, the unique tile message doesn't show up on my other projects
I installed the plugin via Plugin manager.
they are unrelated to the plugin and are just warning, you other project is Color only so it can have up to 512 unique tiles, the one that says limit is 192 is not color only (and the real limit is 256)
Can you check the settings and the metatile section to see what you have there
Sure, one sec
This is what I have, I know the collissions don't match, but it shouldn't matter if I unticked the boxes right?
Hold on, should there be a ''metatile'' section in the settings page?
Because there doesn't seem to be one.
yes, for some reason you are missing the settings
check your project plugin folder and see if you can see the engine.json file in MetaTile8Plugin\engine
thats the old version of the plugin, can you try redownloading from the plugin manager to see if it fixes it? (the version in the engine.json should be "4.2.0-e29")
Got it, let me delete it first.
Could my GB Studio version be the issue?
I deleted it and reinstalled it. Same error
It seems even when I clicked on remove plugin, it still wasn't deleting it, the folder and files remained.
I installed it manually after deleting it manually. And this shows
But the issue seems to persist.
Latest is GB Studio 4.2.0 Beta2
The plugin was updated for 4.2.0 Beta2 it will not work with previous version
Made the classic mistake of messing with things without a backup. I tried adding something to the metatile tileset and started getting this error. I tried to revert everything to the way it was before but I'm still getting this. The tileset is at 160x144 while the reference scene is 256x256. I've confirmed that none of the tiles shifted by a pixel or anything like that. Anything come to mind that I could've done to cause this error?
make sure you have the same common tileset assigned to both scene, if you are in color mode make sure you have the correct palettes assigned
BW but both definitely have the same Common Tileset and the Load Metatiles Scene refers to proper scene
I disabled the Load Meta Tiles event from the two scenes that use it and the game loaded (broken but no errors). I enabled the first one and it loaded fine. If I either check "match metatile collision" or turn the event on on the second scene, I get that error again.
match metatile collision is only needed if you have metatiles with the same tile data but with different collision data (which you need to paint the collision data to the main scene)
What happens if you disable the load metatiles event from the first scene and enable it on the second?
Ah yep, I'm realizing that wasn't checked before either.
Lemme give it a try
Worked when I did that too.
With that I realized my mistake. I have two identical backgrounds for these two scenes. I accidentally set them both to the same one. When I moved one to the copy, it loaded fine. Woof ha. Working on this game for a while I forget why I do certain things.
Thanks Mico! I was really scared I broke everything.
Is it possible to make this work with 8x8 metatiles? I flipped one tile horizontally and it didn't work.
if you are using color only mode, make sure you are using the "must match color attribute" in the load metatile event
oh and your common tilset has to NOT contain the flipped tile
What do you mean?
This is the flipped tile in question
it has a solid and non solid version.
the flipped tile has to be in the metatile scene, but not in the common tileset
Like this right?
And they can be flipped on any axis right?
Is this always the case, can you have 256 different tiles?, or only flipped tiles
I dont know how much clearer I can be. You can have max 256 metatiles, each metatiles contains the colision data, tile data and attribute data (palette, flips, extra color bank), each tile in the main scene has to match one of those. The automatic flipping feature affects the tileset data, not the metatile data
so the flipped tile has to exist in the metatile scene but not in the common tilset if you use the feature
Understood, sorry, It took me a while to see them as separate things.
It did compile like this, and I didn't see the flipped version on VRAM. But I'm guessing I'm doing something wrong because I can only have 256 tiles here right? So I shouldn't mirror the whole scene like that.
Sorry, you're being very clear, I'm just a little slow.
Made a few updates to some plugin with some new features:
CopyRomDataToRamPlugin now has 2 events that allows compiling an array of far pointers to tilesets or scene (the former useful for animations while the later is useful for changing scene via an index) Also has a new Example project
https://github.com/Mico27/gbs-copyRomDataToRamPlugin
ReplaceTilesetTilesPlugin has an extra event to allow specifying the tileset via a far pointers via variables (to be able to make use of the pior plugin new feature)
https://github.com/Mico27/gbs-replaceTilesetTilesPlugin
Sorry, this is probably simple, but, how do I go about making that HUD scene show up in the Overlay?
this should be set to 0
did you put the common tileset on the hud scene?
No, should I have?
Yes, otherwise the tile ids wont match
I think it sort of worked.
The things that aresupposed to be black squares are indeed just black squares.
But the HUD tiles are just white.
I also have the sneaking suspicion that the overlay is not using the 8th color palette
I tought that was by default?
It's using the palette from the hud scene.
Sorry, it's the first time I mess with the overlay. I don't understand much yet.