Users browsing this thread: 1 Guest(s)
Having the option to use Vigor in some spells

#11
Posts: 3,969
Threads: 279
Thanks Received: 236
Thanks Given: 57
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(04-30-2016, 09:45 PM)B-Run Wrote: The point i was getting at on-stream was that you could write any number of damage calculations using any number of variables and assign them to free bits in the spell variables

I can make his vigor formula optional, there's no problem there. Thanks for the idea!
  Find
Quote  

#12
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
Hey, I JUST finished work on something like this and am playtesting it right now. It works, I'm just playtesting to adjust the damage of weapons and physical spells since it's obviously much higher now.

The Great Physical and Magical damage formula Equalizer EDIT: Update: fixed a bug and cleaned up the code.
Code:
;Physical Damage Formula Overhaul
;Author: Seibaby

;What this patch does:
;1. Equalizes the damage formulas for characters and monsters.
;2. Equalizes the formulas for physical and magical damage:
;   Magical damage = 4 * Spell Power + [Level * Magic * Spell Power / 32]
;   Physical damage = 4 * Battle Power + [Level * Magic * Battle Power / 32]

;Notes:
;1. This makes Vigor and Battle Power MUCH more powerful than in vanilla.
;2. It makes the damage of physical abilites scale linearly with level instead
;   of quadratically, meaning they don't retain their competitiveness with
;   stronger spells as level at higher levels.
;3. You probably want to adjust Battle Power for weapons and physical abilities
;   since they are insanely high compared to Magic. Ex. Ultima is 150 power
;   while Illumina is 255 power.
;4. This patch is not compatible with Leet Sketcher's Ultimate Damage fix.


hirom             ;Do not change this
;header            ;Uncomment this if your ROM has a header

org $C22890
NOP #2            ;Skip doubling Vigor for characters:

org $C22BA7
BRA skip1:
org $C22BAD
skip1:            ;Skip unnecessary stuff

org $C22BB3
BRA skip2         ;Skip quadrupling battle power for monsters:
org $C22BB9
skip2:

org $C22BCE
STA $11A6         ;Make sure Gauntlet still works
SEP #$20          ;Make game not crash :)
BRA skip3         ;Skip unnecessary stuff
org $C22BE7
skip3:
JSR $2B69         ;Discard physical damage formula, call magic formula instead
REP #$20

org $C22BF0      
REP #$20          ;Set 16-bit accumulator, since C2/2B69 sets it to 8-bit
BRA skip4         ;Skip (Damage = Damage * 3/2 + Battle Power) for characters
org $C22C02
skip4:


;Optional extras:

;org $C22D64
;ADC $3B40,Y       ;Set monster Vigor to Monster's Stamina + [1..8]

;org $C22CE9
;NOP               ;Increase the cap on monster Stamina to 96
;CMP #$50          ;(Monster Stamina = (Max HP / 256) + 16. If this number is
;BCC cont2         ; greater than 96, then the monster's stamina is set to 96.)
;LDA #$4F
;org $C22CF0
;cont2:

;Pick ONE of the following two:
;org $C20F3A      
;LSR               ;Hyper Wrist boosts Vigor by 25% instead of 50% (rounded UP)
                  ;(NOTE: not compatible with Assassin's Genji Glove damage
                  ;reduction fix)

;org $C20F3F       ;Hyper Wrist boosts Vigor by 25% instead of 50% (rounded UP)
;LSR               ;(NOTE: compatible with Assassin's Genji Glove damage
                  ; reduction fix. Apply this AFTER applying that one or it
                  ; will just overwrite this)

;Pick ONE of the following two:
;org $C22BC7
;NOP #4            ;Gauntlet increases battle power by 50% instead of 75%

;org $C22BC4
;LSR               ;Gauntlet increases Battle Power by 62.5% instead of 75%


;For testing:

;org $C233FE
;db $80            ;No criticals

;org $C20CB3
;LDA #$FF          ;Disable random damage variance

This has some extra stuff in it that I feel makes sense/is neat, overall it is a complete rebalance of Vigor.
You absolutely need to severely decrease the Battle Power of weapons/characters and Spell Power of Physical spells since they're balanced for the crappy physical formula.

Also, @Kugawattan, here's how to make physical Blitzes and Swdtechs Row-dependent:

Code:
;Halve damage for physical Blitzes and Swdtechs

hirom
;header

;Blitz
org $C215C2
JSR rowblitz

