Support for 4 angled sprites
Moderator: GZDoom Developers
-
- Posts: 1959
- Joined: Sat Nov 03, 2007 4:13 pm
Support for 4 angled sprites
It doesn't seem like it would be too hard to do, and it would be somewhat useful. The problem is, it that with duplicating it to 8 or 16 angles, the actor looks like it's facing 45 or 22.5 degrees from what it actually is. The only work around I can think of is to have another actor spawn and fix it's displayed angle by offsetting it from what the main actor's is, and locking it onto it's position.
-
- Posts: 976
- Joined: Sat Dec 01, 2007 6:28 pm
Re: Support for 4 angled sprites
I agree this would be nice. Perhaps it could use the letters H I J K, after the end of the 16 angle names?
-
- Posts: 1959
- Joined: Sat Nov 03, 2007 4:13 pm
Re: Support for 4 angled sprites
Yeah, that sounds good.
Last edited by Sodaholic on Sat Dec 04, 2010 10:11 pm, edited 1 time in total.
-
- Posts: 3388
- Joined: Thu Jul 05, 2007 4:53 pm
- Location: opening the forbidden box
Re: Support for 4 angled sprites
I don't really see why we would need to add additional letters for it. if a sprite provides 1,2,3,4 but not 5,6,7,8 then shouldn't it recognize that the sprite has only four rotations?
-
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
Re: Support for 4 angled sprites
Pretty much what I thought.InsanityBringer wrote:I don't really see why we would need to add additional letters for it. if a sprite provides 1,2,3,4 but not 5,6,7,8 then shouldn't it recognize that the sprite has only four rotations?
Besides, I'd also like to hold out for a possible addition of 16 more angles in the future, in which case we'd need those letters.
-
- Posts: 1959
- Joined: Sat Nov 03, 2007 4:13 pm
Re: Support for 4 angled sprites
Also, could that work for any number of angles? Like 12 angle sprites, 7 angle sprites if you wanted.
-
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
Re: Support for 4 angled sprites
Honestly, keeping it at 16, 8, 4, maybe 2, and 1 seems more appropriate. 2 has very limited use, yes, but more than 3.
-
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: Support for 4 angled sprites
I wouldn't think it would be hard to do any number as long as it's a power (maybe multiple, though I can see that being more complicated) of two.
-
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
Re: Support for 4 angled sprites
Yes, PO2 is best I think.
-
-
- Posts: 17920
- Joined: Fri Jul 06, 2007 3:22 pm
Re: Support for 4 angled sprites
You mean 1, 3, 5, 7 but not 2, 4, 6, 8.InsanityBringer wrote:I don't really see why we would need to add additional letters for it. if a sprite provides 1,2,3,4 but not 5,6,7,8 then shouldn't it recognize that the sprite has only four rotations?
Anyway, you can use the TEXTURES lump to do the duplication and provide 16 rotations from 4 pictures, giving you more precision. See [wiki=Sprite#Angles]sprite angles[/wiki]: front rotation 1 -> 8, G, 1, 9, 2; 3 -> A, 3, B; 5 -> 4, C, 5, D, 6; 7 -> E, 7, F.
-
- Posts: 1959
- Joined: Sat Nov 03, 2007 4:13 pm
Re: Support for 4 angled sprites
Yes, Gez, but the problem is that there is inevitably some inaccuracy with that method.
-
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
Re: Support for 4 angled sprites
You're making something with only 4 directions, and you're worried about "accuracy"?
-
- Posts: 752
- Joined: Tue Apr 20, 2010 8:58 pm
- Location: In high orbit
Re: Support for 4 angled sprites
Actually, Gez, that's not going to work. If it did, then this suggestion would be redundant!Gez wrote:Anyway, you can use the TEXTURES lump to do the duplication and provide 16 rotations from 4 pictures, giving you more precision. See [wiki=Sprite#Angles]sprite angles[/wiki]: front rotation 1 -> 8, G, 1, 9, 2; 3 -> A, 3, B; 5 -> 4, C, 5, D, 6; 7 -> E, 7, F.
Here is a graph which illustrates the problem:
Red represents the frontal-view sprite, blue represents the right-side sprite, and so on. As you can see, using four sprites multiple times on an 8- or 16-sprite rotation causes the rotation to be "tilted," which will make the sprite look as if it's always facing at an angle. If you look at the far right-hand graph, though, you can see how this feature would alleviate the problem.
-
- Posts: 976
- Joined: Sat Dec 01, 2007 6:28 pm
Re: Support for 4 angled sprites
Actually, Gez suggested 5 angles for the front and back, and 3 for each side, like below. It's still not as accurate as 4 exact angles, but it isn't off-center.
-
- Posts: 13547
- Joined: Wed Jul 16, 2003 3:52 am
Re: Support for 4 angled sprites
Anyway, with this solution you will have to add redundant data to the mod where 4 sprites per frame would already be enough