• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

Dokurider's Custom AoEs

Started by Dokurider, April 21, 2014, 04:41:48 pm

Dokurider

April 21, 2014, 04:41:48 pm Last Edit: December 21, 2016, 06:58:12 pm by Dokurider
This project will be delving into making custom AoEs. Thanks to SA's notes, I've determined how the game makes Linear/Tri Attack AoE, more or less. With this knowledge, I can make the Cone AoE everyone's been wanting so bad. Here's how it works:

I've noticed that aside from 255, most AoEs don't top over 15, or 2 for that matter. So I decided I could use that unused data as flag data for custom AoEs. To access these AoEs, edit the AoE value to 0x8x, 0x4x, 0x2x, 0x1x, or 0x0x (128 + x, 64 + x, 32 + x, 16 + x, or 0 + x, respectively), X being the actual size of the AoE. For instance, if you wanted a Cone AoE with a size of 3, you would change your AoE to 128 (0x80), then add 3 to make it 131 (0x83). X can only go from 0 to 15 now, but if you make X = 15, or 0x0f, it automatically becomes map wide AoE.

With this code, up to 15 (F0) AoEs can technically be implemented, but only so many can be coded at once due to space concerns, and I doubt anyone would want more than two AoEs. After I reroute Linear/Tri Attack AoE into this code, I'm open to making one more custom AoE, then I'm moving on to my next project. After I create the full version of this code, there will be two free flags to use (Linear/Tri Attack coincidently), one of which I'll be using myself.


8x: Cone
4x: ????
2x: Linear
1x: Tri Attack
xf: AoE = 254

[youtube]c_kzZM27-G4[youtube]


Oh and when implementing this code, be sure to use the Kanji Space Nopper first. You also need to patch in my Target Unit Only hack because this hack uses the space that hack made.


Here is the current list of hacks I've made.

Dokurider

Oh. Crap.

Finally looked up a description of Abyssal Blade's AoE. I got it upside down. Well, I know what I'm doing this week. It shouldn't be too hard now that I've gotten the hang of how the game stores tile data and how to call them up. It just looks like a modified Linear AoE. To be fair, there's like no videos of WoTL.

Choto

May 06, 2014, 04:17:48 pm #2 Last Edit: May 06, 2014, 05:49:58 pm by Choto
Nice friggin work! Hehe, if you make a linear target, perpendicular AoE, I have a perfect Flame Wall effect to go with it :P

Since you're off and running in ASM euphoria (finally knowing how to do shit), if you document any routines that aren't posted on the Wiki, feel free to post them. All the red-linked ones I have, I just haven't posted the notes since nobody has been ASMing for like a year or 2. If you need any, I can provide them.

Edit: Btw, you should definitely set a breakpoint on those two targeting flags and see how the AI uses them before you repurpose them.

Pride

Have you tested to see if the AI can properly use the custom AOEs? I could check the offsets to see if they're in the AI section but that would require some effort that I do not have after work at this moment.
  • Modding version: PSX
Check out my ASM thread. Who doesn't like hax?

Timbo

Conic AoEs. My mouth is watering.
  • Modding version: PSX
  • Discord username: Timbo

Dokurider

May 07, 2014, 03:08:10 pm #5 Last Edit: May 07, 2014, 03:20:14 pm by Dokurider
Quote from: Choto on May 06, 2014, 04:17:48 pm
Nice friggin work! Hehe, if you make a linear target, perpendicular AoE, I have a perfect Flame Wall effect to go with it :P

Not sure if I understand what you mean. Pictures please?

Quote
Since you're off and running in ASM euphoria (finally knowing how to do shit), if you document any routines that aren't posted on the Wiki, feel free to post them. All the red-linked ones I have, I just haven't posted the notes since nobody has been ASMing for like a year or 2. If you need any, I can provide them.

Eh, I didn't really blaze any trails into the unknown making this hack. I can however give a more detailed explanation on the code I used to make this hack, if only to help future users better understand how to make their own AoEs.
Quote
Edit: Btw, you should definitely set a breakpoint on those two targeting flags and see how the AI uses them before you repurpose them.

I don't think it'll be a problem because you have to flag the corresponding AI flag for Linear/Tri Attack skills anyways. I'm pretty sure the AI doesn't reference ability data, only its corresponding AI flags. Still, wouldn't hurt to make sure anyways.