;Swdtech
org $C21854
JSR rowblitz

org $C2A75A ; change this to free space
rowblitz:
JSR $2951      ;(Load Magic Power / Vigor and Level)
LDA $11A2
BIT #$01
BEQ exit       ;(Exit if magical damage)
LDA #$20
TRB $B3
exit:
RTS

EDIT: I just spotted a way to shrink the rowblitz code, I think. Am I correct in thinking BIT #$01 / BEQ could be shrunk to LSR / BCC?
  Find
Quote  
[-] The following 1 user says Thank You to seibaby for this post:
  • madsiur (05-01-2016)

#13
Posts: 3,969
Threads: 279
Thanks Received: 236
Thanks Given: 57
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Seibaby code is a really nice tweak but I'm posting a different though more basic tweak. It's not a contest between both codes because they aren't doing the same thing. Basically I use bit 7 of the special byte 3 ($11A7) of the spell data to implement vigor in magic damage calculation (see image). There two possible scenarios:

1) "Physical Damage" and "Special byte 3 bit 7" are checked: Spell use the magic damage formula and replace magic power with vigor. The spell is treated as physical for the rest (damage reduction, relic effects, etc...).

2) "Physical Damage" is unchecked and "Special byte 3 bit 7" is checked: Spell use the magic damage formula and replace magic power with vigor. The spell is treated as magical for the rest (damage reduction, relic effects, etc...).

For a "regular" magical or physical damage, simply ignore Special byte 3 bit 7.

The following is a bank $C2 implementation. If you plan on using this and want it in another bank, the code need modification. I had to include a decent chunk of vanilla code in the file because there was no moment I could call my first JSR properly.

Code:
hirom       ;do not touch this
;header     ;uncomment if ROM has a header

org $C22B9D
LDA $11A7   ;load special byte 3 of spell data
BMI spcPhy  ;if bit 7 set, jump to magic damage calculation
LDA $11A2   ;load regular physical attack byte
LSR
BCS regPhy  ;branch if regular physical attack
spcPhy:
JMP $2B69   ;magic damage calculation
regPhy:
PHP
LDA $11AF
PHA
JSR sbrA    ;we need room

org $C22B7F
JSR sbrB    ;hijack magic damage formula

org $C26469 ;Change this to a spot you got room in bank $C2
sbrA:       ;Original code that needed to be moved because lack of space.
STA $E8
TDC
LDA $11A6
REP #$20
RTS

sbrB:
LDA $11A7   ;load special byte 3 of spell data
BMI useVig  ;if bit 7 is set, use Stamina
LDA $11AE   ;magic power
RTS
useVig:
LDA $3B2C,X ;It seems X and Y already contain battle position * 2.
            ;Getting then character vigor is easy. Tested with Terra, Vicks, Wedge.
CPX #$08
BCS mons
LSR         ;$3B2C hold vigor * 2 for characters
mons:
RTS
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Gi Nattak (05-03-2016)

#14
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Good work, both of you. I'm thankful for your effort at helping me.
I'm also a bit dense today. seibaby, how worse is the "level scaling" you mention ("It also makes physical abilites scale much worse with level, obviously.")? How much stronger would an attack made by a level 50 character with the same vigor and battle power than one of level 10? I don't remember what the scale was with vanilla, but for monsters (that have their vigor set randomly) being at a much higher level results in much, much more damage.

Madsiur, you mention stamina multiple times in your post...you do know I said "Use Vigor instead of Magic"? Or is stamina coded for Vigor? Maybe I'm missing something completely.

I'll thorougly playtest both and pick whichever suits me more...I'll let you guys know.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#15
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
(05-01-2016, 06:32 PM)Kugawattan Wrote: how worse is the "level scaling" you mention ("It also makes physical abilites scale much worse with level, obviously.")? How much stronger would an attack made by a level 50 character with the same vigor and battle power than one of level 10?

Vigor and Battle Power has very little effect compared to Level in vanilla. Since one of the terms in the formula is Level * Level, you can see that damage scales pretty much quadratically, while Battle Power and Vigor don't have a big effect. In other words, even a weak weapon or physical ability will do a lot of damage if your level is high.

The magical damage formula is much more egalitarian with regards to stats; damage scales linearly with each stat. Even on a low level, a character with high magic can do a lot of damage with a strong spell. In other words, Magic and Spell Power have a much bigger effect. And, with my hack, Vigor and Battle Power do as well.

