MMMMMMMagic update - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html) +--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html) +--- Thread: MMMMMMMagic update (/thread-3279.html) |
MMMMMMMagic update - B-Run - 06-30-2016 So, when I first joined the site... my first major patch was to make it so any character could use magic if you wanted them to. It was a little sloppy, only reused magic lists in a very specific character ID order, and would cost Gogo's cumulative magic setup... It's time to revisit this. There is a better way! I've got some ideas, but I'd like some feedback, or maybe a coder or two willing to help out with the patch. I will likely release 2 versions of the hack. Version A:
Version 2 is what I really want to talk about. This would be a relatively major overhaul of the way the game reads/writes magic... but its actually pretty simple. And it only costs the ability to learn magic via equipment... also, checking your % learned from your magic menu would be troublesome, instead that will be moved to the Espers menu. Esentially, this is the logic. Learned magic will be binary, on or off. This allows us to fit every learned spell into 7 bytes (with 2 extra bits)... I want to increase that to and "even" 8 bytes, which allows up to 10 more learnable spells. This should be pretty easy to fix in natural magic as its binary as well (you hit the right level, you learn it, flip the bit on). Progression-based learning is a lot harder... so how are we going to handle this? ESPERS! instead of having a byte per spell... we will use a byte per-Esper per-list. By using multipliers, each esper can easily display how far along you are in each spell (even if you have to add percentages from other espers that learn the same spells). Once you hit 100% on a spell, it turns on the appropriate bit in the list and BAM, magic learned. There are 27 Espers so 27 bytes + the 8 bytes of binary = 35 ($23) per magic list. This is in contrast to the 54 ($36) of per-spell learning in vanilla. Which means we can make up to 16 magic lists and have 88 ($58) left over bytes that can be used for other things in the SRAM. I don't see any practical reason to go above 16 lists, but hypothetically giving up the extra SRAM you can make up to 18 lists this way. The reason this removes learning spells by weapons is the fact that it's progression-based learning by individual spells. I can't add bytes for each weapon for each character, and I could add a system where you could learn from 1 piece of equipment at a time, and if you unequip you lose all your progress... but that's just getting REALLY muddy and complicates things a lot... So I think in this instance, you'd be better off just dropping equipment-based learning entirely. To replace it, it would be pretty easy to learn spells via event or item, as both of those methods would be binary. So this is where you guys come in... I'm trying to keep track of all the places the game interacts with the magic lists. I need a complete list to make sure I'm doing this right. Also, if any coders would be willing to work on building this patch, in part or in whole, so I don't have to, I'd be totally fine with that and obviously you would get credit for your work. If anyone can help me hunt down the exact locations in each bank, that would be really helpful.
Anyway, the magic lists take up soooooooo much SRAM, and a more efficient system would be a Godsend for hackers, especially those wanting to add a 15th and 16th permanent party character. So help me out! Let's do this. Happy Hacking! Final Beta Round! MMMMMagic 1.9.5 Beta! Includes:
RE: MMMMMMMagic update - m06 - 06-30-2016 This is a great idea, I'd love to see this working and am willing to help. In a way we could describe this as storing raw AP gained. For peer review, one issue I could think of: Two Espers can teach the same spell, this means computing all espers to realize a single spell learning status% Another solution to this problem is to ignore it, so if you already learnt 10% of a cure from an Old Esper you will start at 0% for cure on the Newly equipped Esper. This will be an issue to consider for the Menu Magic list aswell unless you would skip showing learning progress in that list. Another similar cool system could store AP and allowing the characters to spend it to learn stuff. That kind of system could easily be derived if the one above is implemented. RE: MMMMMMMagic update - B-Run - 06-30-2016 (06-30-2016, 11:39 AM)m06 Wrote: This is a great idea, I'd love to see this working and am willing to help. Yeah, I have been throwing those ideas around... My plan is to just remove partially learned magic from the magic menu, i don't need it trying to calculate EVERYTHING over and over... but it SHOULD be doable on the espers menu, since theres just a couple spells per esper, and you don't need to scroll around, it can be thrown up and be done... much more manageable. We could simplify things further by making it only for that specific esper, but I'd like to try having it check other espers first. And for choosing to learn with AP... I like the idea, but its too far removed from the learning system for my taste... and would also require some custom menu building for selection and such. But it would be great for a job-class system, which this patch would also help a lot with. The first thing i need is all of the locations in the ROM that magic is observed/used/learned. Pick a bank, and find some addresses so we can plan our code! Thanks! RE: MMMMMMMagic update - m06 - 06-30-2016 "Pick a bank, and find some addresses so we can plan our code!" - Ok C0 Bank Event command to teach a spell, there is an event for learning a spell (CA/000C), that is never used. There is code for an event command but no pointer it seems. C0/AE0D: Learn a spell, though this looks like unused code C0/A17F: Teach Natural Abilities learned via Automatic Level-Up C0/A196: Fork: Terra's Spell list C0/A1B8: Fork: Celes's Spell list C2 Bank Colosseum: C2/0420: (Pick action to take if character Berserked, Zombied, Muddled, Charmed, or in the Colosseum) C2/051A: (Magic and X-Magic) Battle Menu: C2/5429: (Magic and X-Magic menu entry) - (Blank out Magic/X-Magic menu if no spells are known and no Esper is equipped), maybe you don't need this it uses RAM $F6 C2/5551: (Generate Lore menus based on known Lores, and generate Magic menus based on spells known by ANY character. C2/568D will eliminate unknown spells and modify costs as needed, on a per character basis.) C2/568D: (Generate a character's Esper menu, blank out unknown spells from their Magic menu, and adjust spell and Lore MP costs based on equipped Relics.) Spell Points and Level Ups: C2/5FEF: (Progress towards uncursing Cursed Shield, and learning spells taught by equipment) C2/602A: (Progress towards learning spells taught by Esper) C2/604B: Progress towards learning spell C2/6133: (Mark just-learned spells for a character as known, and display messages for them) C2/61FC: (Terra and Celes natural magic learning at level up) C3 Bank C3/0D2B: Determine if a character actually knows magic C3/4FC4: Draw a column of spells C3/50A2: Get spell's learned amount, or, if it's Gogo, branch below to check everybody else in the party. C3/599F: Esper detailed screen C3/5A84: Draw dd% in the esper screen C3/87C7: Draw spell learning in equipment info screen That's what I got for now, I also wanted to suggest you make hex for testing your data structure. We could directly modify the SRM with a script (https://www.ff6hacking.com/forums/showthread.php?tid=2067) or debugger. Edit: Made some hypothetical data list. Code: Learned Magic Byte #1 Edit 2: added some C2 stuff, a lot in the C2 seems to work on the initalized battle menus RE: MMMMMMMagic update - B-Run - 06-30-2016 FANTASTIC! Hopefully I'll get some time to dig into this over the weekend. Gotta do stream prep for tonight, and we'll see what kind of things I have immediately on the docket after that... but hopefully we can start getting this coded soon. RE: MMMMMMMagic update - HatZen08 - 07-01-2016 It will be a relatively complex project because you must hunt down any piece of code related with the learning rate of the magic system to change it from one-byte to one-bit. They are scattered in the rom and if you fail to detect all of them bugs surely will happen. I recommend to be pragmatic and to check all information available to discovery what can be implemented. Based on it, a plan can be designed. The relevant main routines that i know are described below: C0/A17F to learn magic or update other skills at level up It is necessary to update Terra/Celes natural learning of spells. I suspect this routine only works at character creation to enable spells based on the level of the character created. C2/4F08 to discover mp cost for spell When i changed the C2/568D routine in the imbued magic hack, i discovered that the mp costs, in the battle menu, are wrong. In the end, this routine has a bad design and may not work correctly based in your changes in the C2/568D routine. If you have trouble with the mp costs for the magic spells in the battle menu, i tell you in advance that this routine deserve you attention. C2/568D to setup magic spells in the magic menu in battle It is a complex code because it aggregates the summon, magic and lore spells in the same routine. They are too much optimized that you will be forced to deal with all of them in the code. It is not possible to change only the magic spells. Many other factors are in the way, like the alteration of the summon/spells/lore MP costs. Anyway, in battle, if you want the magic spells in the magic menu to work in one-bit instead of one-byte, you must update this routine. C2/5FEF cursed shield and learning spells by equipment The cursed shield and the learning by equipment are mixed in code. Probably you must separate the aggregated routines. C2/602A to update learn rate or enable spell after battle based on esper To turn the one-byte storage of learned spells to one-bit. You need also to check where the new learn rate of spells will be stored. C2/61FC to learn magic or update other skills at level up It is similar in functionality to C0/A17F. However, it update the natural magic for Terra or Celes after every battle if the conditions are correct. C2/6283 to discovery address of stored spell learn rate This function probably must be converted from one-byte to one-bit. It probably setup $F4 as a pointer to check, in another functions, the learn rate of the character spells. C3/0D2B discovery if character knows magic To discover if the character knows magic and enable/disable the mp display. If the display of the mp points in the menus are disabled, you should check this routine. C3/50A2 discover learned spells from character for no-battle menus It must be reimplemented to read from one-byte to one-bit. RE: MMMMMMMagic update - Imzogelmo - 07-07-2016 I had thought to do this one time before, but I never really tackled it, as it is quite involved. However, I am 100% in favor of doing it this way, at least as a major tweak patch. If I have any information that can be helpful for you, I'll be glad to dig it up, but it looks like you have a good start on it already judging from Hatzen's post above. RE: MMMMMMMagic update - B-Run - 07-07-2016 Honestly... as much as I would love to be the one to code it... I've had my hands super full recently... it may be another week or so before I can really get to it. If someone wants to take a crack at it, we've laid out the logic, and found most of the relevant code. Just remember to put a table in with $00-$0F to find out which of the 16 magic lists to use for each character (based on character properties ID, not actor), and basically any other number be Gogo's magic... I would recommend leaving at least 32 slots for the table. Anyone want to give it a shot? Edit: Oh! and for natural magic, it should check the character ID for whether or not to learn natural magic, but then have it save to the magic list in that characters slot in the table. make sense? RE: MMMMMMMagic update - B-Run - 07-22-2016 So this is what we came up with on-stream last night. I will try to get this coded over the weekend, after that, the rest should be a LOT more simple... until I find another roadblock, of course. RE: MMMMMMMagic update - B-Run - 08-18-2016 Ok, good good good stuff happening. But I'm at an impasse on what to include in the patch release, and what to leave up to the modder... First: For useage of the 10 additional spells, reordering the spells is a pretty simple ASM task, just updating the table with the correct order, editing espers to reflect the change, and changing the offset values for each list order in C2/574B... it sounds complicated, but its actually relatively simple. However it is something that would need to get done if someone was going to customize the new spells. This can't be pre-worked unless we set specific spells in specific slots. Second: Startup animations for the new spells won't be automatically set. Again, if people are making their own lists they may decide to use Summons (which already have their own animation), or a physical set (with no animation), or brand new Black/White/Gray magic... So that means adding code if you need to use the magic startup animations, since they are hardcoded for the current spells only. Again, this can't be pre-worked unless we set specific spells in specific slots. Tho what I could do is set up the code, and set it up so all the hacker would need to do is set up the values of the additional spells for each startup animation type they want. Now, with both of these things in mind, I could, for the official patch, do this work for them. My plan would be to use a specific set of new spells, built over the Desperation attacks, and remove the desperation mechanic from the game, then do all the work of reordering and setting up startup animations. I recognize most people wont go through the effort to do the ASM to make it totally custom, so there should be an option for non-ASMers. What that would do, however, is exclude the possibility of people using non-standard magic types, like Summons or even Blitz' in their additional magic. So it loses flexibility for something more plug-and-play. I guess I could release multiple versions of the patch, one for people who want to customize it, and one for people who want plug-and-play. Anyone who is interested in this patch have any comments or suggestions? How would YOU like to see it when you patch your ROM? |