Quote from: Pride on May 06, 2014, 05:59:59 pm
Have you tested to see if the AI can properly use the custom AOEs? I could check the offsets to see if they're in the AI section but that would require some effort that I do not have after work at this moment.

I replaced Gafgarion's Night Sword with this skill and he seemed to use it just fine. I would be surprised if he didn't though because I'm pretty sure the AI just looks at what tiles are being targeted. I think as long as it not too bizarre, like Etna's Sexy Beam AoE bizarre, and you AI flag it properly, I think the AI should use it just fine.

My running theory right now is that the AI flags on the ability allow the AI to preemptively position themselves so they can attack more effectively (line yourself up with your target, you idiot, in the case of Linear).

Choto

Posting a picture of what I meant. Don't bother though. I wouldn't even get around to using it anytime soon. Maybe if other patchmakers want it, but I don't want you to put the effort in for me.

Good point with the AI flags... That'll be pretty sweet if it works nicely. With the routines thing I just meant in the future if you continue hacking. I think you're the first new person to learn ASM since rfh...and the last one before that was me like 3 years ago lol. It's nice to see somebody prove that ASM isn't impossible to learn.

BTW, save the code for the other cone shape. Maybe we can work more of them in some way.

Dokurider

Progress Report

Okay, so I have to throw out or heavily rewrite my current code. It's gotten waaaaay too convoluted. Like "Holy shit, it's actively using 15 registers." convoluted. So instead of trying to directly emulate it, I'm just going to reproduce it's functionality.

How A.B. works in WotL:

00000
000
   o
   u

0 = AoE
o = Tile that has be targeted
u = unit
r = Range

Now here's how I'm going to do it:

00o00
   000
RR0RR
RRRuRRR

Crude, but it works. It works like my original (and backwards) Cone AoE: limit AoE by Target X/Y. If tile's X/Y is past that point, it's not apart of the AoE.

It's a shame I can't think of an efficient way of generating this Cone AoE. I chose to try to generate it strip by strip, but it's gotten so complicated I couldn't keep up with it. It's going to take another week to get this working. Sorry about that  :cry:

Quote from: Choto on May 07, 2014, 07:40:11 pm
Posting a picture of what I meant. Don't bother though. I wouldn't even get around to using it anytime soon. Maybe if other patchmakers want it, but I don't want you to put the effort in for me.

BTW, save the code for the other cone shape. Maybe we can work more of them in some way.


Hmm, that...might be doable. Don't quote me on that.

Celdia

Quote from: Dokurider on May 14, 2014, 02:37:11 pm
Progress Report


Inefficient or not, if it works without breaking anything it'll be a very nice breakthrough. Looking forward to a testable product.

Quote from: Dokurider on May 14, 2014, 02:37:11 pm
It's going to take another week to get this working. Sorry about that  :cry:


Never apologize for making something new and useful, no matter how long it takes. Anyone that gets all in a twist over something like this taking a long time to make obviously doesn't understand the kind of work that goes into it.
  • Modding version: PSX
  • Discord username: Celdia#0

Choto

Could you post any annotated code that you have? I'm interested to see exactly how they/you store the info. Also could you mention what routines your tapping into?

And yeah, no worries about time frames. Just have fun with it :)

Dokurider

May 20, 2014, 03:20:24 pm #10 Last Edit: June 03, 2014, 04:21:31 pm by Dokurider


So, yeah...
This isn't 100% complete yet, not technically. I need you guys to rigorously and methodically test the crap out of this hack. Here's a list of things I know I need feedback on:


  • Overlapping tiles (Maps like Golrand Execution Site and Lionel Castle.)

  • Maps that are longer than 0x0f (Test this with Max AoE)

  • Test this AoE before, after or in conjunction with other skillsets (Math Skill in particular. Use it as a secondary.)



To do:
Make the AoE resize itself properly when bordering the sides of the map.

Otherwise, enjoy.

Quote from: Choto on May 15, 2014, 08:09:50 am
Could you post any annotated code that you have? I'm interested to see exactly how they/you store the info. Also could you mention what routines your tapping into?

Yeah, I can go through all the routines I looked at and referenced in SA's notes tonight and comment on them.

Attached are Dokurider4.xml (the hack itself), and Cone_AoE_2.txt (the code itself, with mostly complete annotations).

Dokurider

May 27, 2014, 03:40:02 pm #11 Last Edit: May 27, 2014, 03:51:27 pm by Dokurider
Huh, I thought making honest to god Abyssal Blade Conic AoE would generate a little more excitement. Oh well.

