#Mico GBS Plugins

1 messages · Page 2 of 1

dense notch
#

im having an issue where my 8 x 8 tiles wont work because the background is 128 x 128 and not 160 x 144

#

but when i check github it shows that the scene is 128 x 128

dense notch
#

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

golden moat
#

The metatiles plugin should work just fine in v4.1.3, you just can't open the demo projects with it.

dense notch
#

either that or its because of the scene size being 128 z 128

golden moat
dense notch
#

im dojng this tomorrow

#

thx

unreal haven
#

its just a warning, you can ignore those

#

the issue is probably something else

dense notch
#

finally

#

and it leads to a cancelled build

#

this is all that happens

golden moat
#

If it's just once, you may have accidentally cancelled the build.

#

(Ctrl+B both starts and cancels testplay building.)

golden moat
#

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.

dense notch
#

alright

#

im trying to figure out how this works

#

rn

#

im looking at the files of the demo project

golden moat
#

Attach Script To Input Ex always shows its name as this for me, which is a bit confusing. Is this a bug?

unreal haven
#

Fixed

golden moat
#

Thanks!

dense notch
unreal haven
#

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

dense notch
#

alright

#

these are all the plugins i have

#

metatile room

#

testroom

#

this is what happens when i run it

unreal haven
#

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.

dense notch
#

alright

sour shoal
#

My game is "Mono + Color," Is it possible to have more than one common tileset for different levels?

golden moat
sour shoal
golden moat
#

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.

severe isle
#

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)

unreal haven
#

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.

severe isle
#

Thanks for the help! I made this with 8px in mind but Ill be sure to fix that

somber spruce
#

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

unreal haven
#

Yeah, both replace the core.c file

somber spruce
#

Ah, darn. Is there any way I could combine them?

unreal haven
#

yeah, just merge them manualy

somber spruce
#

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!

severe isle
#

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?

unreal haven
#

Sounds about the right way to do this

severe isle
#

@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.

shy breach
#

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?

unreal haven
rugged owl
#

Very very cool. Is there any performance hit with this?
I’d check but I’m on a train !:(
looking forward to trying this.

unreal haven
#

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)

rugged owl
#

Fantastic work. I’ll give this a spin for sure.

steel galleon
#

where is this check_player_metatiles function for scripting? is it part of Metatile16?

#

what plugin is this ?

unreal haven
# steel galleon 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

steel galleon
#

essentially checking if an actor is touching a specific metatile I want to replace it and do logic

unreal haven
#

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

steel galleon
unreal haven
#

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

steel galleon
#

thank you

steel galleon
#

I am using player tile X and Y

steel galleon
#

I tried that as well

#

same results

unreal haven
#

the player coordinates are updating the variables correctly?

steel galleon
#

yes

unreal haven
#

What does your scene look like?

steel galleon
unreal haven
#

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?

steel galleon
#

it does not

unreal haven
#

try removing the assign metatile event

steel galleon
#

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

unreal haven
#

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

steel galleon
#

i got it working now

#

thanks a bunch

unreal haven
#

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)

steel galleon
#

ok great

rugged owl
torn laurel
#

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!

unreal haven
#

copy scene pallete doesnt copy an area, it copies the color pallettes of another scene, did you meants the submaping plugin?

torn laurel
unreal haven
#

Submapping wont work for offscreen stuff

torn laurel
unreal haven
#

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

torn laurel
#

ahhh any solution? you know possible @unreal haven

#

cant u copy palletes off screen at all @unreal haven

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

torn laurel
#

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 😊

unreal haven
#

Yeah with the Copy scene submap to background tileset event this should work

torn laurel
#

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?

unreal haven
#

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

torn laurel
unreal haven
#

The palletes isnt the issue, the issue is which tile has which color

torn laurel
#

i kinda get it?

#

not really ;w;

severe isle
#

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")

unreal haven
#

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

steel galleon
unreal haven
jagged plover
#

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.

severe isle
jagged plover
# severe isle I use the metatile plugin on GB Studio 4.1.3, and it works well. What issue are ...

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. :(

severe isle
#

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

jagged plover
#

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.

jagged plover
#

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?

unreal haven
# jagged plover I had given up on using the metatile plugin, but decided to give it a try again ...

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.

jagged plover
#

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.

jagged plover
#

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?

unreal haven
#

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.

jagged plover
unreal haven
#

like I said, the advantage is not having to build it tile by tile, instead you submap it from a separate scene.

jagged plover
#

Ah, sorry. I am a bit slow. redmafia30

jagged plover
severe isle
jagged plover
unreal haven
jagged plover
unreal haven
#

no it should be fine, not sure how changing the palette causes this tho

jagged plover
#

I spoke too soon.

unreal haven
#

At this point Id need the project to see whats going on, there might be something amiss

jagged plover
unreal haven
# jagged plover Alright.

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.

jagged plover
#

Thank you so much, you are the best!!

jagged plover
#

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.

unreal haven
#

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.

jagged plover
#

Sounds complicated! Time to be creative, then!

#

Thank you ;3

unreal haven
#

you can specify the collision behavior and even get the projectile position when its deleted and run a script

jagged plover
rocky prairie
somber spruce
#

in the same fields, you can select 'update variables' to store the x and y pos of the projectile

rocky prairie
#

I'll test this, thanks!

jagged plover
#

Hi, Mico. Are the fire bars in SMB. Mini made with metatile swapping or are they actors?

unreal haven
#

They're actors, I painstakingly animated each frames of the rotation of the bar by hand (which is why its a bit choppy)

jagged plover
#

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.

unreal haven
#

Its not parallax, its the overlay with a scanline cutoff

jagged plover
#

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

unreal haven
icy flume
# jagged plover I do not understand the funny words you said, but I am glad there is a way to ha...

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.

jagged plover
#

Thank you so much for explaining, Mico and Cayenne!

somber spruce
#

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)

unreal haven
jagged plover
#

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.

young prism
#

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

jagged plover
young prism
jagged plover
#

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.

unreal haven
#

The scrollscene plugin is not compatible with the metatile plugin, which is why there isa version of the metatile plugin that incorporates it

toxic knoll
#

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

somber spruce
#

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?

somber spruce
#

Ah ok, I worked it out using Pautomas' Camera Fields plugin to get the camera scroll position

jagged plover
#

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.

unreal haven
#

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

severe isle
# jagged plover How do I create new metatile states? I am hoping to set up bigger collectibles [...

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

jagged plover
#

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.

torn laurel
#

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!

severe isle
#

@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)

unreal haven
#

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
torn laurel
unreal haven
torn laurel
#

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 :))

severe isle
# torn laurel my issue with the github is i struggle to understand what it all means, its word...

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

torn laurel
torn laurel
#

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

severe isle
torn laurel
#

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

severe isle
torn laurel
#

like do i need every tile in the metatiles stage?

severe isle
torn laurel
#

oh okay, could i know why? 😊

#

it explains why its likely not working

severe isle
torn laurel
severe isle
torn laurel
severe isle
#

No, the scene tileset stays the same when loading metatiles

torn laurel
#

oh okay :))

#

@severe isle this is what i have :)) much simplier scene!

severe isle
torn laurel
#

this is what i see :))

severe isle
# torn laurel 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:

torn laurel
#

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

severe isle
# torn laurel i think im stupid

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.

torn laurel
#

okay done! :))

severe isle
#

Could you show me your project's plugins folder?

torn laurel
#

yes i can happily! :))

#

this is what im currently using :))

severe isle
#

That looks good, but if you're using the Metatile16Plugin, then all tiles must be aligned with a 16 pixel grid

torn laurel
#

the rings are 16x16

severe isle
severe isle
# torn laurel 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.

torn laurel
severe isle
# torn laurel like im not sure what it means by on_metatile_enter, or platform c, not sure wha...

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.

severe isle
torn laurel
#

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

severe isle
torn laurel
#

most of them

