
A naming convention is a set of rules for choosing the name to be used for the different assets and variables in your project. For example, our naming convention says that every sprite should start with “spr_” and all objects start with “obj_”. Let’s talk about why you should do something similar for your GameMaker project.
Why Do We Use Naming Conventions in GameMaker?
Using a naming convention for your assets and in GameMaker is important, especially as your projects get larger. It helps organization, keeps things consistent, and keeps your project feeling clean. Every asset name has intent when you stick with a naming convention.
Improved Organization
- Clarity and Structure: By default, GameMaker puts assets in alphabetical order into the Asset Browser. Following a prefix naming convention groups the same kinds of assets together so you’ll be able to find them easier.
- Scalability: Naming new assets is easy because there’s an existing standard of how it should be named without causing confusion.
Improved Readability
Good code isn’t just functional– it’s readable. When you follow naming conventions, your projects are clean and make sense.
- Clear Distinction: When you follow a naming convention, you can tell one asset apart from another. especially in code. If you have
spr_house
andobj_house
, it’s clear that one is a sprite and one is an object, though they both share the name “house”. In GameMaker, you won’t be allowed to have both a sprite and an object both named “house”.
Better Collaboration
- Consistency: Consistent naming conventions means everyone’s aligned. The style belongs to the project, not to the developer. Different parts of the game can be developed at the same time, but the naming convention keeps developers unified in practices.
- Easier Onboarding: Developers not as familiar with your project can easily tell assets apart in code by following your naming conventions. Assets are easy to find, and new variables are easy to name.
Naming Convention Examples
Here are some examples of the naming conventions that we personally use in GameMaker. You can use these if you’d like, or make up your own, but it’s important to be consistent!
Animation Curve
ac_animation_curve_name
Sprites
spr_sprite_name
Tile Sets
ts_tile_set_name
Timelines
tl_timeline_name
Sounds
snd_sound_name
Particle System
ps_particle_system_name
Paths
pth_path_name
Scripts
scr_script_name
Sequences
seq_sequence_name
Shaders
shd_shader_name
Fonts
fnt_font_name
Objects
obj_object_name
Variables, Arrays, Functions
variable_name
array_name
function_name
Local Variables
_local_variable_name
Macros
MACRONAME
Rooms
rm_room
Structs
Struct_Name
Wrap Up
Naming conventions aren’t just nice to have– they’re a must for keeping your project organized, efficient, and scalable. By using consistent naming for your assets and scripts, you’ll save time, reduce errors, and make your game development process more streamlined.
For more essential tips on game development, check out our other posts on best practices.