øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=123;area=showposts;start=480e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5341.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=123e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index5341.html.zxòg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ…¬ VOKtext/htmlISO-8859-1gzip@øÕ VÿÿÿÿÿÿÿÿTue, 10 Mar 2020 20:17:49 GMT0ó°° ®0®P®€§²ð®òg^ÿÿÿÿÿÿÿÿ§. V Show Posts - Grimoire LD

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Grimoire LD

481
No, no everything's working fine now. I'm still surprised at myself that I misread My Own Notes!!! And wrote Magical Defense into the AI Setup and the Magical Evasion as Magical Defense, how positively careless of me.

482
Yeah. That should be doable.
Let's see... Did I post the disasembly for that mod...?

 :edit:
I did, but... Which stat are you talking about specifically?
It looks like, in the commented disassembly, I talked about adjusting magic defense base and magic defense multiplier, but not magic defense percentage (which is what I thought you were talking about).

Hmm... that is what I'm talking about. The percentage is what is being used, let me check something then...

Yes, I'm not sure why it happens, but the SwordRat's AI is supposed to be Magic Evasion 8% but that's only if its Level 6 against a Level 10 Party, at Level 7 its Magic Evasion goes down to 06 and askews the entire process.

 :edit: ...Oh. I see the problem now. I feel a bit stupid, like Really stupid for not noticing this. I accidentally tied Magic Evasion base to 24 which is Magic Defense all around!  instead of 34, and I tied Magic Defense to Right Hand Quantity, yikes!

483
At least it looked like it worked to perfection in principle, but Chillyfeez your Level Up Mod also messes with Magical Evasion, which is 1/3 the basis of this hack (hence enemies use the wrong Random AI set). Is there anyway to disable the function that seems to alter Magical Evasion?

484
I expected this to take at least 80 to 100 bytes, boy was I wrong! The basic set-up has been implemented and works to perfection!  It is such a simple method that I utilized, but first the important notes...

