#Picking a good name
1 messages · Page 1 of 1 (latest)
Alright
I want to minimize a user's setup when he tries to use the gamemode for himself, so nothing extreme like manually setting a pretty map name or stuff like that
There are, I think, 3 broad categories that a given map can fall into:
- Known prefix
- Unknown prefix
- Unknown format
ttt_ is a known prefix
33m2_ is an unknown prefix
c_23_central_night is an unknown format
If I were doing this myself, I would create a map of common known prefixes and set up logic to nicely handle those
Then, if a map doesn't have a known prefix, check if there are only a few characters at the beginning of the name before the first _, and if there are only a few characters, assume that's a prefix and remove it
However, if a map name has a lot of _ or - or numbers/symbols in it, it's probably in an unknown format that you aren't going to be able to figure out a nice, clean format for by guessing programmatically
In that last case, I would just leave the map name as-is under the assumption that anything you do to try to "Fix" it is going to instead make it harder to read