Post subject: The Little Mermaid
Joined: 1/1/2022
Posts: 1716
Hello all!! I've been working on a speed run that I've recently submitted to Bisqwit. Anyways, I was wondering if anyone knew of some glitches in this game?? Thanks in advance! Ryan
Former player
Joined: 4/16/2004
Posts: 1276
Location: Uppsala, Sweden
What time did you have? I did it also, perhaps a little bad =/
/Walker Boh
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Seven years and two publications later... On those days when I can't sleep, I get funny ideas, like the thought that there might actually be a real [submission 3210]ten frame improvement[/submission] to the [movie 529]current five-year-old run[/movie]. Several intensive hours later, I give you a three frame improvement to Stage 1. This really should be a seven frame improvement - I have a five frame lead at the time I exit the second room, and pick up another two by the time of the third hit on the boss, but the boss reappears two frames later than one would expect from the timing of the third hit, and the end-of-level potion appears another two frames late (relative to the last hit). I haven't figured out why this is the case as yet (frame rules, possibly?). Some RAM address for the curious, or for those interested in contributing (this was absurd enough to try to improve that I may not be keen on continuing):
  • $0340 - X, high pixel byte.
  • $0330 - X, low pixel byte.
  • $0320 - X, subpixel byte.
  • $0370 - Y, high pixel byte. The high byte seems to cycle in the wrong direction - it increases when the low byte underflows, and vice versa.
  • $0360 - Y, low pixel byte.
  • $0350 - Y, subpixel byte.
  • $0390 - X speed, pixel byte. This doesn't seem to be signed - it really is a speed as opposed to a velocity (i.e. the direction isn't indicated).
  • $0380 - X speed, subpixel byte.
  • $03B0 - Y speed, pixel byte.
  • $03A0 - Y speed, subpixel byte.
So... who's up for more work on this?
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
sgrunt wrote:
Seven years and two publications later... On those days when I can't sleep, I get funny ideas, like the thought that there might actually be a real [submission 3210]ten frame improvement[/submission] to the [movie 529]current five-year-old run[/movie].
And thus spoketh Anoobis, God of minor TAS improvements, thou shalt work on Little Mermaid until it is finished.
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Expert player (3644)
Joined: 11/9/2007
Posts: 375
Location: Varberg, Sweden
Managed a 2-frame improvement upon entering the boss (and should be further improvable I think), don't know whether it'll be kept after the boss though. Having tested it now, I'm pretty sure I won't continue since it doesn't seem to show any greater TAS-potential. http://dehacked.2y.net/microstorage.php/info/623864852/Little%20Mermaid%2C%20The%20%28U%29loltest.fm2
feos wrote:
Only Aglar can improve this now.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
I spliced together your improvement and the boss fight. It looks like your two frames stick. Now I'm more confused as to what's going on. Something with the boss fight itself, possibly?
Expert player (3644)
Joined: 11/9/2007
Posts: 375
Location: Varberg, Sweden
Maybe you could try playing the boss exactly as AnS did to see if it'll end up faster..
feos wrote:
Only Aglar can improve this now.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
I did some quite extensive analysis of how the game physics works for this game some months ago. Thanks to this I was able to improve: *The first room by 9 frames. *The second room by 5 frames. When you move diagonally, you accelerate faster than when you go horizontally, up until your X speed is 26. Here's the movie file. I also made comments on how X movement works, hopefully you can get something out of them.
X movement:

[x] means the value of RAM address x.
:= means "is defined as"

Useful RAM addresses:
[0390] = X pixel speed := x1
[0380] = X subpixel speed := x2

X speed = xs:= 256*x1+x2

[0031] = direction.
[0031] = 2 if moving right
[0031] = 1 if moving left

Assuming you're standing still and start holding down right.
When you start accelerating (i.e. The first frame xs>0) depends on 
[0400] = start accelerator := a1

If a1>=192, you start accelerating immediately
In practice, a1 is either 144 or 208.
It is set to 144 if you stop from going left,  i e when [0031] goes from 2 to 0.
It is set to 208 if you've recently moved right,  i e when [0031] goes from 1 to 0.

Another important RAM address is [0036]. It is your X acceleration.
[0038] is an in game timer. [0036] increases only when [0038] is odd.

Assume you have X speed S1 on frame F and you can accelerate. Assume [0036]=A1 and [0038]=T.
Assume that your Y speed on frame F is Sy. We want the X speed S2 on frame F+1.
Let d1 be your direction on frame F, and d2 your direction on frame F+1. direction = [0031]
Let A2 be the value of [0036] on frame F+1. d1 is your direction on frame F, and d2 on frame F+1.
The following pseudo-code will give the answer:

You press right+B on frame F:

Set T1=mod(T,2)

If T1==1 then A2=A1 end
If S1<512 and T1==0 and Sy<A1 and A1<31>A1 and S1>=338 and A1>=1 then A2=A1-1 end

S2=MIN(512,S1+A2)

You press right+down+B on frame F:

Set T1=mod(T,2)

If T1==1 then A2=A1
elseif T1==0 and S1<=361 and d1==d2 then A2=A1+2
else A2=A1+1 end

S2=MIN(362,S1+A2)
I want to improve the published run sometime in the future, but I have a lot of other projects going on right now so this will have to wait. I welcome anyone else who wants to try this!
Expert player (3644)
Joined: 11/9/2007
Posts: 375
Location: Varberg, Sweden
I added a little something at the end of the first room I found during my earlier session that saved 1 frame. If you're moving horisontal and are about to turn sideways down (or up) you should make the turn by first holding sideways down for one frame, then just holding down as long as the horisontal speed is > [1 pixel and 106 subpixels] / frame. This should be used in every such turn. And good luck Randil if you'll eventually pick up this game, it does quite seem like a Randil-game to me:) http://dehacked.2y.net/microstorage.php/info/342441322/Little%20Mermaid%2C%20The%20%28U%29randagl.fm2
feos wrote:
Only Aglar can improve this now.
Brandon
He/Him
Editor, Player (191)
Joined: 11/21/2010
Posts: 914
Location: Tennessee
I hope this run is improved on. adelikat and I both have this game, and we both have a NESBot, yet the old run desyncs as of right now. That's just sad. :(
All the best, Brandon Evans
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Wow, Randil. Wow. Are you, per chance, Anoobis's disciple?
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
How do you know it's not the other way around? :)
Expert player (3644)
Joined: 11/9/2007
Posts: 375
Location: Varberg, Sweden
He noticed you didn't bring up the case in my last post, something that Anoobis of course would've included.
feos wrote:
Only Aglar can improve this now.
Skilled player (1742)
Joined: 9/17/2009
Posts: 4984
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Brandon wrote:
I hope this run is improved on. adelikat and I both have this game, and we both have a NESBot, yet the old run desyncs as of right now. That's just sad. :(
Do the run desync at similiar points? If so, then it may be the emulator's fault, not the game. Or at least that's what I think.
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
Randil, Aglar, one or both of you better be working on this, since you guys found such great stuff about it.
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3574)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
jlun2 wrote:
Brandon wrote:
I hope this run is improved on. adelikat and I both have this game, and we both have a NESBot, yet the old run desyncs as of right now. That's just sad. :(
Do the run desync at similiar points? If so, then it may be the emulator's fault, not the game. Or at least that's what I think.
Yes it desyncs in the same spot for both of us. Sadly it is about 90% into the run, and it looks easily avoidable. Looks like AnS "plays with death" with an enemy, and on the real console it isn't quite so successful :(
It's hard to look this good. My TAS projects
Personman
Other
Joined: 4/20/2008
Posts: 465
You guys. I love you guys. So much. Please write more delicious words about the inner workings of this poor, defenseless game.
A warb degombs the brangy. Your gitch zanks and leils the warb.
AnS
Emulator Coder, Experienced player (728)
Joined: 2/23/2006
Posts: 682
adelikat wrote:
Looks like AnS "plays with death" with an enemy, and on the real console it isn't quite so successful :(
Haha, RL is rough. Can I watch that video? About obsoleting, best of luck to you guys, as I don't feel like improving this run myself. But I'm sure you can squeeze at least one and half a second (plus these 10 wasted frames at the end), because in later levels there are more complex paths with many turns, where subpixel management can save several frames each time. When I was making this run I didn't even know about subpixels, memory watching, lag and other stuff (was using only savestates + frame advance). Also luck manipulation was probably less efficient than it could be. In 2009 I was planning to improve the run, but it was the time when I started losing interest in TASing, so it didn't happen. Here's some lua script I made back then: http://shedevr.org.ru/temp/sound/mermaid.lua You may find it useful to measure passed distances on 2-dimensional plane. I'd be happy if Randil and Aglar cooperated together to make this run. Just don't forget to put some funny scenes in boss battles. And if you think the game is too simplistic for pulling new antics, I encourage you to copy/recreate some of my old stuff (like the battle with 2 eels or seashell juggling with walrus). Because I've seen too many old runs degrade into pure speedruns, I don't wish this to happen with the game.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
I've been playing around a bit more with this. Thanks to Aglar's trick, and some other optimizations I shaved off 5 more frames from the first screen: http://dehacked.2y.net/microstorage.php/info/457082358/Little%20Mermaid%2C%20The%20%28U%29.fm2 I'll play around with this some more, but this is not my highest priority right now, so I don't know how much I'll work on this. EDIT: Making good progress tonight, up to the boss, 22 frames ahead of the published run: http://dehacked.2y.net/microstorage.php/info/1909616475/Little%20Mermaid%2C%20The%20%28U%29.fm2 Since this was made rather fast, I'll revise it to try and spot improvements, but the game is quite friendly to TAS once you get the hang of the physics. Total frames saved: *first room: 14f *second room: 5f *third room: 3f
Expert player (3644)
Joined: 11/9/2007
Posts: 375
Location: Varberg, Sweden
My spontaneous thought is that a run of this game isn't really in need of co-operation. Of course I could always try to be of assistance if Randil needs help with certain situations in the run.
feos wrote:
Only Aglar can improve this now.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
10 frames saved on the boss. Most of the time was saved by manipulating him to appear at the very top of the screen on his second appearance, which makes his sprite disappear from screen earlier when he dies, which in turn makes the urn appear sooner. http://dehacked.2y.net/microstorage.php/info/1148894821/Little%20Mermaid%2C%20The%20%28U%29.fm2 Now 32 frames ahead. I will add some antics after the boss fight tomorrow, I just wanted to show the strategy I used. EDIT: Now finished the first 4 rooms of level 2. Currently 43 frames ahead. http://dehacked.2y.net/microstorage.php/info/859641484/Little%20Mermaid%2C%20The%20%28U%29.fm2 Improvements: *Room 1: 6f *Room 2: 4f *Room 3: 0f *Room 4: 1f What are your thoughts on the antics after the first boss? I did pretty much the same "bounce against my bubbles" thing that AnS did (I hope that's ok). I think I will slow down a bit and review the completed sections. Maybe I'll write a bot or matlab script too.
AnS
Emulator Coder, Experienced player (728)
Joined: 2/23/2006
Posts: 682
Great, you saved more frames than I thought was possible. Looks good so far.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
Thanks! I'm going to have to redo the run though (I've already redone it up to the level 1 boss), because I found an additional 3 frames to be saved in level 1, one in each of the rooms. http://dehacked.2y.net/microstorage.php/info/194715624/Little%20Mermaid%2C%20The%20%28U%29.fm2 These were saved thanks to new findings about the game's physics. I'll probably be able to improve level 2 further too. This game sure has complex physics for a NES game! EDIT: First boss and first room of level 2 redone. The boss is beaten exactly as fast as in the old WIP, but I managed to squeeze out 3 more frames from the first room of level 2. This means that this WIP is now 6 frames ahead of my old WIP. http://dehacked.2y.net/microstorage.php/info/1100102293/little_mermaid_randil.fm2 EDIT2 (2011-07-21): Now up to the boss on level 2. 58 frames ahead of the published run: http://dehacked.2y.net/microstorage.php/info/1685695529/little_mermaid_randil.fm2
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
Randil wrote:
EDIT2 (2011-07-21): Now up to the boss on level 2. 58 frames ahead of the published run: http://dehacked.2y.net/microstorage.php/info/1685695529/little_mermaid_randil.fm2
Cool, do you plan on continuing?
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Skilled player (1827)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
DarkKobold wrote:
Randil wrote:
EDIT2 (2011-07-21): Now up to the boss on level 2. 58 frames ahead of the published run: http://dehacked.2y.net/microstorage.php/info/1685695529/little_mermaid_randil.fm2
Cool, do you plan on continuing?
Yep, I'm just gonna wrap up the work on Shadowgate, then I'll put my focus on this game again.