Increasing Weapon Animation Frames/Quality

Discuss modding questions and implementation details.
User avatar
Jay_H
Posts: 2712
Joined: Tue Aug 25, 2015 1:54 am

Re: Increasing Weapon Animation Frames/Quality

Post by Jay_H » Tue Aug 20, 2019 7:25 pm

It's all good 8-) Let's see what else l3lessed can bring out :)

Firebrand
Posts: 150
Joined: Thu Jul 18, 2019 6:07 pm

Re: Increasing Weapon Animation Frames/Quality

Post by Firebrand » Tue Aug 20, 2019 8:34 pm

pango wrote:
Tue Aug 20, 2019 4:17 pm
l3lessed wrote:
Tue Aug 20, 2019 3:23 pm
And, you're really concerned with texture memory in 2020, when people and modern engine like unity can handle gigs of graphical memory being loaded and processed.
Well, today in 2019 switching weapons with HD weapons pack takes several seconds, so yes I am. It can certainly be optimized, but it will go up again with more frames. Can't tell about next year though.
l3lessed wrote:
Tue Aug 20, 2019 3:23 pm
And, I would love to have 3d models and animations, but until then, this is the system from 1992 we have [...]
Thanks for being debbie downers, and providing no real new information.
The HD weapons are based on 3D renderings, so some modelling work must already exists, somewhere. What I'm saying is that the 2D rendering step, that was required to be compatible with existing weapons display, will sooner or later become a bottleneck for more fluid and versatile animations.

I don't know how much work would be required to import them directly into DFU instead of being used for 2D rendering, because they're probably optimized for this 2D rendering. Also are arms and legs also 3D rendered? And magic effects will have to be replaced with 3D particles or something.
So we're not done yet, but maybe we're not starting from scratch as you say.
I agree. For what I understand, the excellent HD weapons pack was made from 3d models. Probably could make sense to ponder if it's better to make thousands of texture to make frames, or just use 3d models.

Probably in the (not very) long run it would be simpler to use the seconds, not considering in addition the benefits of easier collisions, for example :)

User avatar
MasonFace
Posts: 332
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: Increasing Weapon Animation Frames/Quality

Post by MasonFace » Tue Aug 20, 2019 9:02 pm

Thanks for the excellent breakdown in how those scripts operate together. As a mechanical engineer, I especially appreciate the analogy. ;)

I can tell by the way you've broken down the scripts that you're a very analytical person. I would encourage you to take a look in Daggerfall Imaging 2 at the weapon animation textures. From there you can get a feel for the total number of frames and their resolutions. From there you could assign a benchmark amount of memory for the vanilla assets.

Then you can do some simple math to figure out the corresponding memory budget for increasing the resolution and/or framerate. Try to determine what kind of compromises might fit your memory budget (2x resolution and 4x framerate, 2x resolution and 2x framerate, 4x resolution and 4x framerate?).

We might could try a few tricks to lower the memory footprint:
  • May try to see if 16bit color + blue noise dithering looks okay: could save a lot of memory. Note: DFU by default will import this back into a 32bit color texture, but surely there's a way to override this.
  • For the magic items, instead of having separate images for "weapon" and "weapon with aura," just keep the aura on an alpha channel and toggle it on/off with a modified script. That will reduce the number of needed frames by quite a bit I think.
  • Edit: Similarly, different weapon materials might could be handled with a shader and a simple masking layer.
These things can't be done with DFTFU in its current state, but it's constantly evolving. Heck, it seems like you might even be capable of implementing a lot of this on your own.


Completely different solution 1:
Kind of hard to explain, but instead of having many many more discrete animation frames, try tweening the weapon paths. Many of the vanilla weapon attack animations have really simple paths. You might be able to get away with just rotating/translating a sprite smoothly along a path and changing the sprite image incrementally over time as the orientation of the weapon changes. This would involve a pretty major re-write of the DFU weapon system, and I don't estimate that it would be easy, but it would definitely allow full HD textures and smooth animations to fit within a reasonable memory budget.

Completely different solution 2:
Use a 3D weapon rig on the DFU player prefab and override the DFU weapon system. Request modding hooks in DFU core if necessary. Again, not nearly as straight-forward as the original approach, but the memory requirement is definitely very manageable. This also gives you the benefit of potentially using procedural animations for your recoil so no two recoil animations look exactly the same. That could be kinda neat.

Anyway, these are just some suggestions. The memory budget is a very real constraint, but I believe you can overcome it!

Innovate, my dude! Show the realists how it's done!

Edit: If you haven't already done so, you may want to send Megaten a PM and see if he'd be willing to share his weapon models, with appropriate credit.

l3lessed
Posts: 85
Joined: Mon Aug 12, 2019 4:32 pm

Re: Increasing Weapon Animation Frames/Quality

Post by l3lessed » Thu Aug 22, 2019 5:51 am

