News:

11 March 2016 - Forum Rules

Main Menu

Zelda AoL animation and movement code dump?

Started by ShadowBlitz16, February 10, 2015, 04:29:03 PM

Previous topic - Next topic

ShadowBlitz16

just wondering if there is a animation and movement code dump for  Zelda AoL rom for nes?

I'm trying to make a zelda 2 battle game in gamemaker studio and I want it to be exactly like the nes movement and animation
so far all I know is that the game runs at 60 fps

PhyChris

there are no NES games that run on hardware at 60fps. max is 30fps. if you end up writing a good zelda 2 character controller, I would LOVE to see it. zelda 2 is my fav zelda

ShadowBlitz16

hmm weird I'm using jnes emulator and It says its running at 60 fps It also seems to say that here http://forums.emulator-zone.com/archive/index.php/t-7888.html
anyways ya I want it to be a very close to the original mechanics so :)

PhyChris

thats because you are using a emulator. nes only 30fps max

furrykef

Um, dude. If the hardware only ran at 30 FPS, and an emulator ran it at 60 FPS, everything in the game would be moving twice as fast.

As someone who has firsthand experience coding the NES in ASM, I can say with authority that the hardware runs at 60 FPS.

Dr. Floppy

^^^ What Furrykef said. ^^^

One can confirm this by monitoring the RAM frame counter in their game of choice. It takes just over four seconds for said counter to complete a single [00-FF] cycle.

PhyChris


ShadowBlitz16

so is there a way I can get a hold of the coding for link's movement and animations then?

weissvulf

It's probably not the simple solution that you're hoping for, but on most sprite animations each frame is stored as simple 2D image. If you save each image from the animation (TileMolestor etc), couldn't you reassemble them into an animation in gamemaker studio?

About the NES frame rate, isn't there a difference between frames "sampled per second" and frames "drawn per second". The time it takes for a game to construct a new frame usually depends entirely on the efficiency of the games code. A monitor (or TV) may sample a frame 60 times per second, but it's likely showing many duplicate frames because the game doesn't update that fast. I've seen NES games that lag. Why would they lag if they always draw 60FPS? My guess would be that most game's draw rates are actually closer to 15-25FPS and the 60FPS mentioned is simply the sample rate- most of which are duplicate frames. I don't mean to sidetrack your thread ShadowBlitz; I thought this info might apply to how complex it would be to rebuild sprite animations manually.   :thumbsup:

Seihen

Quote from: weissvulf on February 12, 2015, 06:41:30 PM
It's probably not the simple solution that you're hoping for, but on most sprite animations each frame is stored as simple 2D image. If you save each image from the animation (TileMolestor etc), couldn't you reassemble them into an animation in gamemaker studio?

I don't think ShadowBlitz16 is asking for the sprites (you can probably find a sprite sheet easily somewhere), but asking for the exact physics that the original game used, to recreate it in GameMaker as close to the original as possible. For example, how much vertical movement per frame when jumping, velocity and acceleration when falling, etc.

Unfortunately, I think this stuff (though fascinating) would have to be figured out the hard way: recording a video of your gameplay and doing a frame-by-frame count of jumping and movement, doing some math, and figuring it out yourself (and how to code it into GameMaker).

Would love to see what this project leads to, though. Do you have a project page setup somewhere?

weissvulf

Ah, I see. It might not be too hard to get an emulator with a debugger and set a "break" in a location that will trigger once every drawn frame. Start an animation and then trigger the break immediately. Every time the game hits the break and pauses, take a screen shot before continuing. That should let you capture the relative motion and duration for each sprite used during an animation. If your emulator uses the game's actual resolution, you should be able to track the number of pixels moved (left, right, up, down) by comparing to stationary objects. :o

Seihen

I feel like this was discussed (relatively) recently by someone who wanted to recreate the exact physics of Megaman, and actually did use frame-by-frame counting. Maybe a search of the message board might help to get some ideas?

Dr. Floppy

#12
Quote from: weissvulf on February 12, 2015, 06:41:30 PM
About the NES frame rate, isn't there a difference between frames "sampled per second" and frames "drawn per second". The time it takes for a game to construct a new frame usually depends entirely on the efficiency of the games code. A monitor (or TV) may sample a frame 60 times per second, but it's likely showing many duplicate frames because the game doesn't update that fast.

Almost. All NES games draw 60 frames per second, always. The lag that can occur with sprite overload or just too much stuff going on is a direct result of that strictly enforced standard: you're still getting 60 fps, just a lot of duplicates. (Think of it as a deadline, where something HAS to be submitted and the easiest fallback is whatever was submitted last time.)

It's similar to the old silent film movie cameras, where the cameraman had to turn the crank while saying "One Mississippi, Two Mississippi..." Were he to complete two rotations within a single second, the projection-playback would still output at its constant 1-rotation-per-second framerate and that snippet would be stretched out over two seconds. This would cause a noticeable slowdown, wherein some frames would likely be identical.

If you're familiar with the "Keystone Cops", they used the exact opposite method: the cameraman would complete a single rotation over the course of two seconds. Playing that back at the fixed framerate resulted in spastic, hyper-fast movement.

ShadowBlitz16

Quote from: Seihen link=topic=19256.msg272892#msg272892 date=1423785506
Would love to see what this project leads to, though. Do you have a project page setup somewhere?
/quote]

sadly no I only know how to code in gamemaker and I'm still learning in that

Trax

Check out my disassembly of the game. It's not complete, but almost...

Zelda II - Bank 0
Zelda II - Bank 1
Zelda II - Bank 2
Zelda II - Bank 3
Zelda II - Bank 4
Zelda II - Bank 5
Zelda II - Bank 6
Zelda II - Bank 7
Zelda II - RAM Map

Bank 0 contains most of the code you want, for both the Overworld and the Sidescrolling parts. Otherwise, Bank 7 also deals with more "low-level" mechanisms, like the actual display of tiles, for example...

In Bank 0, you can start your search at 1381. There are three JSR calls there, one for walking, one for jumping and one for sword slash. Some of the routines have quite a bit of comments, so you won't be totally lost in the code. Keep the the RAM Map handy...

Dr. Floppy

^^^ This is awesome. ^^^

We need a definitive Zelda II hack. Specifically, one that isn't (a) lame reskin, and/or (b) Kaizo bullshit.

ShadowOne333

Quote from: Dr. Floppy on March 03, 2015, 08:29:43 PM
^^^ This is awesome. ^^^

We need a definitive Zelda II hack. Specifically, one that isn't (a) lame reskin, and/or (b) Kaizo bullshit.
Couldn't agree with that sentence any more than I do now.
I would love to see a hack of Zelda II to give this game its proper glory, and to get it out of the black sheep fame of the franchise.

Trax

I've got a Zelda II hack in the works. But it's at a very early stage of planning, so nothing spectacular to show. Except that it will certain contain ASM hacking similar to what is shown in this video...

tc

Quote from: ShadowOne333 on March 03, 2015, 09:54:05 PM
Couldn't agree with that sentence any more than I do now.
I would love to see a hack of Zelda II to give this game its proper glory, and to get it out of the black sheep fame of the franchise.

I dunno. By the time you touched up the translation, added some kind of map system, increased sword speed/range, enemy difficulty re-balancing, less knockback from damage, possibly try to animate a few things like the overworld water tiles... It might be sensible to port over to a more flexible engine.

Dr. Floppy

I can foresee the addition of two more "Elite Knights" in two of the towns. To compliment the upthrust/downthrust, these dudes would teach Link how to not experience horizontal recoil and how to not lose experience itself when hit by certain enemies.