While I've made a few quick Decorate based weapons, I'm still mostly new to modding in GZdoom, and haven't found any documentation on this. Is there a way to increase the weapon sprite frame rate from 35, maybe even double it? I want a more varied fire rate on weapons, without decoupling the animation from the actual fire rate. Even 70fps, while fast, means I can have the individual RPM for the weapons I want to make.
Also I've been thinking of working on a layered sprite system for customizable weapons, instead of whole sprites for different weapon configurations they'd be in separate pieces synchronized with each other. The hands, weapon, and all it's interchangeable parts would all have their own layers. This would let me even swap out hand sprite sheets for different armor types worn by the player, or alternate characters. I already plan on using a modular folder structure to keep this tidy and manageable, so the complexity isn't a concern, I'm more worried about the engine handling this.
Lastly one of my prototype weapons has a problem where it lags the game when it's first drawn, I'm wondering if this has anything to do with it's size or if it's just the engine doesn't like feathered edges on sprites?
Weapon sprite frame rate and layered sprites?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
-
- Posts: 5
- Joined: Sun Jul 23, 2017 11:52 am
- Caligari87
- Admin
- Posts: 6229
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Weapon sprite frame rate and layered sprites?
This one is not possible, unfortunately. The internal gamesim runs at 35 tics-per-second, and that can't be changed without refactoring the entire engine.BadInfluence wrote:While I've made a few quick Decorate based weapons, I'm still mostly new to modding in GZdoom, and haven't found any documentation on this. Is there a way to increase the weapon sprite frame rate from 35, maybe even double it? I want a more varied fire rate on weapons, without decoupling the animation from the actual fire rate. Even 70fps, while fast, means I can have the individual RPM for the weapons I want to make.
This one definitely possible! You'll want to look at [wiki]A_Overlay[/wiki] and it's related functions. I did something similar with my weapon mod, where each part of the gun is a separate overlay and so I can do dynamic animations like pulling the slide and trigger separately, or remove the magazine and have a dynamic stack of rounds inside it.BadInfluence wrote:Also I've been thinking of working on a layered sprite system for customizable weapons, instead of whole sprites for different weapon configurations they'd be in separate pieces synchronized with each other. The hands, weapon, and all it's interchangeable parts would all have their own layers. This would let me even swap out hand sprite sheets for different armor types worn by the player, or alternate characters. I already plan on using a modular folder structure to keep this tidy and manageable, so the complexity isn't a concern, I'm more worried about the engine handling this.

-
- Posts: 5
- Joined: Sun Jul 23, 2017 11:52 am
Re: Weapon sprite frame rate and layered sprites?
That overlay system is exactly what I needed, wonder why I couldn't find it when I was looking through the docs, thanks for pointing it out.
It's a shame the tick rate is what it is, and am I right in assuming there's no work around? It'd suck to have most of what I'm looking for and then get stuck at not being able to use the fire rates I'm looking for.
It's a shame the tick rate is what it is, and am I right in assuming there's no work around? It'd suck to have most of what I'm looking for and then get stuck at not being able to use the fire rates I'm looking for.
- Caligari87
- Admin
- Posts: 6229
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Weapon sprite frame rate and layered sprites?
You'd have to work the math and have some frames emit extra rounds or skip rounds. Obviously it wouldn't match up exactly with the animation, but you could design around that. Maybe frames with an extra round have a bigger flash. Sound likewise, you couldn't have a separate sound for every round or it'd sound weird and out of sync, but you could have make a separate looping auto-fire sound that matches the rate you want.


-
- Posts: 5
- Joined: Sun Jul 23, 2017 11:52 am
Re: Weapon sprite frame rate and layered sprites?
While I could use a work around like that, something like the one I just found on GunLabs with their "half-tick" trick, I can only see massive headaches doing this, as it will probably require each piece of my modular weapon sprites to sync with it. I'm kind of stuck now, because I really want to use this engine, it's familiar enough to work with, but my current idea is kind of boned with this limitation. If there was a way to use Zscript to make some kind of plugin or something just for weapon animations I'd go for it, but I still don't know enough about coding to even ponder that possibility.
Though looking through this I think I have an idea for a GZdoom feature, though I don't know how hard it'd be to implement.
Though looking through this I think I have an idea for a GZdoom feature, though I don't know how hard it'd be to implement.