dwrandomizer icon indicating copy to clipboard operation
dwrandomizer copied to clipboard

Work on Fairy Flute song randomization

Open juef17 opened this issue 1 year ago • 1 comments

This pull requests adds the possibility to randomize the Fairy Flute song that is played when using the flute in a battle or on the overworld. The new song is chosen at random from 67 possible songs (including the original). Since their lengths are variable, the mt randomization is used and the randomization is done prior to the checksum calculation, so that the song is tied to the seed number, not to give an advantage in a race situation. I have created two new files for this because while the songs do not require many bytes to be modified, I feel it would clutter dwr.c too much.

I did set the randomization to always be on because I don't feel comfortable adjusting the flags code without further input. Also, apologies if this is not a proper way to code or submit things here: I am only an amateur programmer and this is the first actual pull request I've ever done anywhere.

Also of note: the original code for the flute song speedup with the speed hacks flag manually changed the bytes in the flute song. Since it seemed unpractical to me to have to do this manually with every new flute song, I replaced the change with a call to a new function which sort of parses the flute song data and sets all note and rest lengths to the minimum. One fun thing about this is that it would be a trivial change to make said lengths a bit longer, or the song tempo slower, so that the songs are still much faster but actually recognizable.

Finally, I did this because I saw this as a feature request in the DWR Discord server. AsmadiGames had already done 3 songs a couple of years ago but did not move further as he felt a lack of interest for the feature. A quick poll in Discord showed only positive reactions to this, with a few concerns about the flute lengths. The songs added in this PR are all between 2.4 and 8.2 seconds long, averaging about 5 seconds, and the original song is about 5 seconds long. All songs have an audio preview and IPS patch in the #community-contributions channel on Discord (Flute Toots thread).

[Edit] Flag is implemented in this web app: here.

juef17 avatar Nov 07 '23 21:11 juef17

Apparently I can't rename a branch and keep associated pull requests alive. My bad!

juef17 avatar Jan 01 '24 20:01 juef17