Jump to content
  • 0

Equipped Weapon Collision Size


TheUntoldLyric
 Share

Question

I would like to change the 'collision' size of a held item. Say, a Broken Giants Knife.

How would I go about doing this?

 

I already tried to disassemble when a enemy was hit and try to follow the code back to the weapon damage to see if it was around there.

I also tried a few other misc breakpoint disassembly stuff, some of which was with the Infinite Sword Glitch enabled.

I also tried to use Cheat Engine and searching for changed values when I switch to a different weapon/slash with a different weapon, though this idea might be initially flawed because the collision isn't just one changing object, I don't think.

 

I'm not actually 'too' familiar with assembly. I've done some smaller, simple assembly hacks for some SNES games, yet it seems alot more difficult to do anything on the N64. Maybe because of how much more data it is, or the UI of the debugger, or I simply don't have my mind fully around assembly yet.

Regardless, I've had no luck these last few days.

 

Can anyone with a little more experience than me give me suggestions on what to look for, or better yet, lend a hand in looking?

Thanks in advance for any help.

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Collision is still largely unknown but I have few ideas on how to crack it.

 

Think about what an actor (enemy instance) does when getting struck...

  • It might turn red
  • If it was killed, it'll flash white
  • It might play a sound
  • It loses some health
  • It may produce sparks if wearing armor (i.e. Iron Knuckle)

So, keeping this in mind, it would make sense to place BPX on one of the function responsible for doing this. Unfortunately, the function responsible for playing SFX is used all throughout the game so you'll have a lot of noise when trying to uncover what you're looking for. You can combat this by silencing all other sounds in the game that interfere (trace back function calls by looking at register $ra).

 

It might be easier to place BPX (breakpoint execute) on the functions that handle health reduction, turning red, hit sparks, or death flashes mainly cause they're specifically related to weapon collision.

 

Anyways, here are function addresses for OoT Debug:

0x8002F828 = extern void playSound(RAMActor* a, u16 sfx_id);
0x80035628 = extern u8 decrementHealth(RAMActor* a);

And these are for OoT 1.0... Although it shouldn't be any trouble to find them in OoT Debug:

0x80025B4C = extern void deathFlash(void* gameBase, RAMActor* target);
0x80027090 = extern void highlightActor(RAMActor* target, u32 colour, u32 duration, u32 unk1, u32 unk2);
0x8001D7A8 = extern void hitSpark(void* gameBase, u8 sparkType, CoordU* loc);
  • Like 1
Link to comment
Share on other sites

  • 0

803D7B80 - when Link swings his sword or spin attack

 

You might need to breakpoint, and change values... they are likely float values, and that is probably not the spot for the collision box, but you can start looking from there.

Link to comment
Share on other sites

  • 0

For swords, my main theory has been that the collision box for swords is a simple line that extends out from Link's hand, but it's probably wrong. The reason for this idea is that it's possible to have a sword hitbox that doesn't match the sword model length in some cases (Child Link with Master Sword equip = Child Link with Kokiri Sword model, Master Sword length).

 

The spin attack is a separate actor (0057: ovl_En_M_Thunder), so you might discover some things if you look into it

Link to comment
Share on other sites

  • 0

There is a way to make it so that your sword and shield hitboxes are visible during gameplay.

I have no idea at all how to do it, but when my friend was over a few weeks ago we started up the debug rom on console, and he looked up things you could do with the debug menu. Specifically a menu when you could change a bunch of values to affect gameplay.

As I recall, the sword hitbox is a flat square surface that follow the sword, and your shield is a *giant* flat square surface. (It is huuuge)

So yeah, both of them are flat at the very least. And it is not just a line.

 

Some googling should help. If not, I can always go grab my laptop later and look at the browser history, should be there somewhere.

Edit: Or I can't... I can't see it in the browser history. He may have been using his own laptop.. Hmm.. I was sure he used mine.

Edited by CloudMax
Link to comment
Share on other sites

  • 0

I've looked at the answer for this for far too long but each time have come up blank. MZXRules is right though that the length of the sword deals Nothing with the model of the sword itself (which is strange because the Deku Stick is programmed in such a way that it's length of swing is as long as the Deku Stick currently is.)

 

The Hit Detection in the Animations themselves have not helped me in anyway in finding the sword's slash. Something, somewhere is telling the game that this Action Parameter is in use therefore the swing should be This long. Unfortunately, despite all of my leads on where the current action parameter is saved I have never been able to find it. Hopefully someone will be able to though.

Link to comment
Share on other sites

  • 0

I've looked at the answer for this for far too long but each time have come up blank. MZXRules is right though that the length of the sword deals Nothing with the model of the sword itself (which is strange because the Deku Stick is programmed in such a way that it's length of swing is as long as the Deku Stick currently is.)

 

The Hit Detection in the Animations themselves have not helped me in anyway in finding the sword's slash. Something, somewhere is telling the game that this Action Parameter is in use therefore the swing should be This long. Unfortunately, despite all of my leads on where the current action parameter is saved I have never been able to find it. Hopefully someone will be able to though.

I remember finding a float value on the Iron Knuckle that changed the size of the slash from its axe, and I ended up shrinking it really small. Like I mentioned in my float editor, the values do a multitude of things, but you have to find them yourself.

Link to comment
Share on other sites

  • 0

I spoke with my friend and now I feel dumb. He found the info at http://tcrf.net/Proto:The_Legend_of_Zelda:_Ocarina_of_Time_Master_Quest (I must have missed it, because I use that page quite a bit)

In the memory editor section it says "Setting RA15 to 1 enables a collision display. If Link swings the sword, hide behind his shield, shoot an arrow or do other stuff, the collision box will be colored red."

So yeah, just set RA15 to 1 in the memory editor and it will display collision. Should prove helpful.

Link to comment
Share on other sites

  • 0

Well just earlier today I found the answer to this! I ironically found the Broken Giant's Knife first, which is lucky because I never would have found it otherwise...

 

In RAM at...

 

13E94C - Location of Broken Giant's Knife Swing

 

126080 - Pointer to Slashes

 

1260E4 - 457A0000 - Master Sword Slashes

1260E8 - 453B8000 - Kokiri Sword Slashes

1260EC - 45ABE000 - Giant's Knife Slashes

1260F0 - 00000000 - ???

1260F4 - 451C4000 - Megaton Hammer

 

In Rom at...

 

 

BB5AEC - 44BB8000 - Location of Broken Giant's Knife Swing

 

3BD284 - 457A0000 - Master Sword Slashes

3BD288 - 453B8000 - Kokiri Sword Slashes

3BD28C - 45ABE000 - Giant's Knife Slashes

3BD290 - 00000000 - ???

3BD294 - 451C4000 - Megaton Hammer

 

Deku Sticks, as per fkualol's findings would show, are special and their length is the actual length of their swing.

 

Now you can Actually make new weapons that don't have to be the same size as the original! Enjoy.

  • Like 2
Link to comment
Share on other sites

  • 0

Wow, I was actually looking for something like that, Three_Pendants! It will be very useful to me atleast. Do any of you guys have an idea where these may be located in MM, like for example the Goron punch or the Zora kick and all that?

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.