Users browsing this thread: 1 Guest(s)
Patch: Selectable Script

#1
Posts: 141
Threads: 19
Thanks Received: 97
Thanks Given: 4
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Path:   Selectable Script 1.0
Target: Final fantasy 3, Version 1.0, English
Download

I want to share a patch i make. Perhaps, It can be helpful for a hacker.

Description:

In the original game, the enemy actions are determined by a script. In special cases, the enemy script is ignored and a random action is selected for the monster from its control list of commands. Common examples are the muddle status and Colosseum fights.

The patch changes the selection between the monster script and the control list. When the 'special event' flag is set in the monster database, the monster will use its script. Otherwise, it will use its control list instead.

The advantage of this patch is to reduce the script size. Common enemies, without the need of advanced scripts, can be set to use its control list. Because of it, the enemy script can be fully emptied. The free bytes can be used by another monsters scripts.

Unlike the original game, the monsters in the Colosseum battles can also use its monster script. It allows for better customization of the monsters behavior in duels.

With this patch, the 'special event' flag must be revised for all monsters in the database. The original setting may not be correct for this new approach. In special, pseudo enemies which actually triggers a cinematic event or special code must always have the 'special event' flag set.

As a note, the berserk and muddle status will always force the monster to ignore its script, independently of the 'special event' flag. Also, monsters actually have two imbued scripts. One for its turn and another for a counter. The counter script will always be executed, independently of the 'special event' flag.

Code:
header
hirom

;----------------------------------------------------------------------------------------
;--     addresses
;----------------------------------------------------------------------------------------
org     $C20134
        case_control:
org     $C20139
        case_script:

;----------------------------------------------------------------------------------------
;--     select monster action
;----------------------------------------------------------------------------------------
org     $C20123

;--     check special event flag
        LDA $3C80,X                     ;special flags
        BIT #$40                        ;special event flag
        BEQ case_control                ;to use action from control list
        
;--     check berserk/muddle status
        LDA $3EE5,X                     ;status
        BIT #$30                        ;berserk, muddle
        BEQ case_script                 ;to use action from monster script
        BRA case_control                ;to use action from control list
        NOP

warnpc  $C20134
  Find
Quote  
[-] The following 1 user says Thank You to HatZen08 for this post:
  • Gi Nattak (01-11-2016)

#2
Posts: 11
Threads: 3
Thanks Received: 0
Thanks Given: 6
Joined: Dec 2015
Status
Null-All
Question: what benefit when patch this and is there a bad effect?Also is this use the patch in headered FFIII 1.0 rom?
and please don't say this word "figured out yourself", "I can't tell".
  Find
Quote  

#3
Posts: 2,231
Threads: 90
Thanks Received: 263
Thanks Given: 268
Joined: Aug 2009
Reputation: 40
Status
Nattak\'d
He explained the benefit: to reduce the monster AI script size, and in my opinion more importantly allow for better customization of the monsters behavior in Colosseum battles by having it read from their main script.

And I'm not sure why you might think Hatzen would tell you to figure it out yourself lol, he is a very nice fellow. Perhaps you've had responses from others in the past like that?

I'm going to assume the patch is for a headered ROM, due to the asm file being set up for a header.


We are born, live, die and then do the same thing over again.
Quote  

#4
Posts: 11
Threads: 3
Thanks Received: 0
Thanks Given: 6
Joined: Dec 2015
Status
Null-All
(01-11-2016, 05:58 AM)Gi Nattak Wrote: He explained the benefit: to reduce the monster AI script size, and in my opinion more importantly allow for better customization of the monsters behavior in Colosseum battles by having it read from their main script.

And I'm not sure why you might think Hatzen would tell you to figure it out yourself lol, he is a very nice fellow. Perhaps you've had responses from others in the past like that?

I'm going to assume the patch is for a headered ROM, due to the asm file being set up for a header.

@Gi Nattak Sir I'm not talking about Hatzen I know he's a nice pesron I say this cuz I know one of our fellow will answer that word and for me those word a rude.....Anyways change topic.

OMG! that's good I didn't know that it can customizing monster's behavior and also can change item bet.....

I see so he using a Headered Roms....Anyways thank you Gi Nattak to explain clearly about this great patch I gonna try now....
  Find
Quote  

#5
Posts: 141
Threads: 19
Thanks Received: 97
Thanks Given: 4
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Yes, the patch is aimed at a rom with a header. I forgot to add it in the description.

As it was explained, the advantage is to reduce the script size and to allow a better customization for the Colosseum battles.

As example, let's suppose you have a monster with the following spells in its control list: fire, ice, bolt and poison. In the original game, you are forced to write a script for the monster. Otherwise, the monster does nothing in battle. The monster script can be something like this: (in pseudo code, i don't remember their hex values)
Code:
select random: fire, ice, bolt
wait for next turn
select random: poison, fire, ice
wait for next turn
select random: bolt, poison, fire
wait for next turn
select random: ice, bolt, poison
end turn script
end counter script

You actually waste script bytes to choose one of the spells in the control list. With this patch, you only need to reset/clear/unset the 'script event' flag and erase the monster script. The bytes can be used by another monster script. Of course, it is only relevant if you need more space for monster scripts.

I personally enjoy the fact that i are not forced anymore to write a script for a monster. I can only setup its control list, erase its script and clear the 'script event' flag. It may not be apparent, but it saves a lot of energy and time. There are three digits of monster in this game. How many time, effort and patience you need to rewrite all their battle scripts? Manually inserting all bytes or instructions, one by one? With this patch, with the exception of a few monsters with hard coded features, to write a full monster script is optional.

Unfortunately, you must revise all 'script event' flags for all monsters in the game. It can't be helped, you manually need to setup the monsters to choose between the control list or its script. However, i believe it is easier than rewriting all scripts for all monsters in the game.
  Find
Quote  

#6
Posts: 600
Threads: 34
Thanks Received: 41
Thanks Given: 27
Joined: Jan 2015
Reputation: 11
Status
Dead
I've never touched monster scripts so bear withme on the possible idiocracy of this question...

Do I understand that correctly about it going to the control list (and abandoning the monster script if it has one) while muddled/berzerk state? Does vanila do that anyway? Never really understood what something like muddle did to a monster normally (other than random the battle target between ally and enemies.)

In other words, am I correct in saying if using this, and monsters did have scripts, they would actually abandon the pseudo "intelligence" of a script for a random choice from a limited menu while confused?

Or am I lost and the game does that anyway?


The only true wisdom is knowing you know nothing.
  Find
Quote  

#7
Posts: 141
Threads: 19
Thanks Received: 97
Thanks Given: 4
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Quote:In other words, am I correct in saying if using this, and monsters did have scripts, they would actually abandon the pseudo "intelligence" of a script for a random choice from a limited menu while confused? 

Yes, the muddle status actually forces the monster to ignore its script. While confused, it will do a random action based on its control list. It is the default behavior in the vanilla game. In the original game, I was always surprised that a confused monster mysteriously acquired news actions. It is because its actions between the control list and its script are different.

The berserk status also will force the monster to ignore its script. It will always do a fight command.

Only the turn script will be ignored when muddle/berserk. The counter script, however, will always be executed.
  Find
Quote  

#8
Posts: 1,632
Threads: 56
Thanks Received: 49
Thanks Given: 133
Joined: Apr 2014
Reputation: 12
Status
Atma
Interesting script...

Hey HatZen, i'm assuming you know the answer to this one, since you did this patch:
Do you know what exactly does 'special event' flag among monster stats?
I never figured it out... does it actually have an effect in an untouched rom?


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  

#9
Posts: 3,674
Threads: 267
Thanks Received: 701
Thanks Given: 300
Joined: Oct 2011
Reputation: 60
Status
Faith
Thread moved when it belongs. Nice work Hatzen08!
  Find
Quote  

#10
Posts: 141
Threads: 19
Thanks Received: 97
Thanks Given: 4
Joined: Dec 2013
Reputation: 9
Status
Auto-life
Quote:Do you know what exactly does 'special event' flag among monster stats?

Nothing, or i believe so. I fond no difference in behavior with this flag, be it set or unset, in the original rom. It probably had a design in the early stages of the game, but it looks like the flag is not used anymore for the original rom.
  Find
Quote  
[-] The following 1 user says Thank You to HatZen08 for this post:
  • Tenkarider (01-12-2016)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite