Best Practices/Tips/Tricks for Naming Conventions & Organizing Variables, Switches, Database, Maps, Events, etc. Please Share!

Hello, everyone. I posted here because I didn’t think this was necessarily Maker specific and I couldn’t find a consolidated resource covering this topic. I have seen bits and pieces here and there, but nothing that really brings it all together.

I am hoping folks will be willing to share their extensive knowledge and experience with RPG Maker and/or programming in general to help new people, like myself, to get off on the right track, establish good habits and practices early on, and potentially avoid problems due to their lack of knowledge or experience.

I will start the list with things that I have pieced together from many, many tutorials, forum posts, old related posts on many other sites, etc. Since I don’t have a programming background and I am still very new, I wouldn’t know if all of these things are actually true or not.

A recent thread about using spaces in your Project name got me to really start pondering this. So here goes, in no particular order, and I hope that people will confirm or refute these and add to them for the collective benefit.

All of these are prefaced with I have heard so please don’t read these like I am saying these are, in fact, Best Practices. Also, if you can confirm that these are, it might be helpful if you could take the time to give a very brief explanation why.

- Don’t use spaces in your Project Name or in the names of your Variables or Switches AND capitalize the first letter of each word to make it easier to read. VARIABLE EXAMPLE: ReidThiefSkill SWITCH EXAMPLE: ItIsNight

- Name everything so it makes sense when you look at it quickly, but keep the names short enough so you can see them in the various windows.

- Always name your Events, Common Events, Variables, Switches, etc. instead of leaving them as numbers, for ease of reference.

- Try to organize your Database, Variables, Switches, etc. with groupings of similar things. If you just start making Variables or Switches at 001 as you need them, when you get 500+ Variables or Switches, it is going to be very hard to keep track and avoid duplication.

- Put lots of comments in your Events so they make more sense when you go back later and have to work on them.

I know I have heard more, but I can’t remember them now…thus my desire to start this thread.

These aren’t necessarily things you would know when you first start and I know I have ignored every single one of these at some point.

Please share your thoughts on naming conventions; ways to keep your database, Variables, Switches, Common Events, Maps, etc. better organized in a big project; ways to organize your assets; and anything else really that might benefit folks with less experience.

I would love to hear about and benefit from your collective wisdom.

And if I am smart enough, I am happy to try to edit this list with your responses to benefit folks who find this topic.

Thanks!
- Don’t use spaces in your Project Name or in the names of your Variables or Switches AND capitalize the first letter of each word to make it easier to read. VARIABLE EXAMPLE: ReidThiefSkill SWITCH EXAMPLE: ItIsNight
This has nothing to do with variables or switches. You can use whatever spaces and characters internally that you want.

HTML naming conventions should be adhered to for your files in your project. That includes the filepath to the game itself and all the assets in the folders inside it. That means no spaces, but also no special characters.

For the least chance of compatibility issues, stick to alphanumeric characters. The only other characters you should use are $ and ! when directed to by RPG Maker for special naming conventions.

It's also important to note when creating assets that on some operating systems the file extension is case sensitive. So don't allow your image editor, for example, to export as something.PNG, change it to .png.

As far as the capitalization...camel case is one naming method, but some people prefer to use dashes or underscores to separate words. I wouldn't put that in the same category as something that can actively break your project. And, as mentioned, you can freely use spaces for your variables etc.

- Always name your Events, Common Events, Variables, Switches, etc. instead of leaving them as numbers, for ease of reference.
I'm not sure I'd include events in this "always" advice. I would never bother going through even one map and changing the name of every torch or doorway for the zero more times I'd ever edit that event. I can see it's a freaking door 😛

I personally only bother with this when the events are NPCs that I will need to reference from move routes. Then it's much easier to say "move Captain Gobstopper" than it is to remember "move event 5".

Please share your thoughts on naming conventions; ways to keep your database, Variables, Switches, Common Events, Maps, etc. better organized in a big project; ways to organize your assets; and anything else really that might benefit folks with less experience.
The only other thing I'd add off the top of my head: all of the database tabs list IDs with leading zeros (e.g. 001-999). However, any time you use an ID, it should never include those. So if you're entering the ID for something into a plugin parameter or referencing it in a notetag, it's 23, not 023.

Using leading zeros will cause JavaScript to treat it as an octal value which will usually break what you wanted to happen.
@ATT_Turan Thanks for your points! This is exactly why I wanted to start this thread.

I could have sworn that I watched a tutorial early on that recommended not using spaces in Variables and Switches. But I didn’t understand why and I could be remembering wrong.

Thanks again for your clarifications and additions!
Something else to add - it's a helpful practice to choose a specific place in all of your maps (for me, upper-left corner) where you put all events that are autorun/parallel/controlling cutscenes.

Basically, if it doesn't need to be on a specific tile for interaction purposes, put it in a consistent place so you always know where to look.
It's also important to note when creating assets that on some operating systems the file extension is case sensitive. So don't allow your image editor, for example, to export as something.PNG, change it to .png.

As far as the capitalization...camel case is one naming method, but some people prefer to use dashes or underscores to separate words. I wouldn't put that in the same category as something that can actively break your project. And, as mentioned, you can freely use spaces for your variables etc.
Well, that's not fully accurate, for you can have file extensions in upper and lowercase and it won't matter at all while opening them. This is the exactly case in Linux distributions. Most of the time, or even always, it looks for some internal header or some mime type specification to deduct what kind of file it actually is. It's better not to change the extensions to wrong types if talking about documents, presentations, etc. Images tend to be a limited exception there.

The reason people like ATT_Turan won't use unusual symbols is that they get converted to weird URL characters like %20 and the like. So following that piece of advice is helpful indeed.

Concerning the events in autorun, that might highly depend on your map layout. Just make sure they end up in a lake or river or some other unreachable place.

About plugins I might say that you gotta be careful. Don't add too many plugins at the same time. Test very few of them thoroughly before including more. Later on it will become a helluva experience to get to the root cause of your issues because you've incorporated too many of them with lots of overwritten or aliased functions, etc.

Read their instructions carefully. Reread them as many times as deemed necessary. Ask whenever you get confused with what the help section of the plugin says and what you can see on screen. Always provide as much information or screenshots as needed. It's already hard to guess how you configured an event, so it'd be even harder to figure out what you changed in your game project and its plugins without taking a look at the screenshot of a visual glitch or error message or the list plugins you've incorporated into your project so far.
Along with organizing stuff in databases I usually separate categories like =-= Weapons =-=
=-= Swords =-=, * Atlas *, whatever.

So weapon database entries 1 is =-= Swords =-= and written in the notetag is anything special that I might forget or delete later, also is a base template for any swords I wanna make. So I'd like to write stuff like "Multiplier for smithery is x1.3 then x1.5." "Base damage is always 5 less then spears" "10% hit rate unless large sword then 0" etc etc.

Also yes using "Comments" for events help alot so you can explain what the hell it is that you just made that you'll 100% forget in like 2 weeks.

Edit: Example of a WIP I got going on, cause most states are named the same for... reasons. This helps alot. Also in the notetag of all those different states it tells me what it is cause, you know... same name.
Well, that's not fully accurate, for you can have file extensions in upper and lowercase and it won't matter at all while opening them.
I'm sorry, but that's not correct. It is system-dependent - you can search and find a number of support threads in here where people's projects were not working properly because they had a file named .PNG but their game was looking for .png.

Image editors may not care about it (again, depending on system), but your project can.

The reason people like ATT_Turan won't use unusual symbols is that they get converted to weird URL characters like %20 and the like.
No, "people like me" don't use them because it can break projects. Again, it is pretty trivial for you to do a search and find many support threads where people's projects (either on their own system or during distribution) produced file loading errors because there were spaces or other special characters in the names.

This is not some aesthetic preference I have, it is a well-documented cause of crashes.

Concerning the events in autorun, that might highly depend on your map layout. Just make sure they end up in a lake or river or some other unreachable place.
That doesn't really matter if it has priority below character. But sure, don't plop stuff someplace where you'd want another event to go.

Don't add too many plugins at the same time...Read their instructions carefully.
Very true.
I wanted to contribute some points to this topic, but honestly a lot of the good points have already been made. Maybe I'll swing back by if I have any juicy stuff to include. That said, I'm glad this topic has been brought up so I can rant about this:

My #1 biggest complaint with RPG Maker is the lack of project organization. You can try your best to foresee the future and set aside a block of variables (variables 1 - 20 will be for Dungeon A!) but you're just making educated guesses. You know what would help this a lot? Allowing people to drag and drop the variables around in the UI for organizational purposes.
You know what else would help? If you're like me and want to block out a region for specific variables, you assign a useless variable with a title "-----DUNGEON A-----" so it's easy to locate that block. Rather than this jank, hacky way of "making a folder" it would be great if we just had folders. On that note, having tons and tons of variables/switches/database objects that are currently going unreferenced at the time, having collapsible folders would help hide away unused things to make navigating this stuff quickly.
Collapsing portions of an event would help too, when some events can become monumental in length with commands, being able to collapse portions to quickly scroll through the command would really help speed up productivity. (Also the ability to open more than 1 event window at a time to easily allow comparing event commands and/or copying data between events.)
Similarly on project organization, as ATT mentioned, naming every event actually winds up being a bad idea. If you want to quickly find an event you want to control or edit it's easier to give it a big bold name so that it stands out obviously amongst the other "001, 002, 003, etc". It would be great if you could filter search by typing, or even moving named events near the top of the list.

It's this poor organization that often leads to loss of motivation or finding weird jank solutions to problems to avoid adding more litter to my project because the more variable litter, switch litter, database litter, or event command litter that exists, the amount of time I spend scrolling and searching begins to increase exponentially. So rather than increase my wasted time by adding litter, I look for weird hacky solutions to prevent litter creation.



Anyways, rant over, glad I finally was able to get that off my chest. Thanks for coming out to my TED talk.
I wanted to contribute some points to this topic, but honestly a lot of the good points have already been made. Maybe I'll swing back by if I have any juicy stuff to include. That said, I'm glad this topic has been brought up so I can rant about this:

My #1 biggest complaint with RPG Maker is the lack of project organization. You can try your best to foresee the future and set aside a block of variables (variables 1 - 20 will be for Dungeon A!) but you're just making educated guesses. You know what would help this a lot? Allowing people to drag and drop the variables around in the UI for organizational purposes.
You know what else would help? If you're like me and want to block out a region for specific variables, you assign a useless variable with a title "-----DUNGEON A-----" so it's easy to locate that block. Rather than this jank, hacky way of "making a folder" it would be great if we just had folders. On that note, having tons and tons of variables/switches/database objects that are currently going unreferenced at the time, having collapsible folders would help hide away unused things to make navigating this stuff quickly.
Collapsing portions of an event would help too, when some events can become monumental in length with commands, being able to collapse portions to quickly scroll through the command would really help speed up productivity. (Also the ability to open more than 1 event window at a time to easily allow comparing event commands and/or copying data between events.)
Here, here. Though the latest MZ updates allow you to collapse choice and if statements, which is an awesome add btw, (a ctrl-f find function WITHIN an event would help too!), everything else here really would help a ton. There's no real reason why you can't do a sort in the editor that I can think of, but it's index order or get out. You can't even sort armors by type (Oh, want to find all the ACCESSORIES? Ha, good luck). I do the fake variable and database sorting method, too, but inevitably I get more entries than I accounted for.

