YesNoOk
avatar

How does MUGEN locate files defined in the .def files? (Read 2019 times)

Started by bitcraft, December 08, 2016, 05:35:01 pm
Share this topic:
How does MUGEN locate files defined in the .def files?
#1  December 08, 2016, 05:35:01 pm
  • avatar
    • USA
    • leif.theden@gmail.com
I'm going through a bunch of characters and stages and weeding out broken ones.  One way that I've been doing it is with a script that reads the def files and verifies that they actually exist on the disk.  However, I've found that there are a few ways that it searches, and I'm wondering if anyone can help provide some insight and rules how MUGEN will search for them.

For example, it seems most files, like CMD, AIR, SFF, etc can be found the following ways:
  • Relative the the character folder
  • Relative to the parent character, if a DEF is in a folder inside a character folder
  • In data, sound, or stages

Also, I'm wondering if it will just search for a file in all the folders?  Some characters for example will use "kfm.cmd".  That means MUGEN needs to search all the characters to find kfm.cmd, because it is not in the character folder, or is not in somewhere obvious.

So, does MUGEN just look in all the folders for some files?  What if there are multiple ones, like common1.cns?

Thanks everyone for your insight!
Re: How does MUGEN locate files defined in the .def files?
#2  December 08, 2016, 09:03:58 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
The character's .def file specifies the location of all those other files.  The paths are all relative to the location of the .def file.  A character can have seemingly any number of .cns files referenced in their .def.  All their states can be condensed to just one .cns file, but the states are usually split up for better organization / code management.

Mugen has common1.cns in the Data folder.  Those states are applied to all characters in the MUGEN installation, unless the characters have an alternate "common states" referenced in their .def file.


I may be slightly wrong about any of the above, but I'm 99% sure that's how everything works.

Re: How does MUGEN locate files defined in the .def files?
#3  December 08, 2016, 11:35:58 pm
  • avatar
    • USA
    • leif.theden@gmail.com
The character's .def file specifies the location of all those other files.  The paths are all relative to the location of the .def file.

I'm not sure about this.  I mean, it is true, but I think there is more to it.  For instance, here's a character I found that does this called "god" by "Smoke":


-- chars/god/
   |   god.def
   |
   | -- names/
       |     dues.def
       |     duex.def
       |     god.def


There are others that do this.  If they were relative to the .def ('duex.def'), then the def files would fail to load, unless they are relative to the parent (/chars/god/) IDK, am I suppose to not use the .def files in the "names" folder?  Does the author expect you to manually swap the .def files around?
Re: How does MUGEN locate files defined in the .def files?
#4  December 08, 2016, 11:59:27 pm
  • *****
  • Shame on you!
    • USA
More than likely the author expects you to list those def files in the Select.def. Otherwise that character wont be usable.
Use VSelect to quickly view what characters wont load in your mugen. If the characters are completely broken VSelect might not load.
You can also use Fighter Factory 3 to see if the character works pretty easy.
vVv Gouken718 vVv
Re: How does MUGEN locate files defined in the .def files?
#5  December 09, 2016, 12:07:12 am
  • avatar
    • USA
    • leif.theden@gmail.com
Ok,, so you think that the author would want you to list each def?  ....so mugen must search each "parent" folder for the correct cns, act, air, sff, etc  (because the "child" defs in a folder do not specify where to find the files).

To clarify, I want to expose all the ways that mugen finds files, so that I can emulate that behavior in code.  To give you some sense of scale, I have 37gb of mugen data that I am using scripts to check.  As is, I can comb through a few 1000 in a couple seconds, but I don't know if it is 100% correct without much manual testing with making select defs, etc.
Re: How does MUGEN locate files defined in the .def files?
#6  December 09, 2016, 12:22:44 am
  • *****
  • Shame on you!
    • USA
Some Devs will release 1 character that will work for winmugen, or 1.0, or 1.1, depending on which DEF is in the select.def. You ALWAYS have to have it in the character's root folder. So this author probably wanted you to replace god.def with duex.def to change the name. And left a copy of god.def in /names/ in case you deleted the original.

It's like Altoid said, it only looks in the character's folders. And only if they're listed in the def. Mugen doesn't scan every directory and tries to part things together. Its either there, or broken.

You MAY find a character that uses data/ as a location, but I wouldn't bet on it. Only the common.cns is ever used.
vVv Gouken718 vVv
Re: How does MUGEN locate files defined in the .def files?
#7  December 09, 2016, 12:28:19 am
  • avatar
    • USA
    • leif.theden@gmail.com
Thanks for your insight, Odb718.  I'll update my tools to just check the "root folder" and not worry about the folders in them.  I have noticed that mugen will search data/ sounds/ and stages/...  I'll keep those checks as well.