(the current hex will lead directly into my code and I'll explain their function lateR)

Code: [Select]
$03/B557 AE C1 35 LDX $35C1  [$7E:35C1] A:0007 X:0006 Y:FFFF P:envMxdizc - Load AI Pointer into A.
$03/B55A 7B TDC A:0007 X:0780 Y:FFFF P:envMxdizc - Clear A
$03/B55B A8 TAY A:0000 X:0780 Y:FFFF P:envMxdiZc - Transfer A to Y.
$03/B55C BD 5F 40 LDA $405F,x[$7E:47DF] A:0000 X:0780 Y:0000 P:envMxdiZc - Load AI Command into A.
$03/B55F C9 FF CMP #$FF A:0076 X:0780 Y:0000 P:envMxdizc - Is it End?
$03/B561 D0 07 BNE $07    [$B56A] A:0076 X:0780 Y:0000 P:envMxdizc - If not, branch.
----------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------
$03/B56A 20 F0 FE JSR $FEF0  [$03:FEF0] A:0076 X:0780 Y:0000 P:envMxdizc - Jump to custom subroutine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
$03/FEF0 BD 5F 40 LDA $405F,x[$7E:47DF] A:0076 X:0780 Y:0000 P:envMxdizc - Load AI Command into A (used as a looping point at times)
$03/FEF3 C9 76 CMP #$76 A:0076 X:0780 Y:0000 P:envMxdizc - Is it Random AI?
$03/FEF5 D0 1C BNE $1C    [$FF13] A:0076 X:0780 Y:0000 P:envMxdiZC - If not, branch to end.
----------------------------------------------------------------------------------------------
$03/FEF7 DA PHX A:0076 X:0780 Y:0000 P:envMxdiZC - Push X (to retrieve at end of custom routine)
$03/FEF8 A2 00 00 LDX #$0000 A:0076 X:0780 Y:0000 P:envMxdiZC - Load 0000 into X.
$03/FEFB A9 03 LDA #$03 A:0076 X:0000 Y:0000 P:envMxdiZC - Load 03 into A.
$03/FEFD 20 79 83 JSR $8379  [$03:8379] A:0003 X:0000 Y:0000 P:envMxdizC - Produce a random number between 00-03.
$03/FF00 A6 A6 LDX $A6    [$00:00A6] A:0001 X:0000 Y:0000 P:envMxdizc - Load Unit Identifier into X.
$03/FF02 9D 26 20 STA $2026,x[$7E:2426] A:0001 X:0400 Y:0000 P:envMxdizc - Store Random Number in Left-Hand Quantity (unused by enemies)
$03/FF05 BD 24 20 LDA $2024,x[$7E:2424] A:0001 X:0400 Y:0000 P:envMxdizc - Load Enemy's AI Pattern number (Magical Evasion) from Right-Hand quantity
$03/FF08 0A ASL A A:0001 X:0400 Y:0000 P:envMxdizc - x2 A
$03/FF09 0A ASL A A:0002 X:0400 Y:0000 P:envMxdizc - x2 A (Four bytes comprise the random AI for each monster and this x4 gets you accurately to the Random AI for that number.
$03/FF0A 7D 26 20 ADC $2026,x[$7E:2426] A:0004 X:0400 Y:0000 P:envMxdizc - Add the random value onto A.
$03/FF0D AA TAX A:0005 X:0400 Y:0000 P:envMxdizc - Transfer A to X
$03/FF0E BF BC B8 08 LDA $08B8BC,x[$08:B8C1] A:0005 X:0005 Y:0000 P:envMxdizc - Load A from Random AI Pointers - AI 1 - Option 2.
$03/FF12 FA PLX A:0002 X:0005 Y:0000 P:envMxdizc - Pull X (to bring X to its proper reading from the start of the custom routine)
$03/FF13 60 RTS A:0002 X:0780 Y:0000 P:envMxdizc - Return to normal AI Procedure.

And that took a grand total of 23 bytes to accomplish.

So now Imps can do...



This...



That...



Or even this!



(Note: Imps are not likely getting Wall, the rest seems fair enough)


I have to give the AI some real credit, by cracking into it at such an early juncture nothing from RandomAI's default spell setting has been loaded and so everything is loaded from this random choice of four options, so the AI won't do anything stupid like casting Cure on your party or using Slow on itself and it is completely non-intrusive. It has purposely been placed over an unused move and changing what moves you want the AI to randomly use is a simple matter of taking their Magic Evasion x4 and going from there so hackers that may normally be scared away by my more complicated hacks should find this one remarkably easy to work with.


So all of the hacking is now complete! Now it's just a matter of figuring out what randomized AI I want for 100 enemies.

485
BF is the graphic for Zeromus' Full Heal attack, that's it. So while not unused, it is rather strange that they created a slot for it when i think they could have just used the initial Zeromus Elixir attack and add a graphic to it. But I know of a spell that is completely unused (aside from the two below W. Meteo) and that is DullSong, it's meant to be used in a counter script by Milon-Z but was never given to him for some reason (Rubicante also has an unused counter script) DullSong also has the added benefit of suppressing its name so no chance of "RandomAI" showing up for the player to see. That was my first attempt, but then I saw that monsters use commands differently and by the time they use a spell they don't seem to have the capacity to change what the spell will be, at least not in the same way PC's do. So that plan was out. The second plan was to use Cid's "Crash" command and tie random skills into that and though I have the code working perfectly (if they were PC's) it doesn't work the same for enemies.

So my plan is to trace back in enemy AI until I find what puts the default spell into the Spell Action byte and manipulate it from its source with a jump to custom code that checks to see if  the spell is DullSong (now called RandomAI) and if so to move forward in my custom code. I'll hopefully be able to figure this out when I get home from work today.


 :edit: And accomplished! I can easily branch it into the code which looks at the AI routine, look for the specific spell (in this case DullSong) and move off of my custom code from there, this actually might be Much cleaner than I originally anticipated! Expect some updates when I get home later tonight!

486
And I've hit another snag that I wasn't anticipating. Enemy using Commands is Nothing like characters using command. For giving a character randomized command is an absurdly simple process, here it is the opposite thereof. Enemies don't follow the same rules and may use a different matter all together to draw their next attack from, if such is the case I will need to strike at the core of the basic AI system instead of trying to treat them as semi-PC's and thinking that they can use Spells from Commands.

487
The empty spaces around the summon images should be more than enough if you can't find it anywhere else.

Thanks for the suggestion Chillyfeez, I think though that I might have just found a gigantic amount right underneath the Title Screen's graphics. Starting from 438C0 to 44000, that's more than enough, and then some. At first I thought it may have been the blackness around the title screen, but it does not appear to be.

In LoRom this is at... 08B8C0

This should really get me started then.

488
I will have to think carefully on how I want to tackle this, I have the record and the jump in data, but I tried to set up an AI pattern and came to the realization that there really is not enough room for the 64 monster types, and even if there was it would be the most inefficient means of coding ever conceived at least in a basic set up, so what I need to do is create a set of bytes that are in ROM Data for the 64 (possibly more if I have room in ROM) Randomized AI Setups.

The plan is this...

1. Look in ROM for 800 free consecutive bytes. (320 in hex)
2. Write the AI abilities into these bytes starting from Imp AI and onwards.

3. Write the routine consisting of...

Create Random Number between 0-3 - store it in Monster's Left-Handed quantity - Look at Magic Evasion - x4 it, store it in X, Add the random number in left handed quantity to X. Load ROM Address where the AI is stored +X(to get to the correct AI) -  A BEQ for 00 to allow for basic Fight command. Maybe something special for Ally Targeting commands, and that should do it.

This is much more efficient than my original plan, now I just need to find those 320 Bytes and I'll be golden.

489
^ This is also a mystery to me.  Interestingly I found this glitch completely by accident shortly after I bought the game new.  I may be old but my memory is sharp, I actually remember where in the game I was when I did it, needless to say it was odd. 

Another aspect of this is if you have exactly 256 of that item in the current item list and use -Sort- they all disappear.

I had noticed that as well. I imagine because FF is some sort of terminator in the normal coding it would cause the item to disappear. I imagine it's not included as anything more than a safeguard of sorts.

490
Is this something that's only looking at enemies' unused stat bytes?
Because ATB uses at least one (maybe more?) unused stat byte of each player character.

Indeed it uses only enemy bytes, I'll give an example of what I mean...

Imp will use Random AI set 01, so his Magic Evasion in the editor will be set to 01.

Using the info. I've recorded down on my Evasion fix...

$03/90E9   9D 22 20   STA $2022,x[$7E:22A2]   A:0001   X:0280   Y:0083   P:envMxdIzC - Store Magic Defense Multiplier into Monster's stats
$03/90EC   AD 1D 29   LDA $291D  [$7E:291D]   A:0001   X:0280   Y:0083   P:envMxdIzC - Load Magical Evasion
$03/90EF   9D 24 20   STA $2024,x[$7E:22A4]   A:0028   X:0280   Y:0083   P:envMxdIzC - Load Magical Evasion into Monster's stats (where Magical Defense Base will be)
$03/90F2   AD 1E 29   LDA $291E  [$7E:291E]   A:0028   X:0280   Y:0083   P:envMxdIzC - Load Magical Defense Base
$03/90F5   9D 24 20   STA $2024,x[$7E:22A4]   A:0009   X:0280   Y:0083   P:envMxdIzC - Store Magical Defense Base over Magical Evasion

I just change...

$03/90EF   9D 24 20   STA $2024,x[$7E:22A4]   A:0028   X:0280   Y:0083   P:envMxdIzC - Load Magical Evasion into Monster's stats (where Magical Defense Base will be)

To 9D3420 which will store Magical Evasion into Monster's Right Hand Quantity which is never looked at by the game and use that as an easy reference point for all monsters to find the AI Pattern they should be using when the routine calls for it.


 :edit: Oh, I see. You're using that byte as well, thankfully you still have that old piece of code hanging there in the jump. So I can still change it without worrying, phew I was worried there for a second.

491
So I hit my first roadblock... what I did with my Dragon Speech hack is force it to look only at the first enemy's typing. This obviously wouldn't work in randomized AI and there is no easy way to discern what monsters are Type0,1, or 2 within the stats, so after pondering the question for a while I think I'll have to do something a little different. I think I'll have to tie randomized AI to (unused) magical evasion and put it in a byte where it's not doing anything. While it sacrifices (dummied)magical evasion, I'm not too worried, since magical evasion can get rather crazy in default FFIV and in some respects its little wonder they axed it in the manner they did. This should give me full control of which enemy's will have what AI.

492
Intetesting analysis!  The only reason to really fix this is abuse if someone makes a rom hack where they want a challenge and it a very hard difficulty.  I wasn't able to fix this while working on my FF2us HardType.  :(

Funny thing about my glitch is you can only do it if the items in the menu are even horizontally.  It works with either hand but you cannot leave the R/L-hand menu and go back in during/in-the-middle of the removal.  Make sense?

Indeed, but why it happens is absolutely beyond me, I've also noticed sometimes that the item that I started with and put away would duplicate itself as well. Why this only happens when the two are lined up next to one another is so peculiar.

493
Thanks Chillyfeez! Well that's everything done with the Shadow Party, and I've increased the levels of enemies as suggested to assure they don't get too powerful, too quickly (though there is still the worry that the decrease in stats may make them too weak, but we'll see). Now it's time for me to do my part and get the randomized enemy AI up and running.

494
Ah right, a small little thing. In the event editor when you're activating or de-activating Underworld NPC's the program will think you are deactivating the Overworld PC variants. So it will put that in the text (the value is changed to the underworld equivalent unless you go back to that event instruction and access it), it's just something small I noticed.

Not sure I quite understand what you mean... example?

Hmm, say if I set the deactivated NPC to NPC 497, it will show up as Cave Eblana Soldier, which is its Overworld equivalent (-256), meaning that the editor is confusing the Underworld NPC's for only the Overworld NPC's as far as activation and deactvation goes.

495
Ah right, a small little thing. In the event editor when you're activating or de-activating Underworld NPC's the program will think you are deactivating the Overworld PC variants. So it will put that in the text (the value is changed to the underworld equivalent unless you go back to that event instruction and access it), it's just something small I noticed.