![]() |
Radom Battle and Boss Themes - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Hacks, Resources and Tutorials (https://www.ff6hacking.com/forums/forum-1.html) +--- Forum: Jidoor Auction House (https://www.ff6hacking.com/forums/forum-4.html) +---- Forum: Patches, Bugfixes, Tweaks (https://www.ff6hacking.com/forums/forum-15.html) +---- Thread: Radom Battle and Boss Themes (/thread-3168.html) |
Radom Battle and Boss Themes - madsiur - 03-08-2016 author: madsiur version: 1.1 released on: 2016/04/28 Apply to a FF3us 1.0 ROM Download Files randomsongsC2.asm: For implementation in bank $C2 randomsongsEE.asm: For implementation in bank $EE or any other bank Apply with xkas 0.06 Command example: xkas randomsongsEE.asm romname.smc Description Randomize the battle theme and default boss song. By default the max number of song for the battle theme is 8 and 4 for the boss theme. By default, battleTable and bossTable have their entries nullified with only the default song as entry. Replace the !noSong in a table to add a song choice. You can also reduce or expand the tables. If your table has 50% or more of null values (!nosong) it is more efficient to reduce it in half (e.g. remove 4 lines for a 8 song table) than nullifying most of the entries. You'll also need to change the !numSongBattle and/or !numSongBoss value(s). What the code does is if he picks a null value it will choose a new random number and repick from the table. If tables are modified properly, the repick probability will always be less than 50%, e.g. 44% maximum for a 16 songs table. The probability of a total of 3 picks before getting a song is 19% maximum and for 4 picks or more is 8,5%. So basically there can be relooping and cycles wasted but I don't consider it significant taking in account it was the easiest solution code-wise. To recap, if you want 12 possible songs for the battle theme, add 8 lines to the table and nullifie 4 entries (!noSong). Then you need to change the !numSongBattle variable to $0F. Extra notes: This is a hack that uses the default RNG table at $C0FD00,X, meaning for now it is a much random as the default RNG system can be. Also, having table that are 2^X entries is not the optimal system since cycles are wasted for repicking in case of null entries. I'm opened to suggestion to improve both aspect, especially having as an example a table of 10 entries for 10 songs, not a table of 16 entries with 6 null values in it. Assembly file: Code: hirom ; Don't change this. RE: Radom battle and boss themes - Gi Nattak - 03-08-2016 Nice! A feature from your hack released far before the actual hack! Definitely a good patch to have access to, as a fan of many battle musics. Kind of you to share. ![]() RE: Radom battle and boss themes - Lockirby2 - 03-08-2016 I like this as a patch idea. RE: Radom battle and boss themes - madsiur - 03-08-2016 (03-08-2016, 06:32 PM)Gi Nattak Wrote: Nice! A feature from your hack released far before the actual hack! (03-08-2016, 10:40 PM)Lockirby2 Wrote: I like this as a patch idea. Thanks you both. I also had a revelation like Moses before my nap, I was thinking of also releasing the 4 drops per monster feature that was planned for FF6: Enhanced. Since there is 384 * 4 drops to edit, it would require to code a small utility rather than a .asm file but I got the base code for that. You could also assign % for each type of drop, from 25% to all to 70%, 20%, 8% and 2% as an example for the most common to rarest type. It's not that much work in fact and not a project that would be on several weeks so I'm definitely considering it. ![]() Edit: With the random patch, I also though that as an example if you want 5 songs, you can create a 16 songs table with 3 entries per song and leave one as !noSong. This is more efficient than a table of 8 with 3 null entries. You could also do a table of 128 songs with 127 identical song ID and 1 entry with a special song, kinda of a special battle song with 0.8% chance of occurrence. This is an extreme example but with a little bit more asm work, you could give a special item or even select from another table an item to give at end of combat. |