1 2
5 6 7
12 13
Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Scumtron wrote:
Pasky13: Actually it appears that the spin-slash just always goes off the swing animation hit box for the level 1 boss, and probably works similarly for other enemies with variable boxes. Interesting. You're probably right about the level 3 boss, or could it just be a bug? His effective hit box when jumping always seemed pretty much the size and shape of the crouching hit box that your script shows. The only other issue I've noticed is with the mind control orb on the 6-4 boss: slashes well outside the script-displayed box do damage. That said, thank you for making this, it's been lovely to see so many things visualized like this. About the background visualization script: I didn't mean to sound like I was asking you to make it for me. I know you only bothered with this because mikwuyma on SDA asked you. But if you could say a little about how you knew where to find those arrays in the ROM, or how you got to "etype = 0x0438" (I had those addresses tagged as something vague and TAS-irrelevant myself, and had assumed that 0x0400-0x0407 would be the important ones for something like this) I would greatly appreciate it. feos: I have indeed watched your WIP, though I haven't analyzed it too closely. Providing some input on it (and finishing the game resource page I started) have been nagging at me for a while now, but I just haven't made the time for it. Do you have a more recent WIP now?
I've also noticed that some enemies that have multiple box types, like the guys on stage one whose box will change when they have their weapon over their head, that area can't be hit with the sword. Not sure how the game determines you can hit them since only one box type is loaded at a time (the etype, which usually shifts between 3 values per enemy) Oh I didn't take it as you requesting for me to do, I was just humbling replying I don't really have the time or interest to look at it. But ya, the boxes were a request from Sinister1 actually, who has been bugging me about it for a couple months haha. As far as how I got the etype address, I got it by finding ryu's X,Y and a bosses X,Y and getting hit and setting a breakpoint when ryu got hit and tracing up until the breakpoint:
$E144:BC 38 04  LDY $0438,X @ $043F = #$1E   A:00 X:07 Y:30 S:F7 P:NvUbdIzc	; Load Enemy type
$E147:A9 01     LDA #$01                     A:00 X:07 Y:1E S:F7 P:nvUbdIzc
$E149:85 94     STA $0094 = #$01             A:01 X:07 Y:1E S:F7 P:nvUbdIzc
$E14B:38        SEC                          A:01 X:07 Y:1E S:F7 P:nvUbdIzc
$E14C:BD 60 04  LDA $0460,X @ $0467 = #$89   A:01 X:07 Y:1E S:F7 P:nvUbdIzC	; Load enemies X
$E14F:E5 86     SBC $0086 = #$80             A:89 X:07 Y:1E S:F7 P:NvUbdIzC	; Subtract Ryu's X
$E151:10 07     BPL $E15A                    A:09 X:07 Y:1E S:F7 P:nvUbdIzC	; Branch on Plus (taken)
$E15A:D9 00 B3  CMP $B300,Y @ $B31E = #$0A   A:09 X:07 Y:1E S:F7 P:nvUbdIzC	; Enemy X Radius  (B400 Y Radius base) (Y register = enemy offset)  ($B300 is a bankswitched portion of the rom that is located at 3310 inside the games ROM)
$E15D:10 0C     BPL $E16B                    A:09 X:07 Y:1E S:F7 P:NvUbdIzc
$E15F:38        SEC                          A:09 X:07 Y:1E S:F7 P:NvUbdIzc
$E160:A5 8A     LDA $008A = #$A0             A:09 X:07 Y:1E S:F7 P:NvUbdIzC	; Load Ryu's Y
$E162:FD 80 04  SBC $0480,X @ $0487 = #$A0   A:A0 X:07 Y:1E S:F7 P:NvUbdIzC	; Subtract enemies Y
$E165:30 05     BMI $E16C                    A:00 X:07 Y:1E S:F7 P:nvUbdIZC	; Branch on Minus
$E167:C5 90     CMP $0090 = #$19             A:00 X:07 Y:1E S:F7 P:nvUbdIZC	; compare against Ryu's Y radius
I think.....therefore I am not Barry Burton
Player (151)
Joined: 5/1/2006
Posts: 150
Pasky13 wrote:
I've also noticed that some enemies that have multiple box types, like the guys on stage one whose box will change when they have their weapon over their head, that area can't be hit with the sword. Not sure how the game determines you can hit them since only one box type is loaded at a time (the etype, which usually shifts between 3 values per enemy)
And it's not as if sword attacks act as if the hit box doesn't change either: they can't hit the vertical extension, but also don't connect with horizontal area that shrinks when the box changes, while the spin-slash and Ryu seem to obey both boxes. Huh.
Pasky13 wrote:
Oh I didn't take it as you requesting for me to do, I was just humbling replying I don't really have the time or interest to look at it. But ya, the boxes were a request from Sinister1 actually, who has been bugging me about it for a couple months haha. As far as how I got the etype address, I got it by finding ryu's X,Y and a bosses X,Y and getting hit and setting a breakpoint when ryu got hit and tracing up until the breakpoint:
$E144:BC 38 04  LDY $0438,X @ $043F = #$1E   A:00 X:07 Y:30 S:F7 P:NvUbdIzc	; Load Enemy type
$E147:A9 01     LDA #$01                     A:00 X:07 Y:1E S:F7 P:nvUbdIzc
$E149:85 94     STA $0094 = #$01             A:01 X:07 Y:1E S:F7 P:nvUbdIzc
$E14B:38        SEC                          A:01 X:07 Y:1E S:F7 P:nvUbdIzc
$E14C:BD 60 04  LDA $0460,X @ $0467 = #$89   A:01 X:07 Y:1E S:F7 P:nvUbdIzC	; Load enemies X
$E14F:E5 86     SBC $0086 = #$80             A:89 X:07 Y:1E S:F7 P:NvUbdIzC	; Subtract Ryu's X
$E151:10 07     BPL $E15A                    A:09 X:07 Y:1E S:F7 P:nvUbdIzC	; Branch on Plus (taken)
$E15A:D9 00 B3  CMP $B300,Y @ $B31E = #$0A   A:09 X:07 Y:1E S:F7 P:nvUbdIzC	; Enemy X Radius  (B400 Y Radius base) (Y register = enemy offset)  ($B300 is a bankswitched portion of the rom that is located at 3310 inside the games ROM)
$E15D:10 0C     BPL $E16B                    A:09 X:07 Y:1E S:F7 P:NvUbdIzc
$E15F:38        SEC                          A:09 X:07 Y:1E S:F7 P:NvUbdIzc
$E160:A5 8A     LDA $008A = #$A0             A:09 X:07 Y:1E S:F7 P:NvUbdIzC	; Load Ryu's Y
$E162:FD 80 04  SBC $0480,X @ $0487 = #$A0   A:A0 X:07 Y:1E S:F7 P:NvUbdIzC	; Subtract enemies Y
$E165:30 05     BMI $E16C                    A:00 X:07 Y:1E S:F7 P:nvUbdIZC	; Branch on Minus
$E167:C5 90     CMP $0090 = #$19             A:00 X:07 Y:1E S:F7 P:nvUbdIZC	; compare against Ryu's Y radius
Thanks for that, I get the gist of it at least. Guess I've still got some learnin' to do if I really want to see those walls and platforms visualized.
Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Ya, I'm assuming the drawings are indeed on the correct frame due to using gui.registerbefore() to draw the items, so i guess the lua engine being a frame early/late wasn't the issue after all, guess there is just something else going on with the hit detection. I also ported the script over to Bizhawk, since Bizhawk can access PRG ROM in its lua engine there is no need to use the arrays. Unfortunately at this time, Bizhawk's lua engine is drawing what I believe to be a frame early: Adelikat is looking into it at the moment and should be fixed. https://code.google.com/p/bizhawk/source/browse/trunk/BizHawk.MultiClient/output/Lua/NinjaGaiden_Hitbox.lua
I think.....therefore I am not Barry Burton
Player (151)
Joined: 5/1/2006
Posts: 150
Following up on this post I made a year ago, here's something from a conversation I recently had via PM on another forum:
MottZilla wrote:
The playfield as I recall uses a sliding window. As the camera moves this window is updated with physics information. This information is at $0300 in memory. It is $C0 in size. Blocks are 16x32. However they are actually 16x16, but the high/low nibble of each byte is related to the top or bottom half of the block. So represented should be a 512x192 area. Not unlike the NameTable/Background layer. The values (remember that each nibble is a block) for blocks are: 0 = Void 1 = Climb while facing left 2 = Climb while facing right 3 = Climb facing either direction 4 = Stand Ontop/Platform 5 = Solid Block when moving to the Right, Void when moving to the left. You can stand ontop of it and you can climb on it when facing right. 6 = Solid Block completely and Climbable from either side. 7 = Stand Ontop/Platform 8 = Solid Block 9 = Ladder Climb when facing right A = Glitch B = Glitch C = Crash/Reset D = Ladder Area Change (Forward) E = Ladder Area Change (Backward) F = Next Sub-Act, Fade Out and In.
For clarity's sake, I'll add that where he says 'climb', 'cling' might be more accurate since ladders (9) are the only thing that Ryu can climb with up/down in NG1. Also, 'C' proceeds to a cinema in the three stages that go directly to one when you exit (4-1, 5-3, 6-3), but elsewhere it will indeed crash the game. So here's a script (pre-formatted hex-viewer) to display that stuff:
Language: lua

local function viewbg() local addr = 0x0300 local x=0;y=8 for i = 1, 32 do for i = 1, 6 do hi = SHIFT(memory.readbyte(addr),4) lo = AND(memory.readbyte(addr),0xf) if hi == 0 then gui.text(x,y," "); y=y+8 else gui.text(x,y,string.format("%X",hi)); y=y+8; end if lo == 0 then gui.text(x,y," "); y=y+8 else gui.text(x,y,string.format("%X",lo)); y=y+8; end addr=addr+1 end x=x+6;y=8 end end emu.frameadvance() gui.register(viewbg)
With it you can see how annoyingly prevalent 8's are mid-platform in 2-2 (Ryu loses 1 frame of forward movement when landing on anything that isn't a 7), how an 8 or 0 right of a 9 lets Ryu grab a phantom wall section for 1 frame, or how in a few spots the game will load some an F or two tantalizingly just off-screen. Beyond that, I don't see much TAS-relevant use for this for now. Pasky13: Bizhawk 1.0.5 doesn't seem to like your bitwise stuff: "lua:29: attempt to index global 'bit' (a nil value)." Guessing I'd need an interim build for that.
Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Scumtron wrote:
Pasky13: Bizhawk 1.0.5 doesn't seem to like your bitwise stuff: "lua:29: attempt to index global 'bit' (a nil value)." Guessing I'd need an interim build for that.
Oh, you need to use the latest SVN, sorry about not mentioning that.
I think.....therefore I am not Barry Burton
Skilled player (1150)
Joined: 5/11/2011
Posts: 425
Location: China
Hi, marx. I have watched you wip, there are 2 problems. 1. you used the wrong rom. Your rom is Ninja Gaiden (U) [b1].nes. U should use the rom like this: Ninja Gaiden (U) [!].nes. [!] means perfect dump. The rule said the rom must be good. 2. what's wrong with this? |2|R.......|........|| In your fm2 file's line 2871. The flag 2 means reset the game. Is it a bug in fceux?
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
mtvf1 wrote:
Hi, marx. I have watched you wip, there are 2 problems. 1. you used the wrong rom. Your rom is Ninja Gaiden (U) [b1].nes. U should use the rom like this: Ninja Gaiden (U) [!].nes. [!] means perfect dump. The rule said the rom must be good. 2. what's wrong with this? |2|R.......|........|| In your fm2 file's line 2871. The flag 2 means reset the game. Is it a bug in fceux?
i'll remake that mistakes and thats just demo
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
Player (151)
Joined: 5/1/2006
Posts: 150
I'm still holding out hope that this glitch will have some time-saving application, so I've spent some time trying to better understand it Demonstration .fm2 Summary of what I think I know: Normally $75 is always 0. It's read from and written to once every frame of player control, and appears to be used simply to set the X register so a DEX will set the N flag (though if that's the intended behavior, why mess with $75 at all when a LDX #$00 could have done the same job?). But if Ryu takes damage at the same time as delivering the killing blow on a boss, then $75 gets set to 4. So, when that DEX mentioned earlier occurs and that N flag isn't set, the game branches into a loop to decrement the X register to the expected 0—a loop that would normally come much later in the frame. In this loop the value of $74 (which appears to be used as an offset for the different object positions in memory, 0-7) is also being decremented, which ends up meaning that speed values are sometimes not added to enemy projectile positions. It's a small difference, but as the linked movie shows, though with an undesirable result, it can be enough to matter. What I'm missing is why this only occasionally happens. The number of objects on screen and the affected projectile's position (0-7) in the objects active at the time are probably factors, but I haven't picked up on a pattern there yet. The other aspect I haven't really examined is the initial triggering of the glitch, when Ryu takes a hit on boss death (I'm pretty sure it can happen when other stuff takes damage instead of Ryu too), but here are trace logs feos posted when we were discussing this on IRC a while back: no damage, damage trace logs comparing normal behavior with an occurrence of a bullet being affected (the 'snips' are for long , identical segments and I was using the begin/end to view the logs in np++ with Ruby syntax so differently branching segments could be collapsed): $75=0, $75=4 EDIT: Couple of things I overlooked. Defeating the Masked Devil/mind-control orb with the sword or jump-n-slash always results in $75=02 and after fast-forwarding through BoltR's and Slotermeyer's runs I noticed that they both finish the level 3 boss with the firewheel which gets $75=04 too, and it turns out that killing any boss with the throwing star, windmill star or firewheel has the same effect—or $75=05 instead of 02 in the case of the first of the final three bosses.
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
Hey scumtron. Will you quit tasing after you submit this tas?. What are your future project(you seem to tas ng games only)
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
Player (151)
Joined: 5/1/2006
Posts: 150
Marx wrote:
Hey scumtron. Will you quit tasing after you submit this tas?.
Idunno. Maybe! What's it to ya?
Marx wrote:
What are your future project(you seem to tas ng games only)
I have little interest in revisiting the other two NES NG games right now, but there are some other non-NG things I might look into.
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
I would like to see you TASing other games.
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
Fixed.
Marx wrote:
I would like to see you TASing other games too.
Can you share your plans, Scum?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
His TASes deserves stars too. Imagine no one has ever obsolete his TASes
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
Player (151)
Joined: 5/1/2006
Posts: 150
Hey you guys, this is the Ninja Gaiden thread, not the Scumtron thread! Though I guess I didn't explicitly say so in the previous post about it, at the time I was assuming that the $75 glitch could prevent speed from being added to projectile positions at any time the projectiles are on screen, not just on the frame they're spawned. But it actually appears that it does only happen on the frame a projectile is spawned, except the effect is not limited to the projectile being spawned. Though it should be noted that the only instance I've yet found of an pre-existing projectile not having its speed added was when it would have otherwise gone off-screen at the same time another was spawned, resulting in the new projectile taking a different position in memory. Anyway, what needs to be known if this glitch can applied somehow, is what determines why it only happens sometimes, and short of a detailed disasm I don't have any good ideas about how to go about investigating that... and as I'm typing this it's occurring to me that the number of objects on-screen has to be key... hm. Side note: I did check if Ryu's projectiles might be similarly affected and they are not.
Player (50)
Joined: 1/19/2009
Posts: 100
feos wrote:
http://dehacked.2y.net/microstorage.php/info/1651353856/NinjaGaidenPacifist-3Levels.fm2 Please point out my mistakes. I'll revisit the second level anyway. Can green-grey witches be manipulated? EDIT: updated the movie, as I completed one more stage.
I have managed to shave off ~18 frames from your level 1 and got a 119 on the game timer. :) Also you didnt hit the boss from the furthest frame the first time so i saved a few frames there as well. http://dehacked.2y.net/microstorage.php/info/1068355451/ninjagaiden1-0.fm2
Player (50)
Joined: 1/19/2009
Posts: 100
Oh and the Lvl 1 I posted can probably even save a couple more frames as I didn't check for trap floors while making it.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
Will you continue? I saved 3 more frames up to the middle of your 1-1, but 2 frames were lost due to tysons difference at 1430 and then I was too far forward, so a wall double-jump at 1735 landed me right on the warrior, while doing that jump a frame later caused me to fall off the roof in the first place. I use to give up once I get such crap, but it will be pointless if you stop it too. You don't have to save trap floor frames in 1-1.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Post subject: Ninja gaiden: projectile glitch YouTube
Joined: 3/18/2006
Posts: 971
Location: Great Britain
Link to video
Scumtron wrote:
I'm still holding out hope that this glitch will have some time-saving application, so I've spent some time trying to better understand it Demonstration .fm2
Post subject: Ninja gaiden pacifist wip: YouTube
Joined: 3/18/2006
Posts: 971
Location: Great Britain
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
GUYS CHECK THIS OUT http://dehacked.2y.net/microstorage.php/info/1120657590/Ninja_gaiden.fm2 PLay all ninja gaiden with one movie
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
Player (50)
Joined: 1/19/2009
Posts: 100
feos wrote:
Will you continue? I saved 3 more frames up to the middle of your 1-1, but 2 frames were lost due to tysons difference at 1430 and then I was too far forward, so a wall double-jump at 1735 landed me right on the warrior, while doing that jump a frame later caused me to fall off the roof in the first place. I use to give up once I get such crap, but it will be pointless if you stop it too. You don't have to save trap floor frames in 1-1.
I would be interested in maybe doing a partnered tas with you or Marx if either of you would like to.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
Okay, then, when I am in mood I will resume test run, try improving it and post here. I would use this scheme anyway, because it's better to do the whole test, then totally redo, than trying to make each level optimized instantly. Marx seems more interested in a no-damage pacifist.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (50)
Joined: 1/19/2009
Posts: 100
feos wrote:
Okay, then, when I am in mood I will resume test run, try improving it and post here. I would use this scheme anyway, because it's better to do the whole test, then totally redo, than trying to make each level optimized instantly. Marx seems more interested in a no-damage pacifist.
Do you ever log into IRC? It would be much easier if you do. Either way we should pm so as not to clutter the thread.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
Tyson's actions seem to depend on your position relatively to him. And you can affect the position he spawns at by changing the position the previous enemy in that slot despawns at: http://tasvideos.org/GameResources/NES/NinjaGaiden.html#InheritedSubPixels UPD: tyson's attack also depends on his jumping pattern, that depends on Y pixel & subpixel, subpixel is got from the previous enemy as well. EDIT: Saved 2 frames over your stage 1 + boss! Better bouncing off the last tyson. You touch him when he is jumping, and spend more time with 1.0 speed. I touch him whlie he is on the ground. This saves some of my improvement and helps to prevent additional 1-frame boost you get before hitting the door. The boss is 0.5 pixel closer to me when I enter his room, but I still couldn't hit him sooner. EDIT 2: Revised level 2. We saved overall 70 frames comparing to my first wip. Starting lvl 3. http://tasvideos.org/userfiles/info/3971327318803844
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (124)
Joined: 3/23/2012
Posts: 296
Location: In X position=50 y position=20
Well I can help a few. Some tips: Feos second boss fight is sloppy.It can do same application as first one.
Jungon wrote:
if I was to have a Tool-Assisted real life ... I'd.. I could abuse death, just to see if it saves time ..
1 2
5 6 7
12 13