For my next hack, I want to allow Self Attacking. That is, Attacking yourself. It's kinda tricky, I'm still trying to parse down exactly why you can't. If I can only find out at what point is Range used. Too bad trying to find when Ability Attributes are loaded isn't easy because they get saved to the stack and used that way instead. (and foiling Ctrl+F 'xfbf0')

In any case, while I was looking for that, I think I might have found what the Normal Attack flag actually does. It actually determines whether Golem intercepts it or not. It seems really dumb when you could have just checked the units' action menu or anything else besides wasting an entire flag. It's possible it could do something else: I only found this check out of sheer luck when I Ctrl+F'd '0x0008'.

I tested this out this morning, slapped it on Repeating Fist, and Fire and yes it does work. It does allow Golem to stop those attacks. It just doesn't display the Golem intercept animation which is what threw me initially.

This...might have some interesting balance implications. Just take off Normal Attack off of Attack and tada! No more Golem breaking the AI. Or attach it to abilities that can deal a great deal of damage and the problem with Golem goes away.

I wonder though? I know the AI prioritizes destroying Golem, but does it prioritize destroying it with Attack? Or just destroying it period? Another thing to look into when I look at Status AI next.

Oh yeah, and one more thing, Choto:

Code (Targeting Routine) Select

0017b8d0: 90690003 lbu r9,0x0003(r3) ability flags 1
0017b8d4: 90710004 lbu r17,0x0004(r3) ability flags 2
0017b8d8: 90640006 lbu r4,0x0006(r3) ability flags 4
0017b8dc: 90730001 lbu r19,0x0001(r3) load aoe
0017b8e0: 90750002 lbu r21,0x0002(r3) load verticle
0017b8e4: 30840020 andi r4,r4,0x0020
0017b8e8: 10800003 beq r4,r0,0x 0017b8f8 branch  if not Weapon Range
0017b8ec: 00458021 addu r16,r2,r5 r16 =  attacker unit data pointer
0017b8f0: 35290020 ori r9,r9,0x0020 r9 = Weapon Range Flag (0x0020)
0017b8f4: 32310039 andi r17,r17,0x0039 remove everything but Top Down and Random Fire

3lric

Quote from: Dokurider on May 27, 2014, 03:40:02 pm
Huh, I thought making honest to god Abyssal Blade Conic AoE would generate a little more excitement. Oh well.


It's not a matter of excitement Doku, its a matter of the fact that a lot of the people on the forum are to afraid to even
look in this section, as I am. Mostly due the the wizardry that goes on here and my lack of understanding any of it :P

None the less, awesome work on these man! I will definitely put these to good use one way or another!
  • Modding version: PSX

Dokurider

Yeah thanks. Let me know if you have any problems with any of them.

Celdia

Quote from: Dokurider on May 27, 2014, 03:40:02 pm
Huh, I thought making honest to god Abyssal Blade Conic AoE would generate a little more excitement. Oh well.


Please don't get discouraged by the lack of fanfare over your work here, Doku. This is amazing stuff and I'm sure it will get used for something equally amazing. Keep up the good work. I know someone out there is chomping at the bit to go and let Dark Knights run amok on their PSX. ^_^
  • Modding version: PSX
  • Discord username: Celdia#0

3lric

Yes mam, someone certainly is.
  • Modding version: PSX

Timbo

Wait, not only did you code Abyssal Wave, but you fixed Golem too? Fantastic Work. I have a question. Can you set any distance you want on the cone? I'm thinking about changing the dragons breath attacks to 2 square cones.
  • Modding version: PSX
  • Discord username: Timbo

RavenOfRazgriz

Normal Attack also controls whether the attack is intercepted by Hamedo.

I discovered what the flag did a long time ago when making Jot5 Chapter 1 but forgot to actually tell anyone about it.  But yes, it controls Golem, Hamedo, and maybe something else, it's hard to remember back to like 2012 when I noticed what it did.  (This is relevant if you use Choto's hack that "nerfs" Hamedo, since you can make it effective against more attacks to compensate if you wish.)

Timbo

Hamedo support vs Golem skill. The Hamedo hack makes counter useless and Golem has an effect so... I choose Golem. Thanks Dokurider.
  • Modding version: PSX
  • Discord username: Timbo

Choto

It would not be difficult for one to edit which ability Counter uses and repurpose it into Counter: _____. I didn't think about that overshadowing of Counter with that hack. Collateral damage! =)