Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Model animation playing too fast #65

Open
ExcaliburZero opened this issue Oct 20, 2024 · 4 comments
Open

Model animation playing too fast #65

ExcaliburZero opened this issue Oct 20, 2024 · 4 comments

Comments

@ExcaliburZero
Copy link

It looks like the viewer renders at whatever fps the machine running it is able to render at, which can result in model animations playing at much faster rates than they are intended to play at in-game.

It would be good to have a cli flag that the user can provide to cap the frame rate, mainly in order to cap it at 60 fps to see the animation play at the intended speed.

apicula.exe view --max_fps 60.0 m003_00.*

apicula_viewer_fps

@ExcaliburZero
Copy link
Author

After trying something, I think might be more of an issue of the animation play speed rather than being the fps of the viewer.

Here is a ~20fps gif comparing the playback of an animation from Dragon Quest Monsters: Joker in apicula (left) compared to Melon DS (right).

Animation

You can see the Metal Slime's moves up and down in the animation. The animation playing in apicula seems to be roughly double the speed of the animation playback in Melon DS.

@ExcaliburZero ExcaliburZero changed the title Add cli flag to cap viewer fps Model animation playing too fast Oct 20, 2024
@scurest
Copy link
Owner

scurest commented Oct 20, 2024

All animations play at 60fps. If there is something in the file to tell how fast an animation should play, I don't know where it is.

@ExcaliburZero
Copy link
Author

I found some relevant comments and code in Spiky's DS Map Editor.

https://github.com/Skareeg/SDSME/blob/14f0e908a4dae9650ba1a52fd2b75fcd5ea7a011/Source/Map_Editor/LibNDSFormats/NSBCA.cs#L100-L105
https://github.com/Skareeg/SDSME/blob/14f0e908a4dae9650ba1a52fd2b75fcd5ea7a011/Source/Map_Editor/LibNDSFormats/NSBCA.cs#L335-L380

If I understand it correctly, it looks like there is a field in the NSBCA file that determines the animation play rate (choosing between 60fps, 30fps, and 20fps?). Or maybe its a duration per frame?

@ExcaliburZero
Copy link
Author

I tried implementing my understanding of that code onto this branch of my fork:

master...ExcaliburZero:apicula:animation_play_rate

After testing it with a few animations from Dragon Quest Monsters: Joker, it doesn't seem to work. I tested with a model that has several animations that I think should all play at 30fps, and some of them were played at 30 fps but others were played at 60 fps.

I think until someone figures out how the animation playback rate is stored, it would be good to have a cli flag that can be provided to set the animation playback speed. I can put together a PR for that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants