øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=903.msg9060e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index395e.htmldelayedslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=6;area=showposts;start=1515e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index395e.html.zxA h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤èúOKtext/htmlISO-8859-1gzip8:ÖèúÿÿÿÿÿÿÿÿÑHWed, 11 Mar 2020 08:40:58 GMT0ó°° ®0®P®€§²ð®; h^ÿÿÿÿÿÿÿÿš"èú FF4: Bows and arrows hard-coded?

Author Topic: FF4: Bows and arrows hard-coded?  (Read 3680 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
FF4: Bows and arrows hard-coded?
« on: December 13, 2008, 10:18:18 AM »
I was fooling around with changing some of the weapon data and I tried making a weapon that used to be a bow into a holy sword. Sadly though, clearing the "bow" flag didn't seem to affect the way it equips on the character. Poor Cecil de-equipped his shield which promptly disappeared (I guess the game thought it was a quiver of arrows?), and after de-equipping the weapon in question, he was then able to equip it on either hand for a pathetic +1 attack power increase.

So it would seem as though the game gets the information about which weapons equip like bows and arrows and which ones don't from a different place from the rest of the weapon data.

Does anyone know where that might be? I tried searching the forums here as well as JCE3000GT's FF2US hacking doc, and even DragonFox's TBL file and couldn't find anything relevant.
Let's dance!

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #1 on: December 13, 2008, 10:35:00 AM »
You might want try changing the weapon graphics (not the palette) because there's a possibility they are linked at that level. That's only a guess though.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: FF4: Bows and arrows hard-coded?
« Reply #2 on: December 13, 2008, 10:38:47 AM »
If it's hard-coded like that, it's going to be some assembly code *probably* in the 06000-0FFFF range that checks for the weapon number. As far as I know, no one knows the location of it as of yet. Anyone able to prove me wrong?

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF4: Bows and arrows hard-coded?
« Reply #3 on: December 13, 2008, 10:51:56 AM »
I've never bothered tracking this down, I just worked within the original limits, so I wouldn't know where to look for it. Hacking the animation won't do anything, you could make a bow look like a sword, but it would still act like a bow when equipped (I played around with this kind of thing a lot).

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #4 on: December 13, 2008, 10:57:01 AM »
You might want try changing the weapon graphics (not the palette) because there's a possibility they are linked at that level. That's only a guess though.

I actually did this as part of changing it to a holy sword. I changed its graphics, its palette, I even changed the "unknown" fourth byte to 01 (the one used for swords, spears etc). The animation correctly looks and sounds like a holy sword, it's just the way it equips on him is like a bow.
Let's dance!

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #5 on: December 13, 2008, 11:02:59 AM »
I'll just label this "doomed to be hardcoded".
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #6 on: December 13, 2008, 04:13:45 PM »
On a related note, it seems that setting the "two-handed weapon" bit does not actually make the weapon two-handed either. I'm assuming that there is some other table we don't know about somewhere that stores the information on what weapons have what special equipping properties.

In the meantime I did some more toying around and it turns out that if an arrow weapon doesn't have the "arrow" bit set, it doesn't get consumed when you attack. Furthermore, a bow without the "bow" bit set can be used in the character's main hand and the arrows in their off hand for as much or more damage than the reverse.
Let's dance!

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF4: Bows and arrows hard-coded?
« Reply #7 on: December 13, 2008, 04:21:46 PM »
I knew about the arrow bit (I used it to make a glass sword, then removed it because of the near-infinite arrow bug), but never played around with the bow bit before. I've always been curious what those bits do on armor, I've never been able to figure anything out.

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #8 on: December 13, 2008, 04:23:23 PM »
On a related note, it seems that setting the "two-handed weapon" bit does not actually make the weapon two-handed either. I'm assuming that there is some other table we don't know about somewhere that stores the information on what weapons have what special equipping properties.

If it isn't really what it says it is, then it is strictly a "Sing" command indicator.

Quote
In the meantime I did some more toying around and it turns out that if an arrow weapon doesn't have the "arrow" bit set, it doesn't get consumed when you attack.

That should make it FF4DS worthy of a change... but more importantly, this was experienced in JCE's hack as an annoying bug.

Quote
Furthermore, a bow without the "bow" bit set can be used in the character's main hand and the arrows in their off hand for as much or more damage than the reverse.

There's a good chance it toggles the Bow damage reduction algo (Bows are always at a disadvantage as only half of its attack power is considered).  It should be looked into further though.. because Bows are the best at dishing out critical hits than regular weapons by design.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Dragonsbrethren

  • Forum Overlord
  • *
  • Posts: 1,820
    • View Profile
    • Dragonsbrethren Industries
Re: FF4: Bows and arrows hard-coded?
« Reply #9 on: December 13, 2008, 04:25:14 PM »
If it isn't really what it says it is, then it is strictly a "Sing" command indicator.

You know, I don't think I've ever tried this, that's a good idea.

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #10 on: December 13, 2008, 11:43:03 PM »
If it isn't really what it says it is, then it is strictly a "Sing" command indicator.

You know, I don't think I've ever tried this, that's a good idea.

I know for sure that's the case (give Cecil a Poison or Rune Axe and the Sing command is available).. and I think Phoenix has mentioned that some time ago too..

http://slickproductions.org/forum/index.php?topic=292.15

Quote from: Phoenix
Here's an interesting fact about Sing that I never knew. I found it out by looking at a subroutine for dimmed (unusable) commands:

Sing is dimmed out (unusable) except when equipped with a weapon from 44 to 4C. These include the Harps, but also include the Dummy weapon, the Poison Axe, the Rune Axe, the Silver Hammer, the Earth Hammer, the Wooden Hammer, and the Avenger Sword. I have no idea why this would be, unless Cid was supposed to have a Sing command   or it was just lazy coding. More harps also might have been planned and changed to the other weapons later.

Quote from: Myself
It's probably lazy coding for the most part, but the behavior is consistant with two handed weapons.
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: FF4: Bows and arrows hard-coded?
« Reply #11 on: December 14, 2008, 11:17:36 AM »
Just in case anyone's interested, here's how I wrote the data down for the equiability byte on weapons:

06: Equipability Info
   bit 7: Opposite-Handed (i.e. Bows)
   bit 6: Expendable (i.e. Arrows)
   bit 5: 2-Handed (doesn't work)
   bits 0-4: Equip Index

The availability of Sing is hard-coded, as are the other commands. In that thread I was saying that all the commands' weapon-based availability was hard-coded, which I know for sure because I was looking at the subroutine that determined it at the time. The 2-handed byte was intended to be used, I'm sure, just like all of the other bits that they intended to be used (the equipability byte on armor has some of these) but never were. My guess is that they either has some miscommunication between the people doing the coding and the people using the coding, or else they just never got around to programming that in and had to just hard-code it in a subroutine instead.

Given the prevalence of hard-coded features, the bow damage reduction factor is also probably within a subroutine, and not read off of a bit.

Deathlike2

  • FF4 R&D Master
  • *
  • Posts: 3,538
  • I'm looking at you, bitch!
    • View Profile
Re: FF4: Bows and arrows hard-coded?
« Reply #12 on: December 14, 2008, 11:32:24 AM »
My guess is that they either has some miscommunication between the people doing the coding and the people using the coding, or else they just never got around to programming that in and had to just hard-code it in a subroutine instead.

Isn't the dummy Crystal Sword proof enough? Plus the fact that it's actually worth more....
Working on the next Yet To Be Named FF4 "Hardtype" Hack Download Latest: v1.48

Video Demos: #1 #2 #3