Users browsing this thread: 1 Guest(s)
Monster AI Upgrade patch

#1
Posts: 759
Threads: 83
Thanks Received: 113
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
The Monster AI Upgrade Patch is here!
author: B-Run
version: 0.92
released on: 2016/03/12
Download


This patch significantly increases the functionality of the monster AI capabilities as well as applies the 24-bit monster HP patch. With this you can now make your bosses and mobs much more dynamic in their decision-making process. Here is a quick rundown of the features.

General Mechanic changes:
  • 24-bit monster HP patch by cklein0001 (bugfixed by myself)
  • ignore 50%,25%,12.5%,6.25% defense (independently selectable)

Script changes:
  • target front row
  • target back row
  • target highest HP
  • target lowest HP
  • target none (only works if the party or monsters have invalid targets)
  • change music
  • change background
  • enable/disable Fanatics / setup morph timer (long/short/permanent)
  • check status (major update including checking for stances like Row/Defend, and relic effects like Offering/True Knight, and elemental weaknesses, resistances, etc...)
  • if under or equal to high hp byte (for 24-bit monster HP)
  • Quick Detect
  • Script Branch bytes (used for "end-if and continue", else, looping, etc...)

Unfortunately, I never made the additional changes I has purposed to do after realeasing the Titan EX boss. But I did add the elemental check to the status update, and tweak a few things.

Included with the patch is a list of the changes, both the disassembly and the hex... as well as the parameters for a few of the specifics. I left a bit of space at the end of each of the moved pointer lists for additional upgrades should you feel ambitious enough to add to the patch yourself. I apologize that the dissasembly isn't as annotated as I would have liked; but at least it has the code locations and hex alongside.

A few notes:
-The patch uses 96 empty bytes in C0 (C0/D613-C0/D672) and 375 bytes in C2 (C2/FFF6-C2/FC6C). Adaptations should be done separate from the patch using my notes and included hex.

-"Enable/Disable Fantatics / Morph timer setup" is a very specific function with only a few options. Fanatics is enabled with bit 0, and the long morph timer (obtained after obtaining Terra in the WoB) is set with bit 1... any higher bits activated make Morph automatic and permanent.

-The Script Branch function branches forward with values of 00-7F and backward from 80-FF, starting from the last byte in the command (just like coding in hex). Branching backwards can very easily become a bad idea and lead to permanent loops because changes to variables don't always apply right away so what you might think would cause it to branch away or fail an "if" may not. This is most useful for branching past an "end-if and continue"

-Here is an updated list of things the status check can look for and their values:
Code:
21 = Defend,
22 = prot. from death,
24 = seized?
25 = Row [1 = back row]
26 = controlled?
27 = ran away?
30 = Atlas Armlet,
31 = Double Earrings,
37 = Jump Continuously)
38 = Sneak Ring,
39 = Earring,
3A = Increase sketch chance,
3B = Increase Control chance,
3C = Sniper Sight,
3D = Gold Hairpin,
3E = Economizer,
3F = Hyper Wrist)
40 = Offering,
41 = Black Belt,
42 = Beads,
43 = Gauntlet,
44 = Genji Glove
45 = Merit Award,
46 = True Knight
48 = Shell when low HP,
49 = Safe when low HP,
4A = Reflect when low HP,
4B = Exp. Egg,
4C = x2 Gold,
4F = Relic Ring
50 = Absorbs Fire
51 = Absorbs Ice
52 = Absorbs Bolt
53 = Absorbs Poison
54 = Absorbs Wind
55 = Absorbs Pearl
56 = Absorbs Earth
57 = Absorbs Water
58 = Nullifies Fire
59 = Nullifies Ice
5A = Nullifies Bolt
5B = Nullifies Poison
5C = Nullifies Wind
5D = Nullifies Pearl
5E = Nullifies Earth
5F = Nullifies Water
60 = Weak to Fire
61 = Weak to Ice
62 = Weak to Bolt
63 = Weak to Poison
64 = Weak to Wind
65 = Weak to Pearl
66 = Weak to Earth
67 = Weak to Water
68 = Resists Fire
69 = Resists Ice
6A = Resists Bolt
6B = Resists Poison
6C = Resists Wind
6D = Resists Pearl
6E = Resists Earth
6F = Resists Water

This function was updated from the Titan EX script, so don't use it as a template. TBH, the new code for this hasn't been checked. So I wouldn't be surprised if its bugged, however it shouldn't be too far off and should be fixable with my notes and a decent ASM coder.

-The patch hasn't been fully tested, and I apologize in advance for any bugs that may still exist or any errors in my documentation. Unfortunately, I will not be bug-fixing this and each of you should take the initiative to learn how to manipulate the code yourself. It's the only way to make something truly your own!

Happy Hacking!
  Find
Quote  
[-] The following 6 users say Thank You to B-Run for this post:
  • Cyprus (08-29-2014), Gi Nattak (09-18-2016), marcioseufi (07-05-2019), Robo Jesus (05-03-2015), SSJ Rick (08-29-2014), Tenkarider (08-28-2014)

