Straight to song shortcut - No need for menus

What would you like to see added or fixed in FOF?
Forum rules
This topic is 18 years and 3 months old. Instead of replying, please begin a new topic, or search for another related topic that may be more suitable.
User avatar
W2k
Member
Posts: 13
Joined: February 22nd, 2007
Reputation: 0

Postby W2k » Wed Feb 28, 2007 3:32 pm

I would like to see an option added to go straight into a song by calling the FretsOnFire executable with a command line argument naming, for instance, the song folder.

For example, to run the tutorial I would write (from the FoF install dir):

FretsOnFire.exe /play "data\songs\tutorial"

Additional arguments could be added to select difficulty and to select lead/bass tracks. Without this info, the game would simply use the last played, as it usually does.

FretsOnFire.exe /play "data\songs\bangbang" /medium

(If for some reason the selected difficulty is not available for the chosen song it could just pick the nearest one, rounding up or down.)

Why do I want this? Because it would allow programming geeks like myself who don't care much for Python to write a "FoF launcher" that could do some cool stuff that FoF can't or won't do.

Also, this should be extremely simple to implement, as a mod or directly into the game.

Finally, if someone would explain to me how the high scores are encoded into the song.ini files, or point me at the right document, that would be cool.
Last edited by W2k on Wed Feb 28, 2007 3:35 pm, edited 1 time in total.
User avatar
omganinja
Member
Posts: 141
Joined: October 22nd, 2006
Reputation: 0

Postby omganinja » Wed Feb 28, 2007 4:17 pm

i think the high scores in the song.ini is encoded xml, but i could be wrong.
Last edited by omganinja on Wed Feb 28, 2007 4:17 pm, edited 1 time in total.
User avatar
W2k
Member
Posts: 13
Joined: February 22nd, 2007
Reputation: 0

Postby W2k » Wed Feb 28, 2007 4:43 pm

Well, the song.ini contains lines like:

scores = 63657265616c310a310a646963740a300a72300a

Which looks like hexadecimal code. If we convert it, we get:

c e r e a l 1
1
d i c t
0
r 0


For an empty high score. This is not XML. It looks rather like something apparently called Cerealizer. Could probably be reverse-engineered, but it would be much better if the FoF developers used an open format. :)
osrenan
Member
Posts: 162
Joined: January 12th, 2007
Location: Indaiatuba - SP - Brazil
Reputation: 1
Contact:

Postby osrenan » Wed Feb 28, 2007 5:05 pm

W2k wrote:Well, the song.ini contains lines like:

scores = 63657265616c310a310a646963740a300a72300a

Which looks like hexadecimal code. If we convert it, we get:

c e r e a l 1
1
d i c t
0
r 0


For an empty high score. This is not XML. It looks rather like something apparently called Cerealizer. Could probably be reverse-engineered, but it would be much better if the FoF developers used an open format. :)

wouldn't this afect the oficial score chart?
My Song Anti-Flag - The Press Corpse - NEW - a CD label for the mod users *cough pretty sweet i think cough*
User avatar
ThatJon
Member
Posts: 32
Joined: January 20th, 2007
Location: United Kingdom
Reputation: 0

Postby ThatJon » Wed Feb 28, 2007 5:07 pm

Looking at the source code, you can see the comment

Code: Select all

# Read highscores and verify their hashes.
# There ain't no security like security throught obscurity :)

The encoding code is

Code: Select all

def getObfuscatedScores(self):
 Ã‚    s = {}
 Ã‚    for difficulty in self.highScores.keys():
 Ã‚      s[difficulty.id] = [(score, stars, name, self.getScoreHash(difficulty, score, stars, name)) for score, stars, name in self.highScores[difficulty]]
 Ã‚    return binascii.hexlify(Cerealizer.dumps(s))


So basicly, it is a dictionary of scores, cerealized and then translated from ASCII into hex.

The scores are quite easy to read, but do include hash checks - this means it should be quite easy to reverse engineer the output, but a bit more difficult (without access to the source) to create a working scores line in the ini.

EDIT: Oh, and btw I think the idea of adding command line arguments is a good one that shouldn't be too difficult for someone who knows their way around the source to implement.
Last edited by ThatJon on Wed Feb 28, 2007 5:10 pm, edited 1 time in total.
Rogue_F
Member
Posts: 1504
Joined: November 2nd, 2006
Reputation: 1

Postby Rogue_F » Thu Mar 01, 2007 1:39 am

Command line starting has already been suggested and it's on my TODO list.

-Alex
User avatar
W2k
Member
Posts: 13
Joined: February 22nd, 2007
Reputation: 0

Postby W2k » Thu Mar 01, 2007 2:15 am

The scores are quite easy to read, but do include hash checks - this means it should be quite easy to reverse engineer the output, but a bit more difficult (without access to the source) to create a working scores line in the ini.

The application I was thinking about would be more like a high score logger, not editor. So I wouldn't need to break the hash.

Command line starting has already been suggested and it's on my TODO list.

You're awesome. Can I suggest that the game will also exit after the song has been played and the high score recorded? Otherwise, the user would be required to manually exit to use the "launcher" again. Obviously, there could be a command line switch to enable/disable this function.
Last edited by W2k on Thu Mar 01, 2007 2:16 am, edited 1 time in total.

Return to “Thoughts ?”

Who is online

Users browsing this forum: No registered users and 6 guests