But for a tip for how things are add text to notetags in the database so you can look them up with ctrl-f.
Here, here. Though the latest MZ updates allow you to collapse choice and if statements, which is an awesome add btw, (a ctrl-f find function WITHIN an event would help too!), everything else here really would help a ton. There's no real reason why you can't do a sort in the editor that I can think of, but it's index order or get out. You can't even sort armors by type (Oh, want to find all the ACCESSORIES? Ha, good luck). I do the fake variable and database sorting method, too, but inevitably I get more entries than I accounted for.

But for a tip for how things are add text to notetags in the database so you can look them up with ctrl-f.
To be fair, I think the point is it shouldn't have taken this long to get a QOL improvement like that.

As a person that has all the RPG Makers (except MZ), here are some tips, especially for people who don't want to upgrade from MV to MZ.

1. Name your switches/variables to their specific use or name them after their location like "Gasto's first appearance" or "Angel Intro", etc.

2. Keep a list elsewhere like a notepad, whether it be on PC or real life, of all the switches and variables and explicitly put down their purpose. This is what I do, but I put it in the script editor and just comment the list out (so I don't get any errors).

3. IF your maps are large, then naming stuff can be important, though like others have said, you most likely don't need to name a regular door unless you have reason to. Example is if you have the event's name pop-up in game; in that case, you'd want to name and not be "Event57."

4. When it comes to armors, items, weapons, etc, I find it best to list them alphabetical order elsewhere followed by their ID in the database so if Weapon 3 is named "Blade of Death" then I would list "3: Blade of Death" and just make sure all the weapons are in alphabetical order.

That's about all the tips I got. I'm doing it for my current project, and it's been going extremely well especially since I'm also using custom Global Variable/Switches where having a list of them somewhere I feel is almost a neccessity.
You know what else would help? If you're like me and want to block out a region for specific variables, you assign a useless variable with a title "-----DUNGEON A-----" so it's easy to locate that block. Rather than this jank, hacky way of "making a folder" it would be great if we just had folders. On that note, having tons and tons of variables/switches/database objects that are currently going unreferenced at the time, having collapsible folders would help hide away unused things to make navigating this stuff quickly.

This is what I started doing after a while and it genuinely made navigating switch/variable selections at least twenty times less obtuse since grouping things together via "variable folders" helped me keep in mind what was where.

I'd much rather have actual switch/variable-holding folders, but VX Ace was also made for Windows XP so I'm permanently stuck in the stone age.

@ZombieKidzRule My method of keeping track of things is the following. I assign symbols to everything that the player isn't meant to see the name of, such as events, animation names, switches, variables and so on.

A few examples from me -

Battle Animations:
△ - Used for cutscene animations
☐ - Used for actual battle animations

(It's set up like this since battle animations tend to be bigger + some animations are cutscene only)

NPCs:
♡ - Denotes a stand in for the player
♪ - Music controlling event
♢ - Other type of parallel processing event or navigation buttons
△ - Cutscene event
X - Denotes an enemy NPC
Ω - Denotes a rare enemy

Crucially, I don't assign the symbols to actual filenames (unless they're $ and ! for images) or even game folders since I've seen firsthand how that can break games..

It helps me recognize which is which from a glance, without having to look at the actual event code or parse through a sea of words that my eyes eventually glaze over.

When it DOES come to images, SFX and music, I do it like this:

  • [First 3 initials of game]_[type of character]for images
    • EX. TDH_Villains_Jasper
    • or GBH_Heroes_Gabriel, like that.
  • [Name of effects pack]_SFX_[name of file]for sound effects - I often home-cook my sound effects, but I also use store-bought SFX or just random ones I find across the internet.
    • EX. SH_SFX_Weakhit for something I made myself
    • or MD_SFX_Tool_Hammer_1 for a sound effect I bought from the modern day pack on Steam

Original thread: https://forums.rpgmakerweb.com/threads/best-practices-tips-tricks-for-naming-conventions-organizing-variables-switches-database-maps-events-etc-please-share.153965/