What to avoid when naming files in RPG MV

Hi.
As displayed on my username, I'm a noob who just started learning. Forgive me if this is a basic question, but what keyboard character should I avoid when naming files in RPG MV folders? I heard that several habits like using space might crash the game for the players. Is that correct? That being said, from the following formats, which one is okay and not okay in renaming my files?
1)my cherry blossom 1
2)my_cherry_blossom_1
3)my-cherry-blossom-1
4)my.cherry.blosssom.1
5)mycherryblossom1

Is it okay to use space, underscore, or dash? Which one is a no no?
Thank you in advance.
Dashes and underscores are fine. Spaces are not recommended.
Dashes and underscores are fine. Spaces are not recommended.
I see. How about numbers?
Numbers are fine. Do not use dots though, as they are used to separate file names from file endings.
Thank you very much. I'm glad that dashes and underscores are fine. Because if they weren't, I would have to rename them one by one from start with the hundred lines of script I made. You saved me time 😂
basically the naming problems come from the fact that RMMV and RMMZ produce HTML5-based games, and all browsers have problems with symbols that are breaking the so-called networking rules.

spaces are only one of the forbidden letters, but the list of what is allowed and what not is difficults, especially since most operating systems created overrides to allow the use of those symbols.

However there is one trick to check this. Make a picture (jpg or so) with the critical filename, and then open that picturefile with a browser.
Then check the adress line. all symbols that are replaced with a %nn number code (like spaces are replaced by %20) are forbidden symbols.


In addition to that, ! and $ might cause problems - not because they are forbidden, but because they trigger functions within the engine. You can see that in the sprite list where some filenames begin with either or both.
Waw, I must try that out. I thank you very very much, Mr.
It is not the browsers themselves who have a problem with those characters, but those characters change. Each file name gets their own URL when uploaded. And since spaces have a different meaning in URL, they are replaced with something like %20.

The same goes for characters like &, + and others. Those characters have meaning in URL.

So when "Actor 1" gets changed to "Actor%201", then your game can find the assets anymore, since it is looking for the old name.

So what @Andar says is effectively right, but the reason behind it, is the URLs. This is important to know, so you'll understand why spaces and periods and such are not okay for HTML games.

That all aside... if you make games only for windows (no browser, no android, no apple) then spaces should be fine. But it is best to avoid them anyway. Saves you lots of trouble if you decide to go to other platforms after all.
Thank you for the information. I consider them very valuable.
After scanning my files, I realized that many of my sprite and tile files are named with space... Now I'm left depressed because I have to rename them all one by one and relocate them in every programming I did. That being said, I do have another question.
Question:
1)
All my files are safe without space, except for my sprites. As you can see, my "modern people 1-4" file are the examples. Should I change these too? because it might take a huge relocating activity in order to make it right again. LOL
Screenshot_125.png

2) There's something I noticed, [Tileset B and C] are both using space. Despite them written like that by default, should I change them too?
Screenshot_126.png
As a developer, while it's true that most characters should be fine for filenames, it's still best to limit yourself to the latin alphabet (the 26 letters from a to z and their capitalized variants A to Z), numbers, hyphens (-) and underscores (_).

Spaces in particular can lead to weird bugs, even in Windows.

For example, if you ever need to work with command line arguments (cmd.exe or PowerShell), then spaces are used as separators. If a filename has whitespaces, then it must be wrapped in quote marks like this: "file name".

I once wrote an app that you could drag and drop files on. Depending on whether the file had spaces or not, I received filenames in both formats filename and "file name", and since I was prepending a path to those names, I sometimes ended up with path/"file name", which is invalid. So I changed my code to adapt to it, resulting in "path/file name", which is valid, but didn't work for filename. At the end of the day, my code ended up being significantly more complex than it should've been.

To avoid having to deal with such problems, the best practice is to simply avoid using potentially "difficult" characters in the first place. While you can't force users to not use those characters, you can at least avoid naming your own files that way.

2) There's something I noticed, [Tileset B and C] are both using space. Despite them written like that by default, should I change them too?
View attachment 240687

You can't change them, and you don't need to worry about them. [Tileset X] is not a file name. It's just how RPG Maker displays those names in the editor.

When you look at the database, you'll realize that each tileset is made up of multiple tileset files. For example, Dungeon_A1.png and Inside_B.png can together form a single tileset where [Tileset B] refers to Inside_B.png

Also, the name Inside_B.png is only an indication that it was intended to be used for [Tileset B], but there's nothing stopping you from defining it as [Tileset C], if you want.
Thank you very much. Now that I've learned my lesson, I'll fix them and remember to always limit myself to those characters only. Such a vivid explanation you have given. (btw, hyphens and dashes are the same, right?)

I appreciate the help, everyone. I'm now glad that, at least, I know why my game have random bugs sometimes for some players!
Please have an amazing Sunday! 😤
1.) Are you making your game just for windows? If so, then there is no need to worry about the space. Just make sure you rename the assets before you start a new project. And yes, this counts for ALL assets, so also the sprites you mention.

2.) Don't worry about "[TileSet B]" and C, D, E. They are not actual filenames. Tileset B can be "Outside.png" or "Windows.png". Depending on what the file is called that you have selected.
The space in there is not going to be a problem. And you wouldn't be able to change this anyway. 😛



Edit: I see that Nolonar said that spaces are a problem even in windows, and even though this is true, this is NOT the case for RPG maker games.

Yes, it would be best to take the spaces out, but no it wouldn't be a problem if you don't for a windows RPG maker project. So if you should change it all, kind of depends on how much work it is.

Renaming assets means you have to edit EACH event that calls upon those assets. If you have 2000 events all using 1 and the same sprite, then all those events have to be edited if you rename that 1 single sprite. It might just not be worth the trouble.

Another thing to keep in mind: If you want to rename for HTML games, then first make sure your game is suitable for HTML games. The bigger your game is, the less likely it runs smoothly or at all in a browser. Many platforms for browser games also have a 500 or 1000 piece file limit. Or a 500Mb or 1Gb size limit.

So if you have plenty to rename, then chances are there that your game is not even suitable for browsergames anyway.
1) All my files are safe without space, except for my sprites. As you can see, my "modern people 1-4" file are the examples. Should I change these too? because it might take a huge relocating activity in order to make it right again. LOL
It's always better if you do change them. Even if you don't experience bugs yourself, other players might.
If you need to update your database due to having already used those sprites, you could use a text editor with regex (I'd use Notepad++) on the .json files located in /data/ to make changing them much faster. Of course, back up your files before doing so in case of accidents/mistakes.
(btw, hyphens and dashes are the same, right?)

In this context, yes. Technically, though, a hyphen is a type of dash, but a dash is not a hyphen:

They're not the same length, and serve a different purpose in literature. But as far as I know, keyboards don't have a dash key, only a hyphen key. So you don't have to worry about accidentally using a dash in a filename when you intended to use a hyphen instead.
1.) Are you making your game just for windows? If so, then there is no need to worry about the space. Just make sure you rename the assets before you start a new project. And yes, this counts for ALL assets, so also the sprites you mention.

2.) Don't worry about "[TileSet B]" and C, D, E. They are not actual filenames. Tileset B can be "Outside.png" or "Windows.png". Depending on what the file is called that you have selected.
The space in there is not going to be a problem. And you wouldn't be able to change this anyway. 😛



Edit: I see that Nolonar said that spaces are a problem even in windows, and even though this is true, this is NOT the case for RPG maker games.

Yes, it would be best to take the spaces out, but no it wouldn't be a problem if you don't for a windows RPG maker project. So if you should change it all, kind of depends on how much work it is.

Renaming assets means you have to edit EACH event that calls upon those assets. If you have 2000 events all using 1 and the same sprite, then all those events have to be edited if you rename that 1 single sprite. It might just not be worth the trouble.

Another thing to keep in mind: If you want to rename for HTML games, then first make sure your game is suitable for HTML games. The bigger your game is, the less likely it runs smoothly or at all in a browser. Many platforms for browser games also have a 500 or 1000 piece file limit. Or a 500Mb or 1Gb size limit.

So if you have plenty to rename, then chances are there that your game is not even suitable for browsergames anyway.
1) Due to my basic knowledge in programming, I'm currently only deploying it to windows. But when the game is finished in the next 3 years, I will likely deploy it to others.
2) Ah, thank you. lol
Response to your edit:
I see. My game is still at its early production (though it already has many events that call the spaced file names). This concludes that I must relocate everything one by one before it's too late. I'm lucky that I realize this now, so I thank you.
It's always better if you do change them. Even if you don't experience bugs yourself, other players might.
If you need to update your database due to having already used those sprites, you could use a text editor with regex (I'd use Notepad++) on the .json files located in /data/ to make changing them much faster. Of course, back up your files before doing so in case of accidents/mistakes.
The regex appears very tempting. But due to my lack of experience in those areas, I'll just have to do it manually as I am a skirmish person when entering new fields. But I'll keep in mind about what you said as a preventive reference in the future.
In this context, yes. Technically, though, a hyphen is a type of dash, but a dash is not a hyphen:

They're not the same length, and serve a different purpose in literature. But as far as I know, keyboards don't have a dash key, only a hyphen key. So you don't have to worry about accidentally using a dash in a filename when you intended to use a hyphen instead.
Finally now I know the difference thanks to you. Super cool.
The regex appears very tempting. But due to my lack of experience in those areas, I'll just have to do it manually as I am a skirmish person when entering new fields.
You wouldn't need to use regular expressions for this. Notepad++ has a Find and Replace that you can use on multiple files at once. Takes, like, 15 seconds 😉

The thing to be cautious of is that someone else's system could have some setting that makes it more finicky. Even if you think "as a general rule, in Windows spaces and capitalization doesn't matter," it's much better to take a bit of effort and be safe by conforming to all possible rules.

That way you don't have to worry about releasing a game and all these people with niche situations become the vocal minority saying your game doesn't work.

Original thread: https://forums.rpgmakerweb.com/threads/what-to-avoid-when-naming-files-in-rpg-mv.151370/