I'm fine. Wasn't trying to rile anyone up. Just pointing out the negative tone. Sorry if it rubbed anyone the wrong way.

Anyways, I'm largely moving on from this. I already thought about trying to find pre-done 2d animations and just import them. No luck finding anything workable.

So then thought might try 3d model and animations. Begin unity research, found free model set of medieval weapons, found free arm models, started researching animation, and decided, no thanks. Already picking up the engines C#. I'll try this at a later date, if others have not picked it up. I still have a large number of things to work on on the coding side and combat, but if I or others want a collision or parry system, this will have to be tackled.

User avatar
pango
Posts: 1404
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Increasing Weapon Animation Frames/Quality

Post by pango » Thu Aug 22, 2019 9:13 am

I should have explained my line of thought in my first message instead of the second, that was lazy of me...
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
King of Worms
Posts: 2180
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Increasing Weapon Animation Frames/Quality

Post by King of Worms » Thu Aug 22, 2019 10:40 am

Megaten abandoned the mod and Ive picked it up. Ive corrected all the bugs, finalized the weapons, added magic weapons, converted to 32bit from 64bit, reduced size to 1/2 and manually corrected canvas size of the images so they can be divided by 4 thus they can be compressed now in unity. This all martirium resulted in 1/10 of size and the visual fidelity is the same or better (64bit was buggy) And it indeed runs very smoothly, no more stalling on new weapon equip etc. Plus ofc RAM/VRAM requirements dropped accordingly...

And yes, Im willing to share if the OP wants those
(PS: he can than count the number of files :lol: :lol: :lol: - sry, must have been said ;) )

l3lessed
Posts: 85
Joined: Mon Aug 12, 2019 4:32 pm

Re: Increasing Weapon Animation Frames/Quality

Post by l3lessed » Thu Aug 22, 2019 3:42 pm

Dang, that is allot of work. Nice job, and thanks for putting the time in.

I would love to see them and include them as an option for this mod, if you and megaten don't mind. Credit would be given of course. It is still 5 animation files though?

User avatar
King of Worms
Posts: 2180
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Increasing Weapon Animation Frames/Quality

Post by King of Worms » Thu Aug 22, 2019 9:01 pm

l3lessed wrote:
Thu Aug 22, 2019 3:42 pm
Dang, that is allot of work. Nice job, and thanks for putting the time in.

I would love to see them and include them as an option for this mod, if you and megaten don't mind. Credit would be given of course. It is still 5 animation files though?
Thanks :) will pack it and send it your way tomorrow. Do u preffer Rar of the loose files or unity export package?

Yup Megaten is ok with other ppl using it, but only for Daggerfall game, not elswhere. And Im ok sharing my progress on that mod.

Yes its 5 files +/- 😉

daggerdude
Posts: 52
Joined: Sat May 23, 2015 2:22 pm

Re: Increasing Weapon Animation Frames/Quality

Post by daggerdude » Fri Aug 23, 2019 7:33 am

Doom modder here:

the modern GZdoom engine allows one to program offsets into weapon mods... you can have the same frames but just animate them better. Even with Shadow Warrior classic they use exactly 2 images but programmed with offsets.

Now we have some higher quality renders that can be used to enhance the original experience, and programmers can add image offsets to images to smooth out the animations, or perhaps even certain interpolated animations could be programmed to VASTLY reduce the system load that would occur with a bagillion still frame images.

Now the other option is keyframing .md3 models or the like, just simple models, and programming them into the game. I was told that they are not currently supported in this manner.

I sincerely would love to see some battlespire esque 3d models for that low poly/pixel aesthetic, but the sky's the limit technically.

As for the PRODUCTION of said images, one would have to animate them in a series of keyframes, model, texture/uvwrap, optimize material and ambient light, and optimize render method and THEN go through the tedious task of rendering.
As a former 3dsmax artist for 3+ years, i can tell you that something like this would literally take forever. assuming that each attack angle was 10 frames (double), and the vert and horizontal left were mirrored, you still end up with 40 frames. at the minimum there are 9 different sprite sets to do.

assuming a person is willing to produce 360 frames of original content (well over 3 days work for each weapon by a GOOD artist) gratis, the programmers would be able to smooth the animations via coding and this would most certainly be a smoother daggerfall without being too much of a strain.

the question is, who would do this?

Firebrand
Posts: 150
Joined: Thu Jul 18, 2019 6:07 pm

Re: Increasing Weapon Animation Frames/Quality

Post by Firebrand » Fri Aug 23, 2019 8:44 am

Just an idea that was in my mind for a few days: what about AI frame interpolation?

Like this one:
https://github.com/alex04072000/CyclicGen

Here is an example:
https://www.youtube.com/watch?v=R8vQjgAtPOE

Maybe just doubling the frame to 10 this way could be a nice compromise :)

Post Reply