• Most people probably don't realise this, but this forum has had two editors for a number of years. One is the xenForo default editor, and the other is a custom editor I made years back I called BBCEd.

    All the settings for which editor you use was lost during the upgrade. You can find the setting under Account Settings > Preferences > Editor.

Using OoB tiles in your maps

Old topic!
The last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.
Sep 25, 2019 at 7:55 PM
Shark bully
"In Soviet Russia, graves keep YOU!"
Join Date: Jul 20, 2015
Location: Under sea level or something
Posts: 731
Age: 21
#1
I'm a bit out of touch with the modding communities so I can't confirm but as far as I know this is a little useful quirk that isn't too well known, and I felt like it might as well be documented in a post like this.
Basically this is gonna be a post on the behavior of tilesets regarding the use of out of bounds tiles. I'm gonna assume that you have at least a bit about tileset modding.

As you may or may not know, tilesets can be 256×64 to 256×256 in resolution, if your tileset is smaller is smaller than the max size, then the tile space you're missing out on is considered out of bounds.

There's a couple ways to put an out of bounds tile in your map, as you can't just directly select one in Booster's Lab:
1. <CMP can set a tile directly to any tile you want, and if you <SMP beyond tile #0, it'll roll back to tile #255, regardless of tileset size (The same thing happens with <CMP, so don't bother trying to go beyond 255 because #256 will just be #0).
2. Editing your map with a larger tileset before switching over to whatever smaller tileset you intended to use.
3. Using the copy tool in BL by selecting tiles with an out of bounds ID in another map, and then using your selection in the map you want to put these in (This may not work in older versions as tile selections may not be global in them and i've no idea in what version this was changed).

Now that we know how to ruin our map with tiles that dont even exist in their tilesets, we must know why we actually want to do this.
Simply put, these out of bounds tiles will look like the tiles of previously loaded tilesets. Now putting it that way might not be so very clear, so lets go it over step by step.

First, we make this map using the vanilla White tileset (the one for the Balcony). If you don't remember how that looks like refer to the PrtWhite.bmp file in the data/stages folder.

This is a simple map, with a single pot entity. But say we want to make a version of the same map using the Outer Wall tileset (PrtOside), so we copy the tiles, fill in a new map, and change the ground a bit and add the pot. In the editor it should look like this;

However, if we use the pot to go from the first map to the second, it will look like this:

Now, as you may know, the Outer Wall tileset does not have grass, so how did it get into this map?!
Imagine the 'tileset memory' as a 256x256 image, if we load a map, it's tileset is loaded into this image right at the top, for example with Balcony's tileset it will be loaded like this (And my bad for the poor man's representation but I am too tired to worry about copyright issues and if they even apply in this case if I post the full tilesets):

The tileset (including all the empty black space the tileset has) is 256×240 in size, which means it almost fills up this entire 'tileset memory'.
Now you may normally expect the Outer Wall tileset to just replace the tileset already in the memory, but it will actually load on top of the current like this:

The previous tileset is still there! The new 256×64 tileset only has replaced a small portion of the previous one, which actually still leaves it perfectly usable. If White had any spikes in the non-overwritten area, we could've placed these in our map even if Oside didn't have them.
If we load another tileset, it'll be pasted on top of these two just like how Oside went onto White. Of course, these tilesets are loaded when Cave Story loads a map.

Note that by default, White will always be loaded because of the intro cutscene using this tileset.
And also very important: THIS DOES NOT SAVE.
Because of this, I severely discourage allowing the player to save in a map that makes use of this technique unless you know what you're doing. Nobody likes incorrectly loaded maps after all.

While writing this post I've also had a case of the 'tileset memory' being refreshed for whatever reason after tabbing in after a while, though I haven't managed to do this a second time so make of that what you will.

There's various ways to make use of this, but what you basically want to do is load a map from a map whose tileset has parts that you want to use in the new map. A cool side effect from this is that you practically can have variable tiles by using multiple maps, not only growing the amount of tiles you can technically use for one map, but also possibly greatly reducing the need of many <CMP commands or entrance events.
You can even make a map change time or season (though this sadly doesn't work on backgrounds so you gotta find a solution for that yourself) by just entering a door that fades out before fading in on a changed variant of the same map, hiding the fact that you actually loaded a different map and went back.
I recommend trying things out and see what you can come up with, there could be some pretty neat things that can be done with this that would otherwise require large amounts of TSC or even assembly.

I hope I covered everything surrounding this subject and well enough at that since I'm tired and not very confident about my writing as someone who doesn't speak native English and I've a tendency to mess something up when I make a thread anyway.
If there's anything I missed, made any mistakes or left some things unclear please mention that.

I'm posting this mostly so others can try this out and maybe find cool ways to make their mod's maps, and also so it's a bit better documented than just a profile post or random concept posts I may have made in Discord servers.
So yeah, thanks for reading this massive wall of text and I hope it comes to some use for someone.
 
Sep 25, 2019 at 9:11 PM
Best elf
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location: Cygnus
Posts: 2215
Age: 25
#2
I am previously aware of this quirk being a thing within Cave Story's engine. It's fine to come and go mess around with this if this is what you want. But just in case someone comes and asks "well, how do I make sure this doesn't happen?" I recommend just making all tilesets 256x256 in resolution so the large, blank, black space (which will be transparent in-game) can overwrite any of the overlapping tiles.
 
Sep 26, 2019 at 12:19 AM
gigantic immortal dog...?
"That dog!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1728
#3
I think I used a form of this in one of my unfinished things. If I recall correctly, I stumbled upon the fact if you don't set a tileset, the previously loaded tileset would be used.
 
Sep 26, 2019 at 1:51 AM
Soup Man
"In Soviet Russia, graves keep YOU!"
Join Date: Jul 15, 2014
Location: Soup
Posts: 650
Age: 3
#4
this is cool but does it have any practical uses
There's various ways to make use of this, but what you basically want to do is load a map from a map whose tileset has parts that you want to use in the new map. A cool side effect from this is that you practically can have variable tiles by using multiple maps, not only growing the amount of tiles you can technically use for one map, but also possibly greatly reducing the need of many <CMP commands or entrance events.
You can even make a map change time or season (though this sadly doesn't work on backgrounds so you gotta find a solution for that yourself) by just entering a door that fades out before fading in on a changed variant of the same map, hiding the fact that you actually loaded a different map and went back.
I recommend trying things out and see what you can come up with, there could be some pretty neat things that can be done with this that would otherwise require large amounts of TSC or even assembly.
I'm not sure what you mean by any of this. If you need to load the new tileset on top of the old tileset anyway, isn't it just easier to have all the tiles on one tileset? if you need to fade out and fade in, most people just assume you're using a <TRA anyway. i can only see this as useful if you're too lazy to just copy the tiles from one tileset to another if you use two that have the same tiles.

this just seems like <TRA with extra steps, but it is an interesting mechanic. thanks for posting these findings

EDIT: wait nevermind i reread and understood what you meant with the changing seasons thing. guess thats more efficient than making a new map. i initially thought that this wasnt that useful then i realized you can actually change quite a bit of tiles with minimal effort this way. epic
 
Last edited:
Sep 26, 2019 at 5:10 AM
Perfectionist
CS Beta Content Discord Admin
CSE Discord Moderator
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1590
Age: 119
#5
So TL;DR Cave Story doesn't clear its sprite buffers.

There's a couple ways to put an out of bounds tile in your map, as you can't just directly select one in Booster's Lab:
1. <CMP can set a tile directly to any tile you want, and if you <SMP beyond tile #0, it'll roll back to tile #255, regardless of tileset size (The same thing happens with <CMP, so don't bother trying to go beyond 255 because #256 will just be #0).
2. Editing your map with a larger tileset before switching over to whatever smaller tileset you intended to use.
3. Using the copy tool in BL by selecting tiles with an out of bounds ID in another map, and then using your selection in the map you want to put these in (This may not work in older versions as tile selections may not be global in them and i've no idea in what version this was changed).
4. Just edit the pxm file. Come on...
 
Sep 26, 2019 at 6:09 AM
Shark bully
"In Soviet Russia, graves keep YOU!"
Join Date: Jul 20, 2015
Location: Under sea level or something
Posts: 731
Age: 21
#6
Just edit the pxm file. Come on...
I mean yeah you're not wrong, but do we even have any proper tools to do so? Just doing it in a hex editor sounds like a rough time.
 
Sep 26, 2019 at 6:11 AM
Perfectionist
CS Beta Content Discord Admin
CSE Discord Moderator
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1590
Age: 119
#7
I mean yeah you're not wrong, but do we even have any proper tools to do so? Just doing it in a hex editor sounds like a rough time.
It's one of the simplest darn formats ever. If you're really pissing yourself finding a tile, pick a tile you don't use out of your tileset - say tile 15 - and place it where you want your new tiles, then find the number (0F in this case) and replace that with whatever else.
 
Sep 27, 2019 at 7:21 PM
Senior Member
Modding Community Discord Moderator
CSE Discord Moderator
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jan 14, 2014
Location: Antarctica (The Penguins say Hi)
Posts: 122
Age: 19
#8
...do we even have any proper tools to do so?
I added support for this in CMPGenerator, but it really isn't the most friendly editor to use for large map edits.
On a related note, CS doesn't clear the map (as in tiles) buffer when loading a new map either, so if you resize the map using OOB tsc, you can load in tile data from the previous map. It's way harder to use that than it is to use OOB tileset data though.
 
Sep 28, 2019 at 11:49 AM
Perfectionist
CS Beta Content Discord Admin
CSE Discord Moderator
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1590
Age: 119
#9
It's way harder to use that than it is to use OOB tileset data though.
And the unique use-cases for this are... questionable.
 
Top