#2
Posts: 1,630
Threads: 56
Thanks Received: 48
Thanks Given: 129
Joined: Apr 2014
Reputation: 12
Status
Stop
Priceless.


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#3
Posts: 324
Threads: 25
Thanks Received: 14
Thanks Given: 15
Joined: Oct 2013
Reputation: 2
Status
X-Zone
Wow, this is Amazing.


Shine 
  Find
Quote  

#4
Posts: 47
Threads: 7
Thanks Received: 5
Thanks Given: 5
Joined: Aug 2014
Status
None
Wow finally we are use this patch.BTW what FF3/6 Roms use this NoHeader or Header?and what are the codes of the monster?
  Find
Quote  

#5
Posts: 3,647
Threads: 266
Thanks Received: 691
Thanks Given: 282
Joined: Oct 2011
Reputation: 60
Status
Faith
I moved this nice thread in the IPS patches sub forum. For your info, patches since a few weeks need to be approved by an admin to be in this sub-forum. This is for quality reasons. We haven't come up with an approval form or method, but we will do in a near future. In the meantime, you guys can always post a thread in hacking discussion and ask for the thread to be moved.
  Find
Quote  

#6
Posts: 1,630
Threads: 56
Thanks Received: 48
Thanks Given: 129
Joined: Apr 2014
Reputation: 12
Status
Stop
I tested some of his new commands, but i realized that something is wrong:
commands FC 08 and FC 09 (if status is set/not set)
will make crash the game, both normal statuses like zombie, dark...
and new statuses like defend, offering, etc...
Since the others FC commands looks like they are working properly,
i believe there's a matter about statuses... maybe they're relocated in a wrong position, or something?
Does anyone else tested the patch and knows something i don't know?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#7
Posts: 759
Threads: 83
Thanks Received: 113
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
Updated and working.
  Find
Quote  

#8
Posts: 241
Threads: 18
Thanks Received: 101
Thanks Given: 41
Joined: Mar 2014
Reputation: 8
Status
None
This thing is amazing. So glad it works now. Does this update mean you intend to continue work on this one?

If so, I have some suggestions. It would open up for some interesting possibilities if a monster could have knowledge of who attacked them.

This could take the form of duplicates of FC commands 01-05, that accepts a targetting byte as the second byte. It would essentially mean "if Hit by (target) with (attack):". Or even better: "If Targeted by (target) with (attack):", in case the attack misses.

Furthermore, it would be very useful if monsters could respond to things that happen to other entities on the battlefield, i.e. another ten FC commands that state "If (target) Targetted Anyone with (attack):" and "If (target) was Targetted by (target):".

This could open up for monsters keeping track of character actions over time, using variables. A monster could, for example, keep track of who attacked it most often, and target him, or keep track of characters healing others, and target them.

Code:
FC    "If" statement...                  Attacker  Attack
        Self Targeted By Command     20  (Target)  (Command)
        Self Targeted By Spell       21  (Target)  (Spell)
        Self Targeted By Item        22  (Target)  (Item)
        Self Targeted By Element     23  (Target)  (Element[s])
        Self Targeted By Anything    24  (Target)  00

                                         Attacker  Attack
        Target Targeted by Command   25  (Target)  (Command)
        Target Targeted by Spell     26  (Target)  (Spell)
        Target Targeted by Item      27  (Target)  (Item)
        Target Targeted by Element   28  (Target)  (Element[s])
        Target Targeted by Anything  29  (Target)  00        
        
                                         Attacker  Target
        Command Was Used             2A  (Target)  (Target)
        Spell Was Used               2B  (Target)  (Target)
        Item Was Used                2C  (Target)  (Target)
        Element Was Used             2D  (Target)  (Target)
        Anything *                   2F  (Target)  (Target)
        
        * Anything available via command Menu.
         (Exclude special commands like periodical damage, status removals,
         Condemned summoning the Reaper, Scan, enemy formation change, etc.
         I.e. only include commands $00 - $1D)
          
  Find
Quote  

#9
Posts: 759
Threads: 83
Thanks Received: 113
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
That's a good idea... I need to look at how long the attacker data sticks around, it may be cleared by the time the counter script runs, which would mean I would need to add a temporary variable to keep track of that sort of thing until the script can make use of it... But it would definitely make for some interesting encounters.
  Find
Quote  

#10
Posts: 241
Threads: 18
Thanks Received: 101
Thanks Given: 41
Joined: Mar 2014
Reputation: 8
Status
None
(05-10-2016, 02:03 PM)B-Run Wrote: That's a good idea... I need to look at how long the attacker data sticks around, it may be cleared by the time the counter script runs, which would mean I would need to add a temporary variable to keep track of that sort of thing until the script can make use of it... But it would definitely make for some interesting encounters.

One thing I forgot to mention: something that would be incredibly useful with these extensions is a command for calling or including another monster's command script, sort of like a JSR. With that, you could set up a standard function like the example I described above and have all monsters use it, without replicating it in each of their AI scripts.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite