• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Completed Physics, Input, etc Display in Develop Mode

Magus420

Smash Master
Joined
Dec 13, 2003
Messages
4,541
Location
Close to Trenton, NJ Posts: 4,071
Made a code that can display various character and controller data in develop mode. The TopN setting also allows setting the character's position to the center of the stage to make measuring stuff easier.


Controls

X->DPad-Right - Cycle through enabling the display, switching through displaying players 1-4, and disabling it.
L->DPad-Right/Left - Change the pair of floats to highlight/modify the setting for. Shares the Pokemon setting which starts at 0 (Random) by default, and 1-3 are the float pairs (Tosakinto, Chikorita, Kabigon). While a pair is selected/highlighted, L->DPad-Up/Down will change what data is shown in them.
L->DPad-Up/Down - Change the data to display in the selected float pair. Shares the Item setting (replacing their names for the descriptions).
DPad-Down (with a TopN setting highlighted) - If Top-N is the setting on a selected float pair, this will set their position to 0,0 (on FD, that'll be the very center of the stage).
A->DPad-Down (with a TopN setting highlighted) - If Top-N is the setting on a selected float pair, this will set their position to 0,100. Useful if looking at an air move that'd have them land if 0,0 were used.


Settings

"Top-N" - The X/Y position of the base point of the character. With collision display enabled it's where the white '+' is at the bottom of the character. EXTRA FEATURE: If a Top-N setting is highlighted (yellow) by using L->DPad-Right/Left, pressing DPad-Down sets the character to a position of 0,0. A->DPad-Down sets them to a position of 0,100.
"ECB Top" - The X/Y offset from Top-N of the Top point of the character's environment collision box that's used for ceiling collisions.
"ECB Bottom" - The X/Y offset from Top-N of the Bottom point of the character's environment collision box that's used for floor collisions.
"ECB Right" - The X/Y offset from Top-N of the Right point of the character's environment collision box that's used for left wall collisions and pushing against other characters on the ground.
"ECB Left" - The X/Y offset from Top-N of the Left point of the character's environment collision box that's used for right wall collisions and pushing against other characters on the ground.

"F1 Ch Veloc" - Force 1: Character Velocity. One of 3 X/Y forces applied to characters that result in their total movement each frame. This force is generally stuff that is a result of your own character's actions and includes things like dashing, air mobility, fallspeed, air dodge, and animation based movement. Also includes shield pushback when someone hits your shield (Defending).
"F2 KB Veloc" - Force 2: Knockback Velocity. Knockback from getting hit/thrown.
"F3 Sh Veloc" - Force 3: Attacker Shield KB Velocity. IIRC I've only seen this force used for shield pushback when hitting someone else's shield (Attacking).
"Total Veloc" - Total Velocity. This is the combination of all forces and the end result you'll move by each frame.

"Sys Directi" - Directional X/Y Input from the player's controller port. This is the input at the system level and not inputs applied to their character, so it's 'live' while the game is stopped in frame advance. Helpful for getting a full 1/-1 (game is picky about full directional inputs) or a specific amount of input applied to the character since you can adjust as needed before advancing the frame.
"Sys C-Stick" - C-Stick X/Y Input from the player's controller port.
"Sys L/R" - Analog L/R Input from the player's controller port.

"Cur Directi" - Directional X/Y Input applied to the character on the current frame.
"Prv Directi" - Directional X/Y Input applied to the character on the previous frame.
"CrPr Shield" - Current and Previous Variable Shield Input.

"Tmr Any Shd" - Frames Since Any Shield Press. Used for things like l-canceling.
"Tmr Dig Shd" - Frames Since & Between Digital Shield Press. Tech window (<20 since) and Tech-fail (>=40 between) for example.
"Tmr Jump" - Frames Since & Between Jump Inputs. Includes tap jumps. Meteor canceling.
"Tmr Up-B" - Frames Since & Between Up-B Inputs. Meteor canceling.

"Dmg/Hitlag" - Total Damage, and Hitlag. Damage would probably be more useful if stale moves were enabled, though chargeable moves like smashes do non-integer damage in develop. Attacker/Victim hitlag remaining.
"HitStn/Grab" - Hitstun, and Grab Hold Time. Frames of hitstun remaining. Time remaining before able to break out of a grab. Fun Fact: The losing player breaks out of grabs slightly faster than a winning player (wut).
"ShieldStun" - Actual shieldstun remaining, and originally calculated shieldstun. The difference comes from the game adding 0.1 to the animation length (20) when calculating the GuardDamage animation speed (and l-canceling) to create the stun time, though it sometimes results in 1 frame shorter stun than calculated (notably 20 damage on full strength shield).
"Shd HP/Size" - Shield Health, and Shield Collision Size. Shields have a max health of 60. The powershield reflect collision is 0.75x the size of the main shield collision shown.
"Tmr Int/Inv" - Timed Intangibility & Invincibility. Ledgegrabs and walljumps use the former, and respawning the latter.

"HB-0 X/Y" - Hitbox ID [0]'s X/Y Position. You can see the hitbox ID in MasterHand.
"HB-0 Z/Size" - Hitbox ID [0]'s Z Position & Size (radius). If the character is at 0,0 adding the Size to the X/Y/Z gives you the range of the hitbox.
"HB-1 X/Y" - Hitbox ID [1]'s X/Y Position.
"HB-1 Z/Size" - Hitbox ID [1]'s Z Position & Size (radius).
"HB-2 X/Y" - Hitbox ID [2]'s X/Y Position.
"HB-2 Z/Size" - Hitbox ID [2]'s Z Position & Size (radius).
"HB-3 X/Y" - Hitbox ID [3]'s X/Y Position.
"HB-3 Z/Size" - Hitbox ID [3]'s Z Position & Size (radius).


GIFs of Controls & Features







Physics, Input, etc Display in Develop Mode v2.0 (NTSC 1.00) [Magus]
C21A3CE8 00000008
3D808042 618C7940
894C0000 394A0001
2C0A0005 41A00008
39400000 994C0000
41A0001C 3D808016
618C4BC0 7D8803A6
4E800021 38000000
900DB088 00000000
061A3CEC 00000008
60000000 60000000
061A3E70 0000000C
3C608042 38637940
80630004 00000000
C2224D70 00000005
2C000001 41A0001C
2C000003 41A10014
3D408042 614A7947
7D2A00AE 913F0060
90040000 00000000
C2224DA8 00000005
2C000001 41A0001C
2C000003 41A10014
3D408042 614A7947
7D2A00AE 913F0060
90040000 00000000
C2390D68 00000079
9421FFC8 BE810008
3FE08042 63FF7940
8BDF0000 2C1E0001
4180000C 2C1E0004
40A10008 3BC00001
9BDF0000 1E9E2B67
929F0004 829F0008
2C140000 40A20010
3E801419 62941D00
929F0008 3A803030
3AA06666 3EC06666
62D63030 3FA08040
63BD84DE B2BD001C
B2BD0020 B2BD002E
B29D0038 92DD003A
B29D0046 92DD0048
92DD0054 B2BD0058
92DD0062 B2BD0066
3BFF0007 3F808049
639CD978 837C0004
2C1B0001 41A00034
2C1B0003 41A1002C
831C0000 7F1FD9AE
1EFB001C 3B17000E
7EBDBB2E 7EBDC32E
3AF70002 3B180002
7EDDB92E 7EDDC12E
3A800000 92820018
7C5A1378 3B200001
3FA0804D 63BD56A8
1EBEFFFC 7FBDA82E
83BD0020 6294FFFF
A2BD0006 7C15A000
4182027C 7F1FC8AE
82FD0070 2C180014
41820064 41800268
2C180018 408100B0
2C18001C 408100B4
2C18001F 408100EC
2C180022 40810108
2C18002E 40810114
2C1800D0 4182013C
2C1800D1 41820140
2C1800D2 41820154
2C1800D3 41820178
2C1800D4 41820190
2C1800DC 40810194
4800020C 7C19D800
40A2004C 3ABCFF3E
3B1CFF8E A6D50014
3AE00104 7ED7B879
4082002C A2F50008
56F7077B 41A20020
C0220018 C0420018
56D705EF 41A20008
C04281A8 D03D0110
D05D0114 7C15C000
4180FFC4 3ADD0110
4800017C 3ADD07D4
3AB8FFEB 48000168
3ADD00E0 41820010
3AB8FFE7 1EB5000C
48000158 C0360000
C0560004 C076000C
C0960010 C0B60018
C0D6001C EC21182A
EC21282A EC42202A
EC42302A 48000170
3EC0804B 62D6FE08
1EBE0044 7ED6AA14
8AB60021 2C1500FF
4182014C 3AB8FFE3
48000104 3ADD0680
40A20008 3AD60020
3AB8FFE0 480000F0
3AB8FFD5 7EBDAA14
3AC006E3 2C18002C
4081000C 3AB50004
3AC006E4 7EF5B0AE
8AD506DF 40A00008
3AE00000 480000D8
C03D1890 C05D19BC
480000FC C0220018
82DD227C 56D5018D
41A20008 C03D23A0
C05D1AAC 480000E0
2C1700B5 40A200D0
C03D08F4 C05D08FC
C0628F38 C0828B90
EC230828 EC211024
EC63202A EC431024
480000B4 C03D19F8
2C1700B2 41A000A4
2C1700B6 4181009C
82BD1A20 C0550058
48000094 82DD19F0
82FD19F4 48000058
3ADD09C0 3B18FF2B
3AE00002 7EB8BBD6
1EB50138 7ED6AA14
82B6FFB4 2C150000
41A2005C 3AF60004
571507FF 41A2001C
3AD60008 3AF6FFC8
48000010 1EB50008
7ED6AA14 3AF60004
C0360000 C0570000
48000034 C8628AF8
D8620020 D8620028
B2C20026 B2E2002E
C8220020 C8420028
EC211828 EC421828
4800000C C0220018
C0420018 D03A0000
D05A0004 3B390001
3B5A0008 2C190003
4081FD60 C0220000
C0420004 C0620008
C082000C C0A20010
C0C20014 BA810008
38210038 00000000
003D36ED 00000037
00408503 00000035
00408511 00000035
0640851F 00000030
3566205C 63303066
66303025 322E3566
205C6366 66303066
6625322E 3566205C
63666630 30666625
322E3566 20000000
06409FE0 00000010
C37A0000 C0000000
C1400000 440C0000
063E89F8 000000B4
546F702D 4E202020
20202000 45434220
546F7020 20202000
45434220 426F7474
6F6D2000 45434220
52696768 74202000
45434220 4C656674
20202000 46312043
68205665 6C6F6300
4632204B 42205665
6C6F6300 46332053
68205665 6C6F6300
546F7461 6C205665
6C6F6300 53797320
44697265 63746900
53797320 432D5374
69636B00 53797320
4C2F5220 20202000
43757220 44697265
63746900 50727620
44697265 63746900
43725072 20536869
656C6400 00000000
063E8C2C 00000030
546D7220 416E7920
53686400 546D7220
44696720 53686400
546D7220 4A756D70
20202000 546D7220
55702D42 20202000
063E8C6C 0000009C
446D672F 4869746C
61672000 48697453
746E2F47 72616200
53686965 6C645374
756E2000 53686420
48502F53 697A6500
546D7220 496E742F
496E7600 48422D30
20582F59 20202000
48422D30 205A2F53
697A6500 48422D31
20582F59 20202000
48422D31 205A2F53
697A6500 48422D32
20582F59 20202000
48422D32 205A2F53
697A6500 48422D33
20582F59 20202000
48422D33 205A2F53
697A6500 00000000

Code:
.....................	  -Increment Player ID/CPU Stat View Toggle (801A3CE8)-
lis	r12,0x8042
ori	r12,r12,0x7940	# 80427940
lbz	r10,0(r12)	# loads player ID to display stuff for
addi	r10,r10,1	# increment it
cmpwi	r10,5
blt+	0x8
li	r10,0		# reset ID to 0 if above 4
stb	r10,0(r12)	# update player ID
blt+	END		# skip disabling display if simply incrementing player ID

DISABLE:
lis	r12,0x8016	# stuff to run if cycled beyond player 4 and disabling CPU Stat display
ori	r12,r12,0x4BC0	# 80164BC0
mtlr	r12
blrl
li	r0,0
stw	r0,-20344(r13)	# clear pointer

END:

----------
801A3CEC:  38000000	li	r0,0		-> nop
801A3CF0:  900DB088	stw	r0,-20344(r13)	-> nop


.....................	  -Load Player ID Instead of Frame Count (801A3E70)-
801A3E70:  3C608047	lis	r3,-32697	-> lis	r3,0x8042
801A3E74:  38637D90	addi	r3,r3,32144	-> addi	r3,r3,0x7940	# 80427940
801A3E78:  80630008	lwz	r3,8(r3)	-> lwz	r3,4(r3)	# loads player ID * 11111 (for readability)



.....................	  -Load Display Setting on Float Pair Change (Advance Right) (80224D70)-
cmpwi	r0,1		# r0 is new pokemon setting (controls floats slot if 1-3)
blt+	END
cmpwi	r0,3
bgt+	END

lis	r10,0x8042
ori	r10,r10,0x7947	# 80427947. settings address -0x1
lbzx	r9,r10,r0	# loads floats setting for the slot
stw	r9,0x60(r31)	# store it into item setting so the float description text updates

END:
stw	r0,0(r4)	# entry point (80224D70). update pokemon setting after advancing Right

.....................	  -Load Display Setting on Float Pair Change (Advance Left) (80224DA8)-
cmpwi	r0,1		# r0 is new pokemon setting (controls floats slot if 1-3)
blt+	END
cmpwi	r0,3
bgt+	END

lis	r10,0x8042
ori	r10,r10,0x7947	# 80427947. settings address -0x1
lbzx	r9,r10,r0	# loads floats setting for the slot
stw	r9,0x60(r31)	# store it into item setting so the float description text updates

END:
stw	r0,0(r4)	# entry point (80224DA8). update pokemon setting after advancing Left


.....................	  -Load Custom CPU Stat Floats (80390D68)-
stwu	r1,-56(r1)	# make space for 12 registers
stmw	r20,8(r1)	# push r20-r31 onto the stack

lis	r31,0x8042
ori	r31,r31,0x7940	# 80427940
lbz	r30,0(r31)	# loads player ID to display stuff for
cmpwi	r30,1
blt-	RESET_ID
cmpwi	r30,4
ble+	SCALE_ID

RESET_ID:
li	r30,1		# set player ID to 1 if not 1-4

SCALE_ID:
stb	r30,0(r31)	# store player ID
mulli	r20,r30,11111	# scale up player id by 11111 (for on-screen readability)
stw	r20,4(r31)	# update player ID to display

DEFAULT_SETTINGS:
lwz	r20,8(r31)	# loads settings for displayed stuff
cmpwi	r20,0		# 0 if no settings defined yet
bne+	DEFAULT_COLORS
lis	r20,0x1419
ori	r20,r20,0x1D00	# 14191D00. TopN, Char Velocity, Directional Input (System)
stw	r20,8(r31)	# default settings for displayed stuff

DEFAULT_COLORS:
li	r20,0x3030	# 00003030 (- - 0 0)
li	r21,0x6666	# 00006666 (- - f f)
lis	r22,0x6666
ori	r22,r22,0x3030	# 66663030 (f f 0 0)
lis	r29,0x8040
ori	r29,r29,0x84DE	# 804084DE. Font color data address -0x1C

sth	r21,0x1C(r29)	# f f      @804084FA (float 1 Red)
sth	r21,0x20(r29)	# f f      @804084FE (float 1 Blue)
sth	r21,0x2E(r29)	# f f      @8040850C (float 2 Blue)

sth	r20,0x38(r29)	# 0 0      @80408516 (float 3 Red)
stw	r22,0x3A(r29)	# f f 0 0  @80408518 (float 3 Green/Blue)
sth	r20,0x46(r29)	# 0 0      @80408524 (float 4 Red)
stw	r22,0x48(r29)	# f f 0 0  @80408526 (float 4 Green/Blue)

stw	r22,0x54(r29)	# f f 0 0  @80408532 (float 5 Red/Green)
sth	r21,0x58(r29)	# f f      @80408536 (float 5 Blue)
stw	r22,0x62(r29)	# f f 0 0  @80408540 (float 6 Red/Green)
sth	r21,0x66(r29)	# f f      @80408544 (float 6 Blue)

UPDATE_SETTING:
addi	r31,r31,7	# 80427947. settings address -0x1
lis	r28,0x8049
ori	r28,r28,0xD978	# 8049D978. Address of Debug Item/Pokemon Settings
lwz	r27,0x4(r28)	# loads Pokemon Setting

cmpwi	r27,1
blt+	FLOAT_PREP
cmpwi	r27,3
bgt+	FLOAT_PREP	# no float font highlight or updating floats setting if not slots 1-3
lwz	r24,0x0(r28)	# loads Item Setting
stbx	r24,r31,r27	# stores item setting as floats setting for the slot

HIGHLIGHT:
mulli	r23,r27,0x1C	# float pairs' color data 0x1C apart. 1st float in pair offset
addi	r24,r23,0xE	# 2nd float in pair offset

sthx	r21,r29,r23	# 1st float Red = f f
sthx	r21,r29,r24	# 2nd float Red = f f
addi	r23,r23,2	# moves 1st float offset to Green/Blue
addi	r24,r24,2	# moves 2nd float offset to Green/Blue
stwx	r22,r29,r23	# 1st float Green/Blue = f f 0 0
stwx	r22,r29,r24	# 2nd float Green/Blue = f f 0 0

FLOAT_PREP:
li	r20,0
stw	r20,0x18(r2)	# stores 0 for when loading null floats
mr	r26,r2		# initialize address to store floats during code's loop
li	r25,1		# initialize current float pair being worked on

GET_MAIN_INDEX:
lis	r29,0x804D
ori	r29,r29,0x56A8	# 804D56A8. Address for player pointers (P1) +0x4
mulli	r21,r30,-0x4	# player ID * -4. pointers are 4 bytes apart and in reverse order
lwzx	r29,r29,r21
lwz	r29,0x20(r29)	# loads Main Index for player being displayed
ori	r20,r20,0xFFFF	# 0000FFFF. for empty player slot check


LOOP_START:
lhz	r21,0x6(r29)	# FFFF if empty player slot
cmpw	r21,r20
beq-	NULL_FLOATS	# go to use 0 for both floats in this pair if empty player slot
lbzx	r24,r31,r25	# loads setting for float pair being worked on
lwz	r23,0x70(r29)	# loads current action


cmpwi	r24,0x14	# 0x14 = TopN
beq-	TOPN
blt-	NULL_FLOATS	# load null floats if invalid setting on this float pair

cmpwi	r24,0x18
ble-	SCD		# 0x15 - 0x18 = SCD Top/Bottom/Right/Left

cmpwi	r24,0x1C
ble-	VELOCITIES	# 0x19 - 0x1C = Forces|Velocities

cmpwi	r24,0x1F
ble-	LIVE_INPUTS	# 0x1D - 0x1F = Live Controller Port Inputs

cmpwi	r24,0x22
ble-	CHAR_INPUTS	# 0x20 - 0x22 = Inputs Applied to Character

cmpwi	r24,0x2E
ble-	BUTTON_TIMERS	# 0x2B - 0x2E = Button Timers


cmpwi	r24,0xD0	# 0xD0 = Total Damage|Hitlag
beq-	DAMAGE_HITLAG

cmpwi	r24,0xD1	# 0xD1 = Hitstun|Grab Hold Time
beq-	HITSTUN_GRABTIME

cmpwi	r24,0xD2	# 0xD2 = Shield Stun (Actual|Calculated)
beq-	SHIELDSTUN

cmpwi	r24,0xD3	# 0xD3 = Shield Health|Size
beq-	SHIELD_HPSIZE

cmpwi	r24,0xD4	# 0xD4 = Timed Intangibility/Invincibility
beq-	TIMED_INTINV

cmpwi	r24,0xDC	# 0xD5 - 0xDC = Hitbox X/Y|Hitbox Z/Size
ble-	HITBOX
b	NULL_FLOATS	# load null floats if invalid setting on this float pair



TOPN:
cmpw	r25,r27
bne+	TOPN_ADDRESS	# skip input checks for TopN modification if TopN float pair not highlighted

TOPN_MODIFY:
subi	r21,r28,0xC2	# 8049D8B6. Controller port 1 debug held inputs -0x14
subi	r24,r28,0x72	# port 4's address for end of loop

TOPN_LOOP:
lhzu	r22,0x14(r21)	# loads next port's held inputs
li	r23,0x0104	# A and dpad-down buttons
andc.	r23,r22,r23
bne-	TOPN_LOOP_CHK	# skip if inputting anything besides A or dpad-down

lhz	r23,0x8(r21)	# loads press inputs
rlwinm. r23,r23,0,29,29	# check if dpad-down press
beq+	TOPN_LOOP_CHK	# skip if no dpad-down press

lfs	f1,0x18(r2)	# 0 for TopN X
lfs	f2,0x18(r2)	# 0 for TopN Y
rlwinm. r23,r22,0,23,23	# check if A button held
beq+	0x8
lfs	f2,-32344(r2)	# loads 100 for TopN Y if holding A
stfs	f1,0x110(r29)	# update TopN X
stfs	f2,0x114(r29)	# update TopN Y

TOPN_LOOP_CHK:
cmpw	r21,r24
blt+	TOPN_LOOP	# loop if not finished checking all controller ports


TOPN_ADDRESS:
addi	r22,r29,0x110	# Main Index + 0x110 = TopN X
b	COMMON_PAIR_4


SCD:
addi	r22,r29,0x7D4	# Main Index + 0x7D4 = SCD Top X
subi	r21,r24,0x15
b	COMMON_GROUP_8	# Top/Bottom/Right/Left are 0x8 bytes apart, and pairs 4 apart


VELOCITIES:
addi	r22,r29,0xE0	# Main Index + 0xE0 = F1 Char Velocity X
beq-	NET_VELOCITY	# 0x1C = Net Velocity
subi	r21,r24,0x19
mulli	r21,r21,0xC	# F1/F2/F3 forces float groups are 0xC bytes apart, and pairs 4 apart
b	COMMON_GROUP

NET_VELOCITY:
lfs	f1,0x0(r22)	# F1 Char Velocity X
lfs	f2,0x4(r22)	# F1 Char Velocity Y
lfs	f3,0xC(r22)	# F2 KB Velocity X
lfs	f4,0x10(r22)	# F2 KB Velocity Y
lfs	f5,0x18(r22)	# F3 Atk-Shd KB Velocity X
lfs	f6,0x1C(r22)	# F3 Atk-Shd KB Velocity Y
fadds	f1,f1,f3
fadds	f1,f1,f5	# total force X
fadds	f2,f2,f4
fadds	f2,f2,f6	# total force Y
b	LOOP_END


LIVE_INPUTS:
lis	r22,0x804B
ori	r22,r22,0xFE08	# 804BFE08. Controller port 1 inputs -0x44
mulli	r21,r30,0x44	# player ID * 0x44 (ports 0x44 apart)
add	r22,r22,r21
lbz	r21,0x21(r22)	# FF if empty controller port
cmpwi	r21,0xFF
beq-	NULL_FLOATS	# null floats if no controller plugged into port showing floats for
subi	r21,r24,0x1D
b	COMMON_GROUP_8	# Directional/C-Stick/LR inputs are 0x8 bytes apart, and pairs 4 apart


CHAR_INPUTS:
addi	r22,r29,0x680	# Main Index + 0x680 = Current Dir Input X
bne+	0x8		# skip if not 0x22 Curr/Prev Shield Input
addi	r22,r22,0x20	# shield input is 0x20 later than the usual 0x8 between groups
subi	r21,r24,0x20
b	COMMON_GROUP_8	# CurrDir/PrevDir/Shield inputs are 0x8 bytes apart, and pairs 4 apart


BUTTON_TIMERS:
subi	r21,r24,0x2B
add	r21,r29,r21	# Main Index + group offset
li	r22,0x6E3	# offset from main index 1st timer + 0x4 (0x2C timers are 4 apart)
cmpwi	r24,0x2C
ble-	LOAD_TIMERS
addi	r21,r21,0x4	# 2D-2E are 4 bytes after calculated group offset
li	r22,0x6E4	# offset from main index 1st timer + 0x5 (0x2D-2E timers are 5 apart)

LOAD_TIMERS:
lbzx	r23,r21,r22	# loads 2nd timer
lbz	r22,0x6DF(r21)	# loads 1st timer
bge+	0x8		# skip if 2C-2E
li	r23,0		# 2B has no 2nd timer. null
b	INT_TO_FLOAT	# convert the int timers into floats so they can be used



DAMAGE_HITLAG:
lfs	f1,0x1890(r29)	# loads Total Damage as 1st float
lfs	f2,0x19BC(r29)	# loads Hitlag as 2nd float
b	LOOP_END


HITSTUN_GRABTIME:
lfs	f1,0x18(r2)	# loads 0 for 1st float by default
lwz	r22,0x227C(r29)	# loads flags for things like hitstun
rlwinm. r21,r22,0,6,6	# check flag for in hitstun (-2------)
beq+	GRAB_TIME	# keep as 0 if not in hitstun
lfs	f1,0x23A0(r29)	# loads variable(?) that contains hitstun duration while in hitstun

GRAB_TIME:
lfs	f2,0x1AAC(r29)	# loads Grab Hold Time as 2nd float
b	LOOP_END


SHIELDSTUN:
cmpwi	r23,0xB5	# 0xB5 = GuardDamage
bne+	NULL_FLOATS	# null floats if not shield damage action

lfs	f1,0x8F4(r29)	# loads current animation frame
lfs	f2,0x8FC(r29)	# loads animation speed
lfs	f3,-28872(r2)	# 804D6798. loads 20 (41A00000). GuardDamage animation length for all characters
lfs	f4,-29808(r2)	# 804D63F0. loads 0.1 (3DCCCCCD). added to animation length for FSM calculations

fsubs	f1,f3,f1	# 20 - Current Frame = Animation Length Remaining
fdivs	f1,f1,f2	# (20 - Current Frame) / Speed = Actual Stun Time Remaining

fadds	f3,f3,f4	# 20 + 0.1
fdivs	f2,f3,f2	# (20 + 0.1) / Speed = Originally Calculated Stun Time
b	LOOP_END


SHIELD_HPSIZE:
lfs	f1,0x19F8(r29)	# loads Shield Health as 1st float

cmpwi	r23,0xB2	# 0xB2 = GuardOn
blt+	NULL_SECOND	# load 0 for 2nd float if not shield action
cmpwi	r23,0xB6	# 0xB6 = GuardReflect
bgt-	NULL_SECOND	# load 0 for 2nd float if not shield action

lwz	r21,0x1A20(r29)
lfs	f2,0x58(r21)	# loads Shield Collision Size as 2nd float
b	LOOP_END


TIMED_INTINV:
lwz	r22,0x19F0(r29)	# loads timed Intangibility
lwz	r23,0x19F4(r29)	# loads timed Invincibility
b	INT_TO_FLOAT	# convert the int timers into floats so they can be used


HITBOX:
addi	r22,r29,0x9C0	# Main Index + 0x9C0 = Hitbox-0 X
subi	r24,r24,0xD5	# setting remainder for hitbox setting group 0xD5 - 0xDC

li	r23,2
divw	r21,r24,r23	# each hitbox has 2 float pair settings associated with it
mulli	r21,r21,0x138	# hitboxes are 0x138 apart
add	r22,r22,r21	# address of X Offset of Hitbox being looked at

lwz	r21,-0x4C(r22)	# 0 = inactive hitbox ID, 2 = active no interp, 3 = active interp
cmpwi	r21,0
beq+	NULL_FLOATS	# null floats if hitbox ID not active

addi	r23,r22,0x4	# 2nd float is 4 bytes after 1st on Even hitbox settings
rlwinm. r21,r24,0,31,31	# check if Odd hitbox setting
beq+	COMMON_LOAD	# skip and load floats if Even hitbox setting
addi	r22,r22,0x8
subi	r23,r22,0x38	# Size (2nd float) is -0x38 from Z (1st), not +0x4
b	COMMON_LOAD	# load hitbox floats



COMMON_GROUP_8:
mulli	r21,r21,0x8	# groups of floats are 8 bytes apart

COMMON_GROUP:
add	r22,r22,r21	# adds group offset

COMMON_PAIR_4:
addi	r23,r22,0x4	# 2nd float 4 bytes after 1st

COMMON_LOAD:
lfs	f1,0x0(r22)
lfs	f2,0x0(r23)
b	LOOP_END


INT_TO_FLOAT:
lfd	f3,-29960(r2)	# loads magic double for int to float conversion
stfd	f3,0x20(r2)
stfd	f3,0x28(r2)
sth	r22,0x26(r2)	# 0x43300000800000xx. put 1st int at end of magic double
sth	r23,0x2E(r2)	# 2nd int
lfd	f1,0x20(r2)
lfd	f2,0x28(r2)
fsubs	f1,f1,f3	# subtract 0x4330000080000000 for converted int 1
fsubs	f2,f2,f3	# subtract 0x4330000080000000 for converted int 2
b	LOOP_END


NULL_FLOATS:
lfs	f1,0x18(r2)	# loads 0 for 1st float

NULL_SECOND:
lfs	f2,0x18(r2)	# loads 0 for 2nd float

LOOP_END:
stfs	f1,0x0(r26)	# store 1st float in pair at current pair's loading address
stfs	f2,0x4(r26)	# 2nd float
addi	r25,r25,1	# increment current float pair
addi	r26,r26,8	# update float storage address to next float pair slot
cmpwi	r25,3
ble+	LOOP_START	# loop for next float pair until all 3 are done

LOAD_FLOATS:
lfs	f1,0x0(r2)	# loads setting 1, float 1
lfs	f2,0x4(r2)	# loads setting 1, float 2
lfs	f3,0x8(r2)	# loads setting 2, float 1
lfs	f4,0xC(r2)	# loads setting 2, float 2
lfs	f5,0x10(r2)	# loads setting 3, float 1
lfs	f6,0x14(r2)	# loads setting 3, float 2

END:
lmw	r20,8(r1)	# pop r20-r31 off the stack
addi	r1,r1,56	# release the space



r20 = Temp Stuff | 0000FFFF
r21 = Temp Stuff
r22 = Temp Stuff |                  Common Load 1, Int to Float 1
r23 = Temp Stuff | Current Action | Common Load 2, Int to Float 2
r24 = Temp Stuff | Current Floats Setting for Functions
r25 = Current Floats Pair
r26 = Current Float Storage Address
r27 = Pokemon Setting
r28 = Address of Debug Item/Pokemon Settings and Debug Inputs
r29 = Font Color Data Address | Main Index for Player
r30 = Player ID
r31 = Display Settings Address | Display Settings Address + 0x7 (for indexed loading of settings)
Code:
---DOL Edits---
801A3CE8	0x1A08C8	48283C68 60000000 60000000
80427950	0x424950	3D808042 618C7940 894C0000 394A0001 2C0A0005 41A00008 39400000 994C0000 41A0001C 3D808016 618C4BC0 7D8803A6 4E800021 38000000 900DB088 4BD7C360

801A3E70	0x1A0A50	3C608042 38637940 80630004

80224D70	0x221950	48202C30
804279A0	0x4249A0	2C000001 41A0001C 2C000003 41A10014 3D408042 614A7947 7D2A00AE 913F0060 90040000 4BDFD3B0

80224DA8	0x221988	48202C28
804279D0	0x4249D0	2C000001 41A0001C 2C000003 41A10014 3D408042 614A7947 7D2A00AE 913F0060 90040000 4BDFD3B8

80390D68	0x38D948	480969D8
80427740	0x424740	9421FFC8 BE810008 3FE08042 63FF7940 8BDF0000 2C1E0001 4180000C 2C1E0004 40A10008 3BC00001 9BDF0000 1E9E2B67 929F0004 829F0008 2C140000 40A20010 3E801419 62941D00 929F0008 3A803030 3AA06666 3EC06666 62D63030 3FA08040 63BD84DE B2BD001C B2BD0020 B2BD002E B29D0038 92DD003A B29D0046 92DD0048 92DD0054 B2BD0058 92DD0062 B2BD0066 3BFF0007 3F808049 639CD978 837C0004 2C1B0001 41A00034 2C1B0003 41A1002C 831C0000 7F1FD9AE 1EFB001C 3B17000E 7EBDBB2E 7EBDC32E 3AF70002 3B180002 7EDDB92E 7EDDC12E 3A800000 92820018 7C5A1378 3B200001 3FA0804D 63BD56A8 1EBEFFFC 7FBDA82E 83BD0020 6294FFFF 4BFFFB20
80427360	0x424360	A2BD0006 7C15A000 4182027C 7F1FC8AE 82FD0070 2C180014 41820064 41800268 2C180018 408100B0 2C18001C 408100B4 2C18001F 408100EC 2C180022 40810108 2C18002E 40810114 2C1800D0 4182013C 2C1800D1 41820140 2C1800D2 41820154 2C1800D3 41820178 2C1800D4 41820190 2C1800DC 40810194 4800020C 7C19D800 40A2004C 3ABCFF3E 3B1CFF8E A6D50014 3AE00104 7ED7B879 4082002C A2F50008 56F7077B 41A20020 C0220018 C0420018 56D705EF 41A20008 C04281A8 D03D0110 D05D0114 7C15C000 4180FFC4 3ADD0110 4800017C 3ADD07D4 3AB8FFEB 48000168 3ADD00E0 41820010 3AB8FFE7 1EB5000C 48000158 C0360000 C0560004 C076000C C0960010 C0B60018 C0D6001C EC21182A EC21282A EC42202A EC42302A 48000170 3EC0804B 62D6FE08 1EBE0044 7ED6AA14 8AB60021 2C1500FF 4182014C 3AB8FFE3 48000104 3ADD0680 40A20008 3AD60020 3AB8FFE0 480000F0 3AB8FFD5 7EBDAA14 3AC006E3 2C18002C 4081000C 3AB50004 3AC006E4 7EF5B0AE 8AD506DF 40A00008 3AE00000 480000D8 C03D1890 C05D19BC 480000FC C0220018 82DD227C 56D5018D 41A20008 C03D23A0 C05D1AAC 480000E0 2C1700B5 40A200D0 C03D08F4
C05D08FC C0628F38 C0828B90 EC230828 EC211024 EC63202A EC431024 480000B4 C03D19F8 2C1700B2 41A000A4 2C1700B6 4181009C 82BD1A20 C0550058 48000094 82DD19F0 82FD19F4 48000058 3ADD09C0 3B18FF2B 3AE00002 7EB8BBD6 1EB50138 7ED6AA14 82B6FFB4 2C150000 41A2005C 3AF60004 571507FF 41A2001C 3AD60008 3AF6FFC8 48000010 1EB50008 7ED6AA14 3AF60004 C0360000 C0570000 48000034 C8628AF8 D8620020 D8620028 B2C20026 B2E2002E C8220020 C8420028 EC211828 EC421828 4800000C C0220018 C0420018 D03A0000 D05A0004 3B390001 3B5A0008 2C190003 4081FD60 C0220000 C0420004 C0620008 C082000C C0A20010 C0C20014 BA810008 38210038 4BF69748

803D36ED	0x3D06ED	37
80408503	0x405503	35
80408511	0x405511	35
8040851F	0x40551F	3566205C 63303066 66303025 322E3566 205C6366 66303066 6625322E 3566205C 63666630 30666625 322E3566 20000000
80409FE0	0x406FE0	C37A0000 C0000000 C1400000 440C0000

803E89F8	0x3E59F8	546F702D 4E202020 20202000 45434220 546F7020 20202000 45434220 426F7474 6F6D2000 45434220 52696768 74202000 45434220 4C656674 20202000 46312043 68205665 6C6F6300 4632204B 42205665 6C6F6300 46332053 68205665 6C6F6300 546F7461 6C205665 6C6F6300 53797320 44697265 63746900 53797320 432D5374 69636B00 53797320 4C2F5220 20202000 43757220 44697265 63746900 50727620 44697265 63746900 43725072 20536869 656C6400
803E8C2C	0x3E5C2C	546D7220 416E7920 53686400 546D7220 44696720 53686400 546D7220 4A756D70 20202000 546D7220 55702D42 20202000
803E8C6C	0x3E5C6C	446D672F 4869746C 61672000 48697453 746E2F47 72616200 53686965 6C645374 756E2000 53686420 48502F53 697A6500 546D7220 496E742F 496E7600 48422D30 20582F59 20202000 48422D30 205A2F53 697A6500 48422D31 20582F59 20202000 48422D31 205A2F53 697A6500 48422D32 20582F59 20202000 48422D32 205A2F53 697A6500 48422D33 20582F59 20202000 48422D33 205A2F53 697A6500


DOL Downloads

NOTE: These are v1.00 of the game. If you only have a 1.01/1.02 version you can just replace the .DOL anyway and it'll work (although the executable will now be 1.00, so if it was originally 1.02 Bowser will now be able to flame cancel, Zelda's smashes actually work, etc).

C-Stick 1P, Debug Tourny, Rules, Physics & MORE Display (NTSC 100)
Has c-stick in 1P modes, Debug replaces Tournament mode, 4 Stock, 8 min, FF On default settings as well.


C-Stick 1P, C-Stick Debug, Debug Tourny, Rules, No Interp, Physics & MORE Display (NTSC 100)
This is the one I use that also disables develop mode displaying the interpolation on hitboxes since that's useful to me. Might as well also include it here since it's already made.

 

TerryJ

Smash Journeyman
Joined
Apr 12, 2010
Messages
488
Location
BEST COAST, WA
NNID
1337-1337-1337
3DS FC
1337-1337-1337
WOAH MAGUS POST!

This is some seriously useful stuff that you've made, gonna give it all a try tonight.
 

schmooblidon

Smash Journeyman
Joined
Feb 18, 2014
Messages
496


Oh my god this is freakin incredible! Thank you so god damn much dude!
 
Last edited:
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
This is an unexpected surprise. Awesome to see you putting this out, and I'm very glad you shared your notes, since I can definitely see myself using an on-screen display for stuff.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
So this is obviously incredible and as Dan said, it's nice to see new content from you on the Melee Workshop. There's still so much to be done with this game.

Quick question, as I do not have the means to test at the moment:
Do your "move character" commands pass characters through collision walls? If not, do you know how to make this happen?
 

Magus420

Smash Master
Joined
Dec 13, 2003
Messages
4,541
Location
Close to Trenton, NJ Posts: 4,071
They do not. You'd need to update the current collision positions to do that I think, though not sure what would be involved in doing that without looking. Since the ECB points are offsets from TopN (at least the ones I found and display), maybe there's a copy of TopN near them that'd also need to be updated to the new position or a set of ECB positions somewhere else instead of TopN offsets.

Edit: Yeah, at ECB Top -0x80 is the base X/Y position of the current collision box. If you also update that along with TopN you'll warp directly there without collision inbetween interfering.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
All TopN offsets in a character's data structure are

+0xB0
+0xBC
+0x6F4
+0x700
+0x70C
+0x718

(add 0x60 for each to get offsets from the start of the entity structure, r29 in your Develop Physics code).

I tried changing the coordinates in all these addresses at one time to move the player through a wall, but it did not work.
Briefly looking through your notes - do you think these will need to be changed as well?

"# Main Index + 0x7D4 = SCD Top X"

Are these the ECB top,left,right coordinates? Idk how these get updated and if they don't before performing a wall collision check after manually editin the topN. Hmm. Well can't wait to get home after this flight to dig into things deeper.

The main reasons I'm interested in this are for the save state code and blastzone wrapping.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Updating r29 +0x754 (X), and r29 +0x758 (Y) in addition to 0x110 and 0x114 works fine for me to go through the underside of FD. ECB Top is at 0x7D4.
Hmm I wonder why it didn't work for me because those are the second offsets that I listed. I think I was on the left side of princess Peach's castle trying to go through to the right side. I'll try it again when I get a chance.
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
I've been wanting to be able able to pull ECB coordinates for a while now.... I'd just about given up hope.
 

Magus420

Smash Master
Joined
Dec 13, 2003
Messages
4,541
Location
Close to Trenton, NJ Posts: 4,071
They needed to be known for me to display them with this code, so yes =P

Top: +0x7D4
Bottom: +0x7DC
Right: +0x7E4
Left: +0x7EC

If you mean the actual X/Y and not the offsets, you'd just add them to current TopN.
 

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
@ Magus420 Magus420 thank you so much for finishing and releasing this! If you provide some means for doing so, I’d like to donate 100$ to you.
I’m not sure whether you are willing to release future revisions of this, but if you are, I have one request: adding trajectory DI values in similar fashion as the directional input (both for Sys DI / live input and current frame DI).
 

Magus420

Smash Master
Joined
Dec 13, 2003
Messages
4,541
Location
Close to Trenton, NJ Posts: 4,071
@ Achilles1515 Achilles1515 Doesn't seem to be saved in any of my notes, but I've looked at it at some point since I know it squares the perpendicular distance from the stick's position to the attack's trajectory which is then scaled by 18 degrees.


@ Kadano Kadano Yes, I already have an idea or 2 to add onto it since making it (ECB offset update with TopN edit so it can go through the stage, Total Damage being editable), but I'll wait until I have more changes to make first. Feel free to pitch some ideas of useful stuff to try adding in to display. May need to move the 2nd part of the code to where the Animation Engine Data is for more room. Showing the DI angle change is likely possible, though live updating potential DI change while more useful could be quite complex. I'd probably have to call the function to calculate it but prevent it from modifying anything, since doing the math involved within the code itself may not be a realistic idea.

No problem! It's more of a convenience code in my case since I can just look at most of these things in memory, but I know 1st getting into the game's internal numberical data was huge for my testing things and understanding of the game so I'm sure others will find it extremely helpful as well. My paypal is saiyajin627@comcast.net . That would be much appreciated!
 

Magus420

Smash Master
Joined
Dec 13, 2003
Messages
4,541
Location
Close to Trenton, NJ Posts: 4,071
This is where it does trajectory DI (there's a check if X/Y input are 0 if looking to force DI through):


Code:
-v1.02-
8008E5A4:  7C0802A6	mflr	r0		start of Trajectory DI function
...
8008E5C8:  C0228AF4	lfs	f1,-29964(r2)	f1 = 0
8008E5CC:  C0630620	lfs	f3,1568(r3)	f3 = Directional Input X
8008E5D0:  FC030800	fcmpu	cr0,f3,f1
8008E5D4:  40820010	bne-	0x8008e5e4
8008E5D8:  C01F0624	lfs	f0,1572(r31)	f0 = Directional Input Y
8008E5DC:  FC000800	fcmpu	cr0,f0,f1
8008E5E0:  41820110	beq-	0x8008e6f0	go to function end if no directional input
8008E5E4:  C03F008C	lfs	f1,140(r31)	base X KB
8008E5E8:  C39F0090	lfs	f28,144(r31)	base Y KB
8008E5EC:  FC800850	fneg	f4,f1
...
8008E6C4:  C00301A8	lfs	f0,424(r3)	loads max DI effect (18)
8008E6C8:  EC020032	fmuls	f0,f2,f0	f0 = 0.01745329 converts to radians
8008E6CC:  EF800FBA	fmadds	f28,f0,f30,f1	f30 = Perpendicular distance to trajectory ^2. f1 = base trajectory (radians)
8008E6D0:  FC20E090	fmr	f1,f28		put new trajectory (radians) into f1 to get cos(angle) for finding New X
8008E6D4:  48297B6D	bl	0x80326240	cosine function
8008E6D8:  EC1F0072	fmuls	f0,f31,f1	f31 = KB speed (hypotenuse). Speed * cos(trajectory) = New KB X
8008E6DC:  FC20E090	fmr	f1,f28		put new trajectory (radians) into f1 to get cos(angle) for finding New Y
8008E6E0:  D01F008C	stfs	f0,140(r31)	store New X KB
8008E6E4:  48297CF1	bl	0x803263d4	sine function
8008E6E8:  EC1F0072	fmuls	f0,f31,f1	f31 = KB speed (hypotenuse). Speed * sin(trajectory) = New KB Y
8008E6EC:  D01F0090	stfs	f0,144(r31)	store New Y KB
8008E6F0:  8001005C	lwz	r0,92(r1)
8008E6F4:  CBE10050	lfd	f31,80(r1)
8008E6F8:  CBC10048	lfd	f30,72(r1)
8008E6FC:  CBA10040	lfd	f29,64(r1)
8008E700:  CB810038	lfd	f28,56(r1)
8008E704:  83E10034	lwz	r31,52(r1)
8008E708:  38210058	addi	r1,r1,88
8008E70C:  7C0803A6	mtlr	r0
8008E710:  4E800020	blr
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
This is where it does trajectory DI (there's a check if X/Y input are 0 if looking to force DI through):


Code:
-v1.02-
8008E5A4:  7C0802A6    mflr    r0        start of Trajectory DI function
...
8008E5C8:  C0228AF4    lfs    f1,-29964(r2)    f1 = 0
8008E5CC:  C0630620    lfs    f3,1568(r3)    f3 = Directional Input X
8008E5D0:  FC030800    fcmpu    cr0,f3,f1
8008E5D4:  40820010    bne-    0x8008e5e4
8008E5D8:  C01F0624    lfs    f0,1572(r31)    f0 = Directional Input Y
8008E5DC:  FC000800    fcmpu    cr0,f0,f1
8008E5E0:  41820110    beq-    0x8008e6f0    go to function end if no directional input
8008E5E4:  C03F008C    lfs    f1,140(r31)    base X KB
8008E5E8:  C39F0090    lfs    f28,144(r31)    base Y KB
8008E5EC:  FC800850    fneg    f4,f1
...
8008E6C4:  C00301A8    lfs    f0,424(r3)    loads max DI effect (18)
8008E6C8:  EC020032    fmuls    f0,f2,f0    f0 = 0.01745329 converts to radians
8008E6CC:  EF800FBA    fmadds    f28,f0,f30,f1    f30 = Perpendicular distance to trajectory ^2. f1 = base trajectory (radians)
8008E6D0:  FC20E090    fmr    f1,f28        put new trajectory (radians) into f1 to get cos(angle) for finding New X
8008E6D4:  48297B6D    bl    0x80326240    cosine function
8008E6D8:  EC1F0072    fmuls    f0,f31,f1    f31 = KB speed (hypotenuse). Speed * cos(trajectory) = New KB X
8008E6DC:  FC20E090    fmr    f1,f28        put new trajectory (radians) into f1 to get cos(angle) for finding New Y
8008E6E0:  D01F008C    stfs    f0,140(r31)    store New X KB
8008E6E4:  48297CF1    bl    0x803263d4    sine function
8008E6E8:  EC1F0072    fmuls    f0,f31,f1    f31 = KB speed (hypotenuse). Speed * sin(trajectory) = New KB Y
8008E6EC:  D01F0090    stfs    f0,144(r31)    store New Y KB
8008E6F0:  8001005C    lwz    r0,92(r1)
8008E6F4:  CBE10050    lfd    f31,80(r1)
8008E6F8:  CBC10048    lfd    f30,72(r1)
8008E6FC:  CBA10040    lfd    f29,64(r1)
8008E700:  CB810038    lfd    f28,56(r1)
8008E704:  83E10034    lwz    r31,52(r1)
8008E708:  38210058    addi    r1,r1,88
8008E70C:  7C0803A6    mtlr    r0
8008E710:  4E800020    blr
Fantastic! Back in December I started to look into finding this function and other DI related things. I only spent a brief part of one day doing some investigating and never returned to continue. This is VERY helpful. Thanks Magus.

My sloppy notes from initial DI investigation (I was getting close...):
Code:
DI Research
Using 811b2598 (C Falcon Knee)

800713f8 - bl 0x8007ac9c
- right before this line, it loads the DI trajectory from a hitbox

713f4 - result spits out the angle in degrees
------------------------------
Function 8007ac9c
r4 = degree in angles (in hex)

7aca0 - cmplwi r4,361
    - compares move to the Sakurai angle


7acb0 - stw r4,0x20(r3)
    = +0xACC data offset = angle of current move

7acc0 - cmplw r0,r4
    - compares the current move's hit angle to 260 degrees. Branches if 260 is greater than hit angle.
-------------------------------------------

Memory Read on +ACC from data offset

8007a864
- gets executed whenever an attack hits

+18a8 = angle from attack being delivered to you
----------------------------------------

Memory read on +18a8
8008d810 (Function start 8008d7f0)
- function that actually calculates DI angle? No.
- idk something.

Branches out to 8008de24 - complicated
It's so fascinating to see how this game actually works.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Couple more things:

1) I still cannot make a character move through a wall, even after updating both X and Y coordinate at +0x110 and +754. Just tried going through Princess Peach's Castle (from like -40 to +40 in the X direction) and I only make it to the first vertical wall (at X=~ -22) and not through it. Are you inputting these coordinates while paused at a specific code line, which may make a difference?

2) Not sure if you're aware of these and something you may want to add to this physics build is:

+0x23A4 = Shield offset from center of body [float, 0 = center of body, 1 = furthest possible away]
+0x23A8 = Shield angle [float, 0 = in front of, 90 = up, 180 = behind, 270 = down]

3) Do you know of a way to tell if the player is a CPU solely within the player data offset info?
 

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
@ Magus420 Magus420 unfortunately, the "HitStn/Grab" display doesn’t work properly when the active character slots are not P1 and P2. Only P1 and P2 will show the actual hitstun when characters are hit, and while P1’s does belong to P1, the one that is labeled P2 (or, rather, "22222") will actually display P4’s hitstun.

Edit: when three characters are active, the 22222 display will show P3’s hitstun.

33333 and 44444 HitStn/Grab never displayed anything else than zero for me.

Putting this into a table:

P1 kind?|P2?|P3?|P4?|11111|22222|33333|44444
Human|None|None|None| P1 |||
Human|Human|None|None| P1 | P2 ||
None|Human|Human|None|P2|P3||
Human|Human|Human|None|P1|P3||
Human|Human|Human|Human|P1|P4||

It seems 11111 always uses the lowest active port and 22222 the highest, while 33333 and 44444 never do anything.

This bug exists for me both on Dolphin and on Gamecube. I used both of your .dol files, it’s the same for both of them. I did not modify the .dol files at all before integrating them.

In case you manage to make HitStn/Grab work for all four ports, adding the codes for "everything unlocked" would be much appreciated. Also, integrating your code that disables damage staling in develop mode (but not in debug-rom) would be super-neat.

If you are still looking for values to add to the physics display, the disabled ledge regrab period timer would be useful as well (at least to me).

Additionally, the Gamecube controller protocol and Dolphin’s emulation system seems to use different values for the analog sticks; 0-255 for both x- and y-axis. I recently took notes of how these correlate, but I haven’t been able to make sense of it. Do you know the logic Melee / the Gamecube applies to generate the directional input from the potentiometer data?

Here are my findings from something I recently did for @ Achilles1515 Achilles1515 , searching for the x / y value pairs that result in a “perfect” wavedash, in case you find them helpful:

So, I’ve started testing for the input range with Fox.
This post is mostly a worklog for myself right now, but you might find my findings interesting as well and of course, once I’m done testing this post should be finished with the x/y ratio you need for the code.

Dolphin input display X|Dolphin input display Y|CUR DIRECTI X|CUR DIRECTI Y|F1 CH VELOC X|F1 CH VELOC Y|Comment
230|101|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , “real controller” value
229|101|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
229|100|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
229|99|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle , “real controller” value
230|99|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle , “real controller” value
231|100|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
231|99|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
255|93|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “TAS” value
255|94|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , “TAS” value
255|93|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “TAS” value
255|92|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle, “TAS” value
203|109|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , minimal value
202|109|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , minimal value
201|109|0.93750|-0.28750|2.66739|-0.81800| Lower than 342.0° angle , minimal value

Things I’ll have to complete:
1. Find input range when pushing the stick all the way to the octagon shell with at least two different controllers
2. Check for less-than-max extension inputs, whether the x/y ratio is consistent (I’m sure it is, but I have to make sure so the code is as accurate as possible)
3. Check whether less-than-max extension inputs trigger max velocity as well

Feel free to edit your own test results into this table with your mod powers.

Dead zone is everything less than |0.28750|.

Okay, so I’ve put all of these values in an Excel sheet and found the common criteria for the perfect angle. [|CUR DIRECTI X|] / [CUR DIRECTI Y] needs to be equal to -3.30435. Keep in mind that you need to make sure that the upward angles are eliminated, not sure how this can be done in Assembly. My first approach would be to take the absolute value of x and only check for -3.30435. The minus could only be introduced by y, not by x this way.

Things I found interesting:
1. Above a certain input strenth threshold, Cur Directi X and Y seem to not care about the strength of the input, only the direction / angle seems to matter. Using tilts just outside of the control stick’s dead zone produced the same Cur Directi values and wavedash lengths as using the same angle when touching the octagon gate or even going beyond it (using Dolphin TAS input).

2. This made me finally understand why the angles between 0±(mod90) and (mod90)±17 degrees are all treated as straight (mod90) angles by the game. Before, I thought that it was intentionally coded like this so that it would be easier to hit the straight angles, but now I’m very sure that it’s simply the dead zone ignoring slight deviations from centered (128 / 0.00000), even when the other coordinate is outside of its respective dead zone.

Thus, it’s not really one dead zone, but rather two – one for each coordinate.
 
Last edited:

SoapSuds

Smash Apprentice
Joined
Apr 17, 2014
Messages
175
@ Magus420 Magus420 I was wondering if you could add another display to show when the A button is being pressed? It's kind of lame, and I feel like I ought to be able to modify what you've provided myself to add it, but I'm not really sure where to get help in making a code like that. Anyway, other input display codes don't seem very necessary b/c most presses result in some kind of action state change. The reason I want an A button display is to work on gentlemans which I've found rely on releasing the A button during hitlag Having the input display would really help me figure out which way I'm messing the input up.

Thanks so much for the whole pack!
 

BirdmanJR

Smash Cadet
Joined
May 1, 2015
Messages
31
How important is this if I want to use debug mode to figure out the game
 

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
How important is this if I want to use debug mode to figure out the game
If you have to ask that, you probably aren’t ready to make use of it yet. The more time you spend in develop mode, the more you realize how important this mod is.
 

CeLL

Smash Lord
Joined
Jan 26, 2014
Messages
1,026
Location
Washington
Two quick questions. Has anyone converted/does anyone plan on converting this to 1.02? And is this hijacking existing displays or is it actually creating new text on the screen?
 

Stratocaster

Smash Ace
Joined
Oct 6, 2007
Messages
672
Location
Knoxville, TN
Two quick questions. Has anyone converted/does anyone plan on converting this to 1.02? And is this hijacking existing displays or is it actually creating new text on the screen?
No one has converted it to 1.02 or said they plan to afaik.

It hijacks existing displays.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
@ Magus420 Magus420 unfortunately, the "HitStn/Grab" display doesn’t work properly when the active character slots are not P1 and P2. Only P1 and P2 will show the actual hitstun when characters are hit, and while P1’s does belong to P1, the one that is labeled P2 (or, rather, "22222") will actually display P4’s hitstun.

Edit: when three characters are active, the 22222 display will show P3’s hitstun.

33333 and 44444 HitStn/Grab never displayed anything else than zero for me.

Putting this into a table:

P1 kind?|P2?|P3?|P4?|11111|22222|33333|44444
Human|None|None|None| P1 |||
Human|Human|None|None| P1 | P2 ||
None|Human|Human|None|P2|P3||
Human|Human|Human|None|P1|P3||
Human|Human|Human|Human|P1|P4||

It seems 11111 always uses the lowest active port and 22222 the highest, while 33333 and 44444 never do anything.

This bug exists for me both on Dolphin and on Gamecube. I used both of your .dol files, it’s the same for both of them. I did not modify the .dol files at all before integrating them.

In case you manage to make HitStn/Grab work for all four ports, adding the codes for "everything unlocked" would be much appreciated. Also, integrating your code that disables damage staling in develop mode (but not in debug-rom) would be super-neat.

If you are still looking for values to add to the physics display, the disabled ledge regrab period timer would be useful as well (at least to me).

Additionally, the Gamecube controller protocol and Dolphin’s emulation system seems to use different values for the analog sticks; 0-255 for both x- and y-axis. I recently took notes of how these correlate, but I haven’t been able to make sense of it. Do you know the logic Melee / the Gamecube applies to generate the directional input from the potentiometer data?

Here are my findings from something I recently did for @ Achilles1515 Achilles1515 , searching for the x / y value pairs that result in a “perfect” wavedash, in case you find them helpful:

So, I’ve started testing for the input range with Fox.
This post is mostly a worklog for myself right now, but you might find my findings interesting as well and of course, once I’m done testing this post should be finished with the x/y ratio you need for the code.

Dolphin input display X|Dolphin input display Y|CUR DIRECTI X|CUR DIRECTI Y|F1 CH VELOC X|F1 CH VELOC Y|Comment
230|101|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , “real controller” value
229|101|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
229|100|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
229|99|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle , “real controller” value
230|99|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle , “real controller” value
231|100|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
231|99|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “real controller” value
255|93|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “TAS” value
255|94|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , “TAS” value
255|93|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , “TAS” value
255|92|0.95000|-0.30000|2.66050|-0.84016| Lower than 342.0° angle, “TAS” value
203|109|0.95000|0.00000|2.79000|0.00000| This is the closest input to 342.9° that still triggers straight right , minimal value
202|109|0.95000|-0.28750|2.67039|-0.80815| Seems to be a perfect 342.9° angle , minimal value
201|109|0.93750|-0.28750|2.66739|-0.81800| Lower than 342.0° angle , minimal value

Things I’ll have to complete:
1. Find input range when pushing the stick all the way to the octagon shell with at least two different controllers
2. Check for less-than-max extension inputs, whether the x/y ratio is consistent (I’m sure it is, but I have to make sure so the code is as accurate as possible)
3. Check whether less-than-max extension inputs trigger max velocity as well

Feel free to edit your own test results into this table with your mod powers.

Dead zone is everything less than |0.28750|.

Okay, so I’ve put all of these values in an Excel sheet and found the common criteria for the perfect angle. [|CUR DIRECTI X|] / [CUR DIRECTI Y] needs to be equal to -3.30435. Keep in mind that you need to make sure that the upward angles are eliminated, not sure how this can be done in Assembly. My first approach would be to take the absolute value of x and only check for -3.30435. The minus could only be introduced by y, not by x this way.

Things I found interesting:
1. Above a certain input strenth threshold, Cur Directi X and Y seem to not care about the strength of the input, only the direction / angle seems to matter. Using tilts just outside of the control stick’s dead zone produced the same Cur Directi values and wavedash lengths as using the same angle when touching the octagon gate or even going beyond it (using Dolphin TAS input).

2. This made me finally understand why the angles between 0±(mod90) and (mod90)±17 degrees are all treated as straight (mod90) angles by the game. Before, I thought that it was intentionally coded like this so that it would be easier to hit the straight angles, but now I’m very sure that it’s simply the dead zone ignoring slight deviations from centered (128 / 0.00000), even when the other coordinate is outside of its respective dead zone.

Thus, it’s not really one dead zone, but rather two – one for each coordinate.
I think I've fully ported this awesome hack to 1.02.

I might have fixed the bug while doing so?

(Pic showing P3's hitstun/grab working. With this character setup in the picture, P2's hitstun/grab was correctly displaying it as well.)
Capture.PNG
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
@ Kadano Kadano in what way were you imagining the DI trajectory to be displayed? An angle or the adjusted velocity values?

The other BIG question for the feasibility of this is whether the launch velocity (prior to DI change) is calculated and stored to the character data offset at the beginning of hitlag or right before checking for DI. Hopefully the prior but...idk. I'm not at my comp to check.

EDIT: Nice..launch velocity is calculated at the beginning of hitlag.
 
Last edited:

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
@ Kadano Kadano in what way were you imagining the DI trajectory to be displayed? An angle or the adjusted velocity values?

The other BIG question for the feasibility of this is whether the launch velocity (prior to DI change) is calculated and stored to the character data offset at the beginning of hitlag or right before checking for DI. Hopefully the prior but...idk. I'm not at my comp to check.

EDIT: Nice..launch velocity is calculated at the beginning of hitlag.
Magus mentioned that in the DI calculation process, the current analog input is compared against the launch angle. The optimal thing would be to have a ratio of current DI / maximum possible DI, so if you hold the perfect direction, it would be 1.00. If you only hold 45° from the KB trajectory, it would be ~0.5 (less, I think?). Alternatively, an angle derivation display (for example, +17° and −17°) would be just as good, or even better.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Magus mentioned that in the DI calculation process, the current analog input is compared against the launch angle. The optimal thing would be to have a ratio of current DI / maximum possible DI, so if you hold the perfect direction, it would be 1.00. If you only hold 45° from the KB trajectory, it would be ~0.5 (less, I think?). Alternatively, an angle derivation display (for example, +17° and −17°) would be just as good, or even better.
I did it.


First float pair.
- first float is the angle the attack is sending you at.
- second float is the trajectory angle you will fly at with the current DI (live from joystick). 0 degrees equals straight right.

Third float pair = live control stick x/y floats.

The GIF is me spinning my control stick around clockwise from 3 o'clock. Then at the end, I am just trying to demonstrate that I programmed in the default dead zone ( |0.28000| ) as well. You can see I never got the full 18 degrees because my control stick is programmed poorly in Dolphin and I never go the full 1.00000 or -1.00000.

This was rather difficult.
 
Last edited:

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
I did it.


First float pair.
- first float is the angle the attack is sending you at.
- second float is the trajectory angle you will fly at with the current DI (live from joystick). 0 degrees equals straight right.

Third float pair = live control stick x/y floats.

The GIF is me spinning my control stick around clockwise from 3 o'clock. Then at the end, I am just trying to demonstrate that I programmed in the default dead zone ( |0.28000| ) as well. You can see I never got the full 18 degrees because my control stick is programmed poorly in Dolphin and I never go the full 1.00000 or -1.00000.

This was rather difficult.
Wow, so amazing!

… When will you publish your 1.02 port?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Wow, so amazing!

… When will you publish your 1.02 port?
Idk. Still working on some stuff.
I changed the way text box is displayed so I can have longer length descriptions for items. I also moved it down closer to the floats, which I find to be easier on your brain to process what is going on when changing things.

Text I am planning on using:
Code:
THIS IS THE LONGEST STRING LENGTH WITH NEW SETTINGS (30)
111111111111111111111111111111

TOP-N (X/Y COORDINATES)
ECB DIAMOND TOP
ECB DIAMOND BOTTOM
ECB DIAMOND RIGHT
ECB DIMAOND LEFT
FORCE 1: CHARACTER VELOCITY
FORCE 2: KNOCKBACK VELOCITY
FORCE 3: SHIELD KB VELOCITY
TOTAL VELOCITY
SYSTEM DIRECTIONAL INPUT
SYSTEM C-STICK INPUT
SYSTEM ANALOG L/R
DIRECTIONAL INPUT - THIS FRAME
DIRECTIONAL INPUT - PREV FRAME
SHIELD INPUT -CURRENT AND PREV
TIMER - ANY SHIELD INPUT
TIMER - DIGITAL L/R INPUT
TIMER - JUMP INPUT
TIMER - UP-B
TOTAL DAMAGE/HITLAG
HITSTUN REMAIN/ GRAB HOLD TIME
SHIELDSTUN ACTUAL / CALCULATED
SHIELD HEALTH / COLLISION SIZE
SHIELD TILT OFFSET / ANGLE
TIMER - INTANG / INVINC
HITBOX (0) X/Y COORDINATE
HITBOX (0) Z / SIZE (RADIUS)
HITBOX (1) X/Y COORDINATE
HITBOX (1) Z / SIZE (RADIUS)
HITBOX (2) X/Y COORDINATE
HITBOX (2) Z / SIZE (RADIUS)
HITBOX (3) X/Y COORDINATE
HITBOX (3) Z / SIZE (RADIUS)
JUMPS / WALLJUMPS USED
TIMER - LEDGE REGRAB DISABLE
DI TRAJECTORY ANGLE CHANGE
So the items I will be adding are
- shield tilt offset and angle
- jumps/walljumps used (@ schmooblidon schmooblidon )
- ledge regrab disable timer
- DI trajectory change angle

Capture.PNG


Anything else you can think of?
 
Last edited:

Kadano

Magical Express
Joined
Feb 26, 2009
Messages
2,160
Location
Vienna, Austria
Anything else you can think of?
Hmm …

1. Frames left until next ECB update (I think it’s every 11 frames, starting to count at the first frame of current action state, but not sure). Second value could be frames since the last ECB update.
2. Pseudo-jump flag (side-B for Marth, Roy and Mewtwo, down-B for the Mario Bros.), I don’t think that’s worth much effort though
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Hmm …

1. Frames left until next ECB update (I think it’s every 11 frames, starting to count at the first frame of current action state, but not sure). Second value could be frames since the last ECB update.
2. Pseudo-jump flag (side-B for Marth, Roy and Mewtwo, down-B for the Mario Bros.), I don’t think that’s worth much effort though
This is in reference to ECB Bottom only, right?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
I’m pretty sure all 4 ECB reference points are updated simultaneously, but yeah, the bottom is usually the only one that’s important.
Doing a little bit of research on the topic now -
They are all updated simultaneously, but there is flag the game checks for changing the update value for the bottom to zero, instead of the normally calculated value. This flag is set after entering the air from a grounded jump or immediately after an aerial jump. The flag is controlled by a timer set to 10 frames, which is discussed in Schmoob's platform physics video.

Top, Left and Right seem to update every frame, always. Correct me if I am wrong, with this though.
 
Last edited:

schmooblidon

Smash Journeyman
Joined
Feb 18, 2014
Messages
496
Doing a little bit of research on the topic now -
They are all updated simultaneously, but there is flag the game checks for changing the update value for the bottom to zero, instead of the normally calculated value. This flag is set after entering the air from a grounded jump or immediately after an aerial jump. The flag is controlled by a timer set to 10 frames, which is discussed in Schmoob's platform physics video.

Top, Left and Right seem to update every frame, always. Correct me if I am wrong, with this though.
This is pretty much what I observed, although it doesn't set it to 0, it sets it to the previous frames value. At least it definitely does this for doublejumps and grabbing the ledge, I only assume it also does this for entering the air as it is at 0 when grounded.

Also grabbing ledge starts the timer on the 2nd frame, and the first frame has the ECB of what the previous states next frame would look like.

Has anyone else had trouble with widescreen with this mod? I want to start using it but when I turn on true widescreen support on dolphin 6554, I get errors.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Would a "frame stopwatch" be useful? You could reset it to zero anytime and it will just keep counting up. I could see it being helpful for something like finding the fastest ways to grab an edge with a character, because this would involve counting frames during multiple action states. The stopwatch would do all the counting for you (although this could already been done with the default match frame counter from the X+Dpad Right command that was remapped to the player number in this mod).
 

SuperSmashNoob

Smash Rookie
Joined
Jun 5, 2014
Messages
18
That sounds pretty useful, counting frames by hand is a hassle.

If you're still taking requests I have a suggestion, I don't know how feasible it is since I only got into this stuff recently.

Position, orientation, and scaling of hurtboxes and/or bones (maybe with only enough float pairs to display one at a time with a separate control to cycle through them since there are a decent bit of them). I'd like to be able like to look at this stuff to get a precise idea of animations and maybe try to figure out how Melee's bone jiggle system works (like on Fox's tail during many animations, assuming this hasn't been done already)

Thanks for all your guys' hard work by the way.
 
Top Bottom