From Terii's algorithms FAQ:
Code:
For magical attacks made by characters:
Damage = Spell Power * 4 + (Level * Magic Power * Spell Power / 32)

For magical attacks made by monsters:
Damage = Spell Power * 4 + (Level * (Magic Power * 3/2) * Spell Power / 32)

For physical attacks made by characters:
Damage = Battle Power + ((Level * Level * (Battle Power + Vigor * 2)) / 256) * 3 / 2 

For physical attacks made by monsters:
Damage = Level * Level * (Battle Power * 4 + Vigor) / 256

My hack makes both characters and monsters use the same formula for damage:
Code:
Magical Damage = Spell Power * 4 + (Level * Magic * Spell Power / 32)
Physical Damage = Battle Power * 4 + (Level * Vigor * Battle Power / 32)
Note that in vanilla, monster Vigor was randomly distributed between 56..63. With my hack, Monsters can have between 17 and 96 Vigor depending on their Max HP (it randomly varies a little bit).
  Find
Quote  
[-] The following 1 user says Thank You to seibaby for this post:
  • Gi Nattak (05-03-2016)

#16
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Oh, okay then, that sounds really awesome. Have you tested the "physical damage" box on the spell list in usME? I'm assuming they will take the physical damage formula, but since yours it's the same of the magic one, it overall works as if it was using the Vigor valor instead of Magic's.
I'm still not sure how does it work in vanilla that function as a whole.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#17
Posts: 3,969
Threads: 279
Thanks Received: 236
Thanks Given: 57
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(05-01-2016, 06:32 PM)Kugawattan Wrote: Madsiur, you mention stamina multiple times in your post...you do know I said "Use Vigor instead of Magic"? Or is stamina coded for Vigor? Maybe I'm missing something completely.

I'm the one who misread your post. I edited my code to use vigor. Note that my code only switch magic power for vigor in the maximum damage calculation in magic damage routine (C2/2B69) given you check the checkbox mentioned in previous post. You are right, monster vigor is a random number between 56-63. Since the in battle vigor value in $3B2C is vigor * 2 for characters, my code halves that value to reflect the real character vigor but does not alter the monster vigor.
  Find
Quote  

#18
Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 158
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
Nice work fellas! I'm wondering, would removing just the level scaling aspect help out the Vigor stat become important, as well as weapons/battle power? Or would that then make physical attacks too weak in general without switching the physical damage formula over to the magic one such as this patch does?
Quote  

#19
Posts: 110
Threads: 4
Thanks Received: 4
Thanks Given: 1
Joined: Jan 2012
Reputation: 4
Status
None
just removing level scaling would cause other problems, i believe. vigor's influence is just not dramatic.
  Find
Quote  

#20
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
(05-01-2016, 07:59 PM)Kugawattan Wrote: Oh, okay then, that sounds really awesome. Have you tested the "physical damage" box on the spell list in usME? I'm assuming they will take the physical damage formula, but since yours it's the same of the magic one, it overall works as if it was using the Vigor valor instead of Magic's.
I'm still not sure how does it work in vanilla that function as a whole.

Yes, spells that have the "Physical damage" bit checked will use the physical damage formula. Have a look in the spell editor in FF3usME. Physical damage is a spell property used by a few spells: Pummel, Suplex, Dispatch, Slash, Quadra Slam, Quadra Slice and Tentacle. Battle and Special are technically spells and also have the physical attribute set.

The physical property is set for certain Item usage as well, like (some) Tools or Thrown weapons. All other abilities use the magical damage formula unless they have some special way of calculating damage. Whether an attack is physical or magical affects which damage formula they will use, and how their damage is modified. For example, magical attacks are modified by Mdef. Shell, and Morph, while physical attacks are modified by Defense, Safe, Row and Defend. Which means that, if an attack ignores defense, the only difference is the damage formula used.

One important difference of the damage formulas is which stat they use to calculate damage: physical attacks use Vigor, and magical attacks use Magic. Battle Power and Spell power are just two different names for the same stat: the power of the weapon/spell used. In vanilla, the formulas are different. With my hack, the only difference is whether Vigor or Magic gets used. 

So yes, if you're using my hack, you may think of the "Physical damage" checkbox in FF3usME as a "use Vigor" checkbox.
  Find
Quote  
[-] The following 1 user says Thank You to seibaby for this post:
  • Kugawattan (05-02-2016)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite