Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in ROM Hacking. |
Acmlm's Board - I3 Archive - ROM Hacking - GBA Fire Emblem Spells and FE8 skills | New poll | | |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
User | Post | ||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Now, first of all, I'm rather new to hacking but I'm picking it up rather quickly. I'm mostly just doing this all for fun, and I'm working on an FE8 hack.
Now, I know some people who are fairly knowledgable with hacking, but they've been unable to help me with spell animations. I want to know is where are they stored and what determines that, for example, Excalibur shows an Excalibur animation? I want to make more spells and magic wepaons, but I cannot find the spell animations in order to make this happen. It's not in the weapon data. Can anyone help me with this? I don't want anything custom or anything that complicated, I just want to know how make other items use an animation. As well, I'd like to know where the FE8 skills are stored and what determines that a class can use it. (Silencer, Critical Bonus and Summon are not included in this question.) It's not in the class data, at least, not that I can find, and I'd like to find it. And, after finding it, I'd like to know if it is possible to edit them. (Such as, increasing the critical hit rate, or changing activation rates, say, using Luck as a opposed to level, or own level opposed to enemies.) As well, I'd like to know if it could be possible to make new skills (such as giving a unit a change to act as if attacking with a Brave Sword for a Continue/Adept like effect.) If anyone can help me, I'd be greatly appriecated. |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
You, or whoever is going to tackle this (you're with the guys from FESS, I presume?) is going to need to be proficient in the THUMB instruction set for GBA - http://nocash.emubase.de/gbatek.htm is an absolute must-have resource concerning this and other hardware matters.
You're going to need an emulator with a debugger, and know how to use various types of breakpoints with it (read/write/execute). I would suggest the Shareware version of no$gba or in lieu of that, VBA-H. There are a number of ways you can track down the information you're looking for using a debugger. For example, to find animation data, you can put a breakpoint on the graphical data when it is written to VRAM (as I did for this post), and work backwards from that, or you can put a breakpoint on something like the address in RAM that tells the game which spell you've selected (a technique I call cursor hacking) and trace forwards from that. At any rate, using breakpoints to find data generally requires two things. 1. A memory address to use as a starting point (e.g. to find something like a critical hit rate, you could start from the address in RAM that holds an enemy's HP). Sometimes you'll already know a memory address, sometimes you'll have to find one - this is where it's helpful to know how to hack cheat codes (for your gamesharks, action replay's etc...), as these techniques can be applied to find the address you're looking for. I've written a series of tutorials that starts off with basic cheat code hacking concepts, then moves on to how these can be applied to ROM hacking tasks such as these. 2. Knowing how to use a debugger, and understanding what an opcode means. To trace through assembly instructions, it's generally helpful to know what they're actually doing This is where a document like GBATEK comes in extremely helpful. Good luck. |
|||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Actually, I'm working on this on my own, but yes, I am with FESS. Alright thanks for the help. I'm going to have sit down and figure all of this out, since I'm somewhat new at all of this. I'm sure I can. Correct me if I'm wrong, but that's only the info to find the animations, correct? But not to give another item the animation? I'd still like some help with the skills, which might be hard. (edited by ZephyrShakuraus on 10-01-06 07:35 PM) |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
Originally posted by ZephyrShakuraus heheh, don't worry, you won't bump into me anywhere else - RHDN and Acmlm's are the only rom hacking boards I regularly frequent, plus it's school holidays where I am at the moment, so I've got a bit of free time.
What I've described will get you the locations of the data - the next step (which is the actual assembly tracing) is to find how a particular item is associated with the animation data. The process basically boils down to 'why is data from this particular address loaded?'. For example, for the code excerpt I posted over at RHDN: 080505c8 b570 push {r4-r6,lr}
The instruction at 080505d2 calls the BIOS function that decompresses LZ77 data. The function takes a number of parameters (as described in GBATEK) - the source address is in r0. So, the next step will be to find what bit of assembly calls the subroutine (the start of the subroutine is 080505c8), and then see how the value in r0 came into being. From there it's just a rinse and repeat process until you get to the point where a value is determined by something that you recognise as (for e.g.) an item identifier.
Once you've got yourself familiar with a debugger of your choosing, I'd be happy to answer any specific queries if I've got some free time up my sleeve. |
|||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Okay, given some time and some experience, I should be able to figure all of this out. Thanks, and I'll be sure to ask you if I need to.
Edit: Okay, quick one. How would I go about changing the Crit bonus from 15 anything else? (I have a lot, but this one will do for now.) (edited by ZephyrShakuraus on 10-01-06 10:27 PM) |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
Ok... I haven't actually played the game (I've done some work on its text compression and that's about it) so you're going to have to fill me in on the background. | |||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Heh heh...
To be honest, I only started this stuff yesterday. (I meant it, when I said new) So I don't know enough to even give you any sort of background, aside from the fact I think it would be little different from Fire Emblem 6 and 7 in terms of how it's stored. I'm not sure however. |
|||
Zeronova Newcomer Since: 10-01-06 Last post: 6427 days Last view: 6427 days |
| ||
Originally posted by labmaster There's a class in the game called 'Swordmaster' that receives a critical boost of 15 upon promotion. Dunno if that helps, but it's a start. |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
I meant, more of what the purpose of a critical bonus is and what it actually does (I played a bit of 7 but wasn't paying that much attention to what was going on). | |||
Zeronova Newcomer Since: 10-01-06 Last post: 6427 days Last view: 6427 days |
| ||
A critical bonus increases one's chance of inflicting extra damage to the enemy units. In general, scoring a critical's a good thing. | |||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Oh, okay. Well certain classes in the game, namely Swordmaster and Berserkers have a bonus of critical chance. In FE6, it's 30 and 15 in the other two FE games. In the class data, the thing that controls if they have it is in Class Ability 1. It's 40. You should be able to find it with 01 40 01 02 00 (being Resistance promotion gain, critical bonus in class ability 1, promoted unit, in the class ability 2 slot, and shamshir usable in the 3rd class ability slot. the last one is class ability 4, which is empty.)
However, this only determines if the unit gains the critical bonus. I want to edit the critcal bonus myself. |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
Hot off my text editor:
Okay, this should be pretty simple. I'll run you through the steps for this one which should hopefully give you some idea as to what's what. I'm using the trashman dump of Sacred Stones to do this. From the information you gave me, the flag for the Swordmaster is at 0880781c in the ROM. The game must read this value, check if a particular bit is set (the fact that the value is 0x40 leads me to believe that the game won't check if the value equals 0x40, but rather if the '4' bit is set or not). If it's set, then it'll add the bonus on. So what we need to do, is find the assembly instructions that read from this address - it should then do a comparison of some sorts, to check if the bit is set, and if so, it'll add the bonus on. I'll be using VBA-H as my debugger since you may not want to shell out $15 for no$gba (though it's entirely worth it, IMO). Download the package from the link above. VBA-SDL-H is a command-line program, to open a ROM you'll need to either invoke the program from the commandline with the ROM as an argument, set up a batch file to do this for you, or simply drag the ROM onto the executable in windows explorer. This should load the ROM and start the app. I have it set up so that it shares the same save directory as my win32 version of VBA - should be a setting somewhere in vba.ini Now, load up a savegame where you've got a swordmaster character, and get into a battle if you aren't in one already. Note: I wrote this out as I was hacking - turns out it wasn't such a flash idea. If you want to avoid wasting a lot of time, don't enter the breakpoint as detailed below until you've got into battle, selected a Swordmaster, and are just about to hit the 'A' button to select 'Attack' from the command menu.Debugging in VBA-SDL-H is done from the command line. To access the debugging prompt, press F11 in game. This pauses the game and puts you at the command line. From here you can enter a8 multitude of debugging comands - enter '?' to see what there is. For now, type in: bpr 0880781c 1
and press enter. This sets a memory read breakpoint on the ROM address 0880781c of length=1 (the address we're interested in). Then type in c
and press enter. This resumes the game. The breakpoint that we have set tells the emulator to pause the game when the processor reads from that address. Back in the game, select your Swordmaster. The game will stop, and you'll see something like this in the debugging console:
This tells us the game has read from the address 0880781c. Now, the thing is, this may not necessarily be the read that we're interested in. There is likely more than one reason that the game would want to read from this address (especially given that the game has read a word, i.e. 32-bytes, and not just the single byte that we're interested in). To see if this is the right break, type in 'n' at the console. This advances the execution of the game by one instruction. Repeat a couple of times and you'll see
I won't go into too much detail as to what this all means - once you've had some experience with THUMB opcodes, it'll make sense, but for now, take it from me that this isn't the break that we're interested in. So, type in 'c' to resume the game. The game breaks again. If you repeat the process from above, you'll see:
Again, this isn't the one we're interested in easier. This code masks off the lower bit of the word, which isn't the one we're concerned with. Type in 'c' to continue.
Again, not the right one (assembly hacking takes a fair bit of patience). Type in 'c' again. You'll notice that it continues to break at 0801d578, which we've already decided isn't the right one. We can use a nifty command to tell the emulator to ignore breaks at this address: db 0801d578
Continue the game, and the emulator will no longer break at this address. Now you should be able to move your character up to an enemy and attack. The game will break when you try to move your character to a square (at 0801a880), but again, this isn't the right one. It breaks a couple of times at this address so slap a db onto it as well. Next it breaks at 08078d7e, again, not the right one. db it as well. There's a couple more as well, which you can ignore. If you paid attention to the note up top, skip to here after reading the above. If you do this, the first break you get will be the correct one.Finally, it allows you to select 'attack', and we get the breakpoint that we're looking for:
the mov and and instructions 'mask' off the bit that we're interested in. If that bit is set, when we get to 0802ac44, r0 will equal 0x40, or else it will be 0. The game then uses 'cmp' to check if it's zero. If so, it jumps ahead to 0802ac4e. I prefer using the disassembly view in normal VBA, so open it up with the ROM, and go to Tools->Disassembly, and go to 0802ac3e. You'll see:
The 'beq' instruction is a 'branch-if-equal'. If r0 equals 0, then it will branch to 0802ac4e, skipping the 3 instructions. These 3 instructions are
If you've brushed up on your hexadecimal, you'll see that the second instruction adds 15 onto the value at r0. Sounds familiar? The first instruction must copy the critical bonus amount from register 2 to register 0, and the 3rd instruction stores this value to an address in RAM. We can modify the opcode to make it add any value that we want. This is where the GBATEK document comes in handy - knowing what hexadecimal values represents what opcode. The 'add' instruction is pretty easy, the basic format is: 3rxx
where r is the register, and xx is the value. In this case, changing the xx will change the amount that's added. So that's about it - changing the byte at 0802ac4a changes the bonus. One more thing that might be of interest - if we were to delete the instruction at 0802ac46, everyone would get a bonus, regardless of class. We can do this by replacing the beq instruction with a nop ("no operation"), so that the game never skips the code and everyone gets a bonus. A nop instruction is represented by 46c0, but remember that because the GBA is a little-endian system, if you're editing the ROM in a hex editor in bytes, then you enter 'c046' (the bytes are reversed). If you have any problems getting any of the above working, let me know. edit: fixed some typos (edited by labmaster on 10-02-06 01:10 AM) (edited by labmaster on 10-02-06 11:07 PM) |
|||
Zeronova Newcomer Since: 10-01-06 Last post: 6427 days Last view: 6427 days |
| ||
Ah...Would this also apply to other battle skills as well? | |||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
If by 'other battle skills' you mean (excuse my ignorance of the game) 'other attributes for which there exists an on/off switch, but not quantitative data', then yes, you can use a similar technique. You'd just need to put the breakpoint on the address with the bit that controls that attribute, and make sure that when the game breaks, it checks the correct bit. | |||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Okay, so I haven't completed figured this out, but a friend of mine has and we've managed to change the critical bonus. Him and I will be working on the remained of the skills using this method.
Now, would there be any way to create a new skill by using some of the "padding" in the ROM? Say I wanted to make a "Class Ability 4" that would allow to give the class a % chance (The game tends to use levels for chances, I would like to learn how to use other stats as well, however) to act as if it was using a Brave Weapon. (As in it would attack twice in a row.) If you need more data to be able to figure this out, I'm sure I could pull together anything you need. |
|||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
Quite tricky, but by no means impossible.
I've taken a look at the nightmare modules that SpyroDi made, which confirms my suspicion that the class abilities are boolean flags. So, you're only going to be able to create a new skill (easily) if there is a bit that is not used (if you know that there are exactly 32 skills, then unfortunately this means that every bit has a purpose). If all of the bits are used, then you're either going to have to overwrite a skill, or do a bit of assembly work to hook a relevant part of the executable and get it to execute some handcrafted code that checks in some other location (at the end of the ROM) for data you've inserted. The actual implementation of the skill shouldn't be too hard. It is going to involve creating a new assembly routine, which means you really do need to understand the THUMB instruction set (especially how bx's, bl's, push's and pop's need to be used). You'll also need to know how the game handles brave weapon's (i.e. where it checks if you've got one), and how to programatically access the RNG (which shouldn't be too hard). |
|||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
Okay, so how would I go about trying to find the newer skills, such as the Wyvern Knight's Pierce skill or the Rogue's Pick? (Pick is non-battle and Pierce is in battle.) As well, The General's Great Shield, Sniper's Sure Shot and Bishop's Slayer are also of great interest. | |||
labmaster Red Paragoomba Since: 11-18-05 From: Away for exams, back mid-December. Last post: 6364 days Last view: 6294 days |
| ||
Sorry for the delay.
Do these skills work in the same way as class abilities, or is there some other mechanism (or does no-one know?) Assuming that the 'class has certain skill' property is contained within the class data, once you know where it is it's just a simple case of breakpointing as per the tutorial above. If you don't know where it is, then you can either randomly or systematically corrupt parts of the class data until you find it. Alternatively, you can do an assembly trace from an effect of the skill itself and work backwards. The other possibility is that when you reach a point in the game when the skill can be triggered, the game would check the class of your character and see if it's in a list (held elsewhere) of classes that have a certain skill. If this is the case, then you could modify the list so that it includes the one's you want, which would be pretty straightforward (though if you wanted to expand the list you'd likely have to relocate it which would take a bit more work). |
|||
ZephyrShakuraus Newcomer Since: 10-01-06 Last post: 6410 days Last view: 6410 days |
| ||
They're not the same as class abilities and no-one knows where they are. I guess it looks like a time-comsuming process moreso than a difficult one. | |||
IOS Goomba Since: 10-09-06 From: Canada Last post: 6310 days Last view: 6294 days |
| ||
Phew, I'm trying to make sense of all this. Do you think you could run through how to implement a Brave Weapon type skill, so I get the hang of how to do it for other skills please? Thanks. |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - ROM Hacking - GBA Fire Emblem Spells and FE8 skills | | |