severe isle
torn laurel
#

okay thank u :))

severe isle
torn laurel
#

here u go :))

severe isle
#

Where did "MetaTile16Plugin" go?

torn laurel
#

oh i didnt know i was ment to keep both 😭

#

thats my bad 😭

severe isle
#

No worries! Returning the plugin should fix the issue

torn laurel
#

got it back! :))

#

what do i do now? :))

#

what i currently have :))

severe isle
torn laurel
#

okay done :))

#

why did we do that? :))

severe isle
# torn laurel okay done :))

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

severe isle
#

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

torn laurel
#

oh okay? wont it give me the error message that its missing the other tiles? why are we making all tiles metatiles?

severe isle
torn laurel
#

oh wait so this limits the tile count to 128? :0

#

so is this closer to what i want?

severe isle
torn laurel
#

oh okay haha, makes sense :))

severe isle
torn laurel
#

ah okay makes sense :))

#

deleted!

#

what now? 😊

severe isle
#

Make sure that the metatile scene has collision on the tiles you want, then compile the project

torn laurel
severe isle
torn laurel
#

like

#

hold on

#

this is the shared tileset, or do we not need a shared tileset right now

#

im confused

#

like this

severe isle
torn laurel
#

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

severe isle
#

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.

torn laurel
#

okay thank u :))

#

tried loading it, didnt work

severe isle
#

Could you please show the test scene and the metatiles scene?

torn laurel
#

there u go :))

#

any idea? @severe isle

severe isle
#

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?

torn laurel
#

yes ofc! 😊

#

there u go :))

#

thats all of them

severe isle
#

Could you try using this image for both the common tileset and the metatile source?

torn laurel
#

yes! :))

severe isle
#

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?

torn laurel
#

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!

severe isle
torn laurel
#

issue has moved though?

severe isle
#

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?

severe isle
#

Click the "metatiles" scene and make sure it uses the same Common Tileset as the "test scene" scene

torn laurel
#

botha re using the same tileset

#

can i send u my project in dm's ,cuz i have no idea what im doing wrong.

severe isle
#

That's alright

(Edit: Situation resolved! A fresh install of Metatile16Plugin was needed.)

spare hornet
#

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?

jagged plover
#

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?

Super Mario Wiki

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.

severe isle
# jagged plover Hey, <@968200036628434954> ! Hope you are doing well today. So, sometime ago I a...

(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.

jagged plover
severe isle
#

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".

jagged plover
jagged plover
severe isle
severe isle
jagged plover
severe isle
jagged plover
severe isle
jagged plover
#

In case I messed something up, here is how it looks now.

severe isle
jagged plover
severe isle
# jagged plover In case I messed something up, here is how it looks now.

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

jagged plover
#

Is there a specific place I should put the "VM_GLOBAL(VAR_HITBLOCKID) = tile_id;", so long as it is before the "break;"?

severe isle
jagged plover
unreal haven
#

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)

severe isle
severe isle
#

I would think that putting each collectible type into different script_execute would absolve this (requires more custom Metatile states, however)

unreal haven
#

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)

severe isle
unreal haven
#

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:

severe isle
#

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.

unreal haven
# severe isle

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

GitHub

Plugin to enable actor flickering when too many sprites are being render (either by scanline limit or by OAM limit) - Mico27/gbs-flickerActorPlugin

GitHub

GBStudio plugin that allows editing the order of the actor in the active actor list used for rendering and OAM order - Mico27/gbs-EditActorActiveIndexPlugin

jagged plover
unreal haven
unreal haven
#

thats the header file

jagged plover
unreal haven
jagged plover
unreal haven
#

put a breakpoint on the switch event in your script to see if it triggers

jagged plover
#

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!

jagged plover
#

How do I make a new metatile state? I would like to replace the triggers I use for spike hazards for metatiles.

severe isle
#

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.

severe isle
# unreal haven thanks for letting me know, the issue wasnt specific to the camera offset but wa...

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.

unreal haven
jagged plover
torn laurel
#

hey @unreal haven ur scroll plugin doesnt seem to work with auto color at all, any plan to fix this if possible? :))

severe isle
unreal haven
torn laurel
#

oh okay, thank u! :))

jagged plover
severe isle
#

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.

jagged plover
#

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?

severe isle
jagged plover
severe isle
#

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

jagged plover
#

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

jagged plover
#

Help me, @unreal haven :3

jagged plover
#

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.

unreal haven
#

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

jagged plover
jagged plover
young prism
clear gate
#

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 😊

unreal haven
#

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

clear gate
unreal haven
#

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

clear gate
#

thank u!! :))

fossil forge
#

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

fossil forge
# unreal haven 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?

unreal haven
#

Yes

fossil forge
#

thanks thanks

severe isle
#

@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.

unreal haven
#

Its all open source, feel free to use whatever

fossil forge
# unreal haven Yes

looks like VM_LOAD_TILESET doesnt support the second bank, it just wraps around to the start of the first one, unless im misunderstanding

unreal haven
#

VM_LOAD_TILESET loads from a background tileset, if that background has tiles in the other bank, it will load it

fossil forge
#

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

jagged plover
rugged owl
unreal haven
#

Also make you update the plugin, there was a fix for when actor get activated/deactivated

rugged owl
#

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 ¯_(ツ)_/¯

unreal haven
#

oops forgot to add an additional check if theres only the player and exactly one actor

rugged owl
#

Ta !:) I’ll let you know how it goes.

rugged owl
#

@unreal haven worked out really great. Thank you! 🍻

rocky prairie
#

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

rocky prairie
#

Messed with the tile priority and it finally compiled, I dunno why it froze before tho

unreal haven
#

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

rocky prairie
#

Thanks!

rocky prairie
#

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

unreal haven
#

No, thats the way to do it

loud owl
#

Your plugins are awesome. So many useful features

mossy star
#

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

unreal haven
#

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

mossy star
sour shoal
#

I want to experiment with your pinball engine, is there an easy way to access the nightly build of GBStudio?

unreal haven
# sour shoal I want to experiment with your pinball engine, is there an easy way to access th...

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

GitHub

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system - Fix issue where input text in dropdown search fields was unreadable i… · chrismaltby/gb-stud...

mossy star
mossy star
#

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

unreal haven
#

Latest official release is 4.1.3

young prism
severe isle
# mossy star 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

unreal haven
#

instead of this way

#

They dont seem to have a github repo for this so I cant pull request a fix so ho well

severe isle
unreal haven
unreal haven
pulsar sage
#

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.

unreal haven
#

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

pulsar sage
unreal haven
#

Yeah I can reproduce it, looking into it

unreal haven
icy flume
loud kiln
#

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.

young prism
#

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

loud kiln
#

Ah, that was it. Thank you, friend. I really appreciate your help

somber spruce
#

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.

unreal haven
#

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

somber spruce
#

Ah dang. I remembered you talking about it a while back, was that specific to the 8px version? #works-in-progress message

unreal haven
#

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

somber spruce
#

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.

unreal haven
#

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

unreal haven
#

You can round it easily by just doing this:

somber spruce
#

Yesss that did it! Thanks so much

mossy star
#

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?

young prism
#

Should be on the GitHub pages I believe

mossy star
#

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?

unreal haven
#

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

mossy star
#

That's incredibly useful. sounds too easy to be true!

mossy star
unreal haven
#

No, it can only store one entire map at a time, so if you change to another metatile scene, it will be replaced.

mossy star
mossy star
unreal haven
#

The scene size limit applies regardless of additional plugins

mossy star
#

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.

young prism
#

I'm not Mico but from my knowledge of how the metatiles work, no

somber spruce
# unreal haven You can round it easily by just doing this:

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?

somber spruce
#

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...

somber spruce
#

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.

mossy star
# unreal haven <@1153122719970377839> Heres how you can do it, in the main scene where you loa...

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.

unreal haven
#

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

mossy star
#

Dang, might be a bit beyond my abilities at the moment 😅

mossy star
#

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?

young prism
#

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

mossy star
young prism
#

Are you not using text on the window layer as your UI?

mossy star
young prism
#

Hmm, interesting

mossy star
#

sort of a temporary workaround for the time being while i sort it out

young prism
#

How big are your UIs that you need 40 tiles? Lol

mossy star
#

haha 2 tiles in height, one across the top and one across the bottom.

young prism
#

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

mossy star
#

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.

young prism
#

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

sour shoal
#

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?

unreal haven
#

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

sour shoal
unreal haven
sour shoal
#

Max scene height is 16, max width is 128.

young prism
#

16x16 is 256, 128x16 is 2048. Your scene is bigger

sour shoal
unreal haven
#

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.

unreal haven
rose oracle
#

@unreal haven I did what it says on your GitHub to a 8 tile game.

  1. I created the stage1 scene of the game in assets/backgrounds.
  2. I created a 128x128px “metatile” scene in assets/backgrounds.
  3. I created the tileset in assets/tileset.
  4. 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?

unreal haven
#

You probably, put the whole example project in the plugin folder instead of just the plugin

rose oracle
unreal haven
#

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

rose oracle
#

🤦

#

It's true

#

Sorry

unreal haven
#

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

rose oracle
#

My fault. It's just a matter of paying attention.

rose oracle
#

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?

severe isle
#

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)

severe isle
unreal haven
mighty lava
#

@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?

young prism
#

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)

jagged plover
#

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?

young prism
#

Make sure the projectile position is using the same units as the metatile plugin

unreal haven
#

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

jagged plover
young prism
#

$variable >> 4
Edit: had the bitshift backwards

jagged plover
#

Something like this?

young prism
#

Ye

somber spruce
#

Hey there. Is there a maximum possible area of metatiles that can be submapped? My more ambitious attempts have been unsuccessful

somber spruce
#

Ah no worries, it was a different problem. Solved.

full path
#

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.

full path
#

The problem is that the scene ingame now doesn't have collision.

#

Even when the metatile scene and the main one has it.

young prism
#

It'd help if you gave more screenshots

#

Not much anyone here can do just based on "something's going wrong"

full path
#

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.

full path
young prism
#

Does it work if you turn off metatile collision matching? It doesn't look like you're reusing the same times with different collision

full path
#

The default didn't work so I turned on the matching, and it didn't work either.

young prism
#

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?

full path
#

I'm using the latest version.

#

4.1.3

young prism
#

Are you using color-only mode?

unreal haven
#

You are most likely using another plugin that overrides the collision file

full path
#

Basically the game is broken. :((

young prism
#

Are you using the metatile + platformer plus version?

full path
full path
full path
#

This plugin is so easy to be broken, like some kind of spaghetti.

unreal haven
#

There's no support for plugins to validate settings so 🤷‍♂️ gotta deal with it.

full path
unreal haven
#

replacing is if you want to replace just one tile, submapping to replace a section of it from abother scene.

full path
#

Like how submap background works?

unreal haven
#

No

mossy star
#

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

young prism
#

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

mossy star
#

would that not interfere with any dialogue/menu boxes?

young prism
#

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

unreal haven
#

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

mossy star
#

The scene I'm using parallax in doesn't actually use any metatiles.

young prism
#

Then... The metatile plugin isn't the problem

unreal haven
#

I mean it could be since its modifying the scroll code, I'll look into it

mossy star
young prism
#

What kind of glitch are we talking about?

mossy star
#

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

young prism
#

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

mossy star
# young prism I see

that's what i thought too, so i disable all pallete changes and set the entire screen to one pallete, and it still occurs.

young prism
#

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?

young prism
#

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?

mossy star
#

the glitched tiles appear as soon at the camera moves, before any palette changes.

young prism
young prism
#

What are you using for dialogue? A plugin, or built-in?

mossy star
#

however, without the menus it still occurs so i dont think drawing them is the issue.

#

nothing occurred in the debugger, either.

#

it didn't occur when solely using the advanced menu plugin, only when i added the metatile16

young prism
#

Interesting. The palette of the very first tile seems to be influenced by the camera position

mossy star
#

i am moving the camera by moving the player to get a smoother transition. im not sure if it would make a difference

young prism
#

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?

mossy star
#

when altering the speed of parallax layer 2, it gets sigificantly worse

young prism
#

Define significantly worse

mossy star
#

that's with layer 2 set to 1/2. it gets worse the slower its set

young prism
#

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

mossy star
#

it's a shame it's literally 3 tiles being affected lol, for what i'm trying to do

young prism
#

Oh it's a lot more than three tiles lol

mossy star
#

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

unreal haven
mossy star
#

Does tileswapping still work as usual in the metatiles plugin?

unreal haven
#

Yes and no, its been discussed here: #1270176849393221783 message

mossy star
unreal haven
#

the bug fix was made for all the versions of the metatile plugins

sour shoal
#

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?

mossy star
#

can you set the speed of the scroll in metatiles16screenscroll?

unreal haven
unreal haven
mossy star
mossy star
young prism
#

Scene size is 160 x 128 (2 tiles smaller vertically) and uses non-modal window for UI

jagged plover
#

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?

mossy star
#

How does screen scroll affect actors? I noticed when scrolling to a different scene, the actors vanish.

young prism
#

It's loading the actors for the new scene & the old ones are unloaded. Pretty sure it's unavoidable

mossy star
#

Well, I say different scene but I'm scrolling into the current scene.

mossy star
#

I'm trying to get actor followers to work using the screen scroll plugin, currently.

young prism
young prism
mossy star
young prism
#

Vibrate?

mossy star
# young prism 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.

young prism
#

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

mossy star
#

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.

somber spruce
#

Hmm damn, was hoping to combine those plugins myself

mossy star
somber spruce
mossy star
#

I'll let you know how it turns out

willow sinew
#

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.

young prism
#

It's a dialogue box option

unreal haven
#

making HUD stuff should be the same regardless if you are using the plugin or not

sour shoal
#

Would large scenes work with the scene scroll plugin?

unreal haven
#

no, screen size scene only

willow sinew
willow sinew
#

Is there a version of the metatile screen scroll plugin that uses 8x8 tiles?

willow sinew
#

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.

unreal haven
#

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.

willow sinew
#

cool! i'm glad theres a simple solution. thank you.

willow sinew
#

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?

unreal haven
#

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

willow sinew
#

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.

unreal haven
#

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

willow sinew
#

unfortunately, it's still flickering.

willow sinew
#

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.

unreal haven
#

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

patent turtle
#

I got allot of errors whe i try to use your MetaTile16 Plugin -> Any idea what the problem could be

young prism
#

Are you using the platformer+ version of metatile?

patent turtle
#

No Idea 😅 I used the MetaTile16 Folder from his Github

young prism
#

There's a version on his github which is compatible with platformer+, looks like that's probably the issue

patent turtle
#

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.

unreal haven
#

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

#

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

patent turtle
#

Ok, one more question. can i use tile swopping In the "MenuMap" to update Hearts and the Weapons ?

unreal haven
#

Sure, if it done on the overlay there shouldnt be a problem

patent turtle
#

Ok, thanks for your work 👍

patent turtle
unreal haven
#

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

patent turtle
#

you have a normal screen Scroll is that working ?

unreal haven
#

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

patent turtle
#

did some of them work with 4.1.3 ?

unreal haven
#

They should all work with 4.1.3

patent turtle
#

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

unreal haven
#

That was most likely the example project which was using a defunct dev build, but the plugin itself works with 4.1.3

patent turtle
#

Ok then i will only lose the better adventure features like push animation and 8 way

willow sinew
sour shoal
#

Is it okay if use your Mario Mini code for some of my projects? You will be given full credit.

unreal haven
unreal haven
patent turtle
#

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 😉

patent turtle
#

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 ?

unreal haven
#

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.

patent turtle
#

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

patent turtle
#

Is there a Way to fix this or is it imposible to use the text window like this with the plugin ?

unreal haven
#

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

patent turtle
#

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 ?

unreal haven
#

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 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

sour shoal
#

Do you plan on updating the Metatile plug-in once the new GBStudio version finally becomes public?

unreal haven
#

yes

merry spruce
#

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.

young prism
#

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

merry spruce
#

Unfortunately it seems to glitch out, is this expected behaviour? Or unavoidable due to the scene complexity?

young prism
#

Sorry, both scenes need to use the same common tileset

#

Forgot to mention that

merry spruce
young prism
#

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

merry spruce
young prism
#

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

merry spruce
young prism
#

Backgrounds are made of tiles

#

Read the docs for backgrounds on gbstudio.dev

merry spruce
#

I am aware of that.

young prism
#

You mean, basically, every tileset is mostly unique?

merry spruce
#

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 ^

young prism
#

That's not as feasible on this hardware without some graphical error.

merry spruce
#

I see.

young prism
#

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

merry spruce
#

So you're saying screen scrolling isn't feasible on this hardware?

#

for this kind of game?

icy flume
#

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

young prism
#

No, screen scrolling is fine if you reuse a lot of tiles

merry spruce
#

So what isn't feasible?

young prism
merry spruce
#

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?

young prism
#

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.

merry spruce
young prism
#

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.

merry spruce
#

Of course.

merry spruce
young prism
#

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.

young prism
# merry spruce Is this something I can do later on if I feel I might not have enough space? Or ...

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).

young prism
#

360x2

merry spruce
#

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?

young prism
#

192 unique tiles consumes about 50% as much additional memory when compared to common tilesets

young prism
#

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

merry spruce
#

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.

young prism
#

Once you start going down the optimization rabbit hole, you can't go back lol

sour shoal
#

@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?

unreal haven
#

seems to me like you are resetting the value to 0 on scene init

sour shoal
young prism
#

Don't change it 😂

echo python
#

could I get the sample projects for the metatile plugins? I don't see them on the github downloads anymore

unreal haven
#

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

unreal haven
#

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.

young prism
#

That's very welcome news

fossil forge
young prism
#

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)

fossil forge
unreal haven
#

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

rocky prairie
#

For the assign metatiles event, how are the 8x8 metatiles numbered? From top left to bottom right?

unreal haven
#

yes

patent turtle
#

Hello, I am getting this error even in my newly set up project. What did i do wrong ?

young prism
#

My guess is using the wrong coordinate when referring to either a metatile or a regular tile

patent turtle
#

I have no script or logic running only set up some scenes, not even connected

young prism
#

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

patent turtle
#

In the Version befor i could use Scenes with Metatiles and Without, did i now use it in all scenes ?

young prism
#

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

patent turtle
#

Thanks for your first watch at it yea

young prism
#

Np

unreal haven
patent turtle
#

the one loaded from the new Plugins Tab

unreal haven
#

there are 3 of them, which one

patent turtle
#

Metatile (16px + ScreenScroll) Plugin

unreal haven
#

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?

patent turtle
#

only your "Submapping Ex Plugin"

unreal haven
#

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

patent turtle
#

Was always good in braking stuff and finding things (Do Testing for a Medical Software Company too)

#

But i work on the Hardware End

unreal haven
#

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

patent turtle
#

ah ok i will do that no problem yeah thanks for the fast help

rocky prairie
#

Is there a way to replace all tiles of the same type for another one?

young prism
#

Metatiles or regular tiles?

rocky prairie
#

metatiles.

young prism
#

Unfortunately not, at least according to the last time I asked Mico about that

rocky prairie
#

I can do it one by one, but it would take a while

#

Ok, i'll do it 1 by 1 then

#

Thanks!

unreal haven
#

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)

rocky prairie
#

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.

unreal haven
#

Oh in that case it can be just a palette change

rocky prairie
#

Wouldn't that affect all other tiles that share the same palette?

unreal haven
#

Just have a palette slot reserved for that tile

rocky prairie
#

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.

unreal haven
#

It checks for the palette slot index for match, the color is irrelevant

rocky prairie
#

Brilliant! Thanks.

unreal haven
toxic knoll
#

Is it version specific or can it be applied to 4.1.3/4.2b? As always, a really helpful plugin!

unreal haven
#

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

rocky prairie
#

Is there a downside to it?

#

It seems like the kind of thing that should be there by default

unreal haven
#

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.

limpid leaf
limpid leaf
#

(Also quite funny that your example is Wario when my usecase is for a Wario game)

patent turtle
#

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 ?

young prism
#

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

young prism
unreal haven
#

yeah I should go and try to clean those warnings eventualy, also the thresholds and distances are in subpixels (32 subpixels for 1 pixel)

coral vault
rocky prairie
#

Is there a way to copy part of the tileset onto the overlay?

young prism
#

I believe so iirc

patent turtle
mossy star
#

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

mossy star
#

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.

unreal haven
#

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.

patent turtle
#

@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

mossy star
mossy star
patent turtle
#

ah ok so you still use 4.1.3

patent turtle
unreal haven
mossy star
patent turtle
#

@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 ?

unreal haven
#

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

mossy star
#

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.

unreal haven
#

what gbs version are you using?

loud owl
mossy star
mossy star
loud owl
mossy star
#

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?

unreal haven
#

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.

mossy star
#

worked perfectly. thanks for the help!

mossy star
#

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?

unreal haven
#

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```
unreal haven
#

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

unreal haven
#

Updated all my plugins, just waiting for the pull request to pass so that its updated from GBStudio's plugin manager

rocky prairie
unreal haven
#

mmh thats weird, have you tried saving, closing gb studio and openning it again and build again?

rocky prairie
#

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.

unreal haven
#

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

rocky prairie
#

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.

unreal haven
#

yes, for some reason you are missing the settings

rocky prairie
#

Should I try to install it manually?

#

Instead of using the plugin manager.

unreal haven
#

check your project plugin folder and see if you can see the engine.json file in MetaTile8Plugin\engine

rocky prairie
unreal haven
#

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")

rocky prairie
#

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.

unreal haven
#

Latest is GB Studio 4.2.0 Beta2

#

The plugin was updated for 4.2.0 Beta2 it will not work with previous version

rocky prairie
#

Silly me, Thanks!

#

Yup, that was the issue. Thanks!

somber patio
#

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?

unreal haven
#

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

somber patio
#

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.

unreal haven
#

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?

somber patio
#

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.

rocky prairie
#

Is it possible to make this work with 8x8 metatiles? I flipped one tile horizontally and it didn't work.

unreal haven
#

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

rocky prairie
#

This is the flipped tile in question

#

it has a solid and non solid version.

unreal haven
#

the flipped tile has to be in the metatile scene, but not in the common tileset

rocky prairie
#

Like this right?

unreal haven
#

you can only have 256 metatiles

#

the flipped version have to be within those

rocky prairie
#

And they can be flipped on any axis right?

rocky prairie
unreal haven
#

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

rocky prairie
#

Understood, sorry, It took me a while to see them as separate things.

rocky prairie
# rocky prairie Like this right?

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.

unreal haven
#

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

GitHub

Custom event to read banked data into variables. Contribute to Mico27/gbs-copyRomDataToRamPlugin development by creating an account on GitHub.

GitHub

Load to the VRAM tileset using a tileset (instead of a background) - Mico27/gbs-replaceTilesetTilesPlugin

rocky prairie
#

Sorry, this is probably simple, but, how do I go about making that HUD scene show up in the Overlay?

unreal haven
#

this should be set to 0

rocky prairie
#

I'm getting garbage tiles.

#

This is the scene I'm trying to copu off of.

unreal haven
#

did you put the common tileset on the hud scene?

rocky prairie
#

No, should I have?

unreal haven
#

Yes, otherwise the tile ids wont match

rocky prairie
#

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.