Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 05:38:30 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Naming Large Quantities of Assets/Files
Pages: [1]
Print
Author Topic: Naming Large Quantities of Assets/Files  (Read 1020 times)
Posho
Level 0
**



View Profile WWW
« on: May 17, 2015, 06:37:04 PM »

Quick question: If you had a program that reads assets/files which also increase quantity on a reasonably high frequency and all of them are located on the same directory/folder, which naming method would you choose for naming the files? Numbers or titles?

Example: c_12334.png or c_thisthingetc.png

Hopefully someone can help me out. Cheers!  Coffee
Logged

Developer & Cartoonist
[Twitter]
RandyGaul
Level 1
*

~~~


View Profile WWW
« Reply #1 on: May 17, 2015, 08:39:54 PM »

If an artist is dropping these files into a directory, and they need to be modified later, then definitely unique names.

If you're a programmer just placing all the assets into a single directory, then I'd just name them with numbers.

If both... You can probably have an "assets" folder where the artist organizes their art in whatever way you want. Then, as the programmer, you can write a program to traverse the "assets" folder (and it's sub-folders) and then do whatever you like from here. All the files can be loaded one by one, or if they really need to be collected into a single folder you can do so programatically, and even rename them with numbers (and even map old names to the new numbers somehow, if you so wish).
Logged
Posho
Level 0
**



View Profile WWW
« Reply #2 on: May 17, 2015, 08:57:47 PM »

If an artist is dropping these files into a directory, and they need to be modified later, then definitely unique names.

I actually ended up doing this, it's really more easy if I want to edit a file by looking it by filename instead of having to open the table to figure out what number the file was named after.

Thanks for the reply, in the end it all sums up to common sense.  Coffee
Logged

Developer & Cartoonist
[Twitter]
Christian Knudsen
Level 10
*****



View Profile WWW
« Reply #3 on: May 18, 2015, 05:24:07 AM »

I have 60000+ sprites for my game (each character is composed of about 20 sprites for each frame of animation), and the way I handle it is to have a unique name for each sprite, but then also have a small script that changes the names into numbers (basically a hash) based on the unique name. I then use the number/hash version when building sprite atlases and in code to fetch the sprites, since it's faster to look up a number than a string. So basically:

run1-1malehair-1 -> 101010102001

The first 1 indicates a male character, the second 1 that it's the run animation, then a third 1 to indicate that it's in direction 1 and then the fourth because it's frame 1. You then get a 2, because that's the number associated with hair sprites, and then a final 1, which indicates the type of hair sprite.
Logged

Laserbrain Studios
Currently working on Hidden Asset (TIGSource DevLog)
PrimeVest
Level 0
**



View Profile WWW
« Reply #4 on: May 19, 2015, 06:53:32 AM »

I like having all files in 1 map,
I usually name them like this:

texGrass1.png
texGrass2.png
texMetal1.png
texMetal2.png
texMetal3.png
fBullet1_Trajectory.frag
fBullet1_Muzzle.frag
fBullet1_Hit.frag
fExplosion1.frag
mPlane1.obj
mPlane2.obj
sBullet1.ini

ect
« Last Edit: May 19, 2015, 02:28:11 PM by PrimeVest » Logged

Sik
Level 10
*****


View Profile WWW
« Reply #5 on: May 19, 2015, 01:11:42 PM »

I give them proper names for the sake of sanity (leaving numbering for stuff like sequences in an animation, e.g. walk_1, walk_2, etc.), with some restrictions to make the life easier to whatever has to parse them. And yeah, if there are too many names I just calculate a checksum (as in just add all the bytes in the string) and store it for later so I can just skip strcmp when two checksums differ. This reduced loading times in Sol down to a fraction of a second.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic