[No] A sprite frame symbol for no draw, like TNT1 base

Moderator: GZDoom Developers

A sprite frame symbol for no draw, like TNT1 base

Postby Sir Robin » Mon Feb 07, 2022 8:32 pm

Could we get a sprite frame that points to null or "no draw" frame in the same way that the TNT1 sprite base points to?

So for example if I have this sequence:
Code: Select allExpand view
XMPL ABC 4;
TNT1 A 4;
XMPL EFG 4;

that puts a no-draw frame in my sequence.

Could we get a frame symbol that does that same thing? Perhaps the "!" which means not in so many languages. Then I could use a sequence like this
Code: Select allExpand view
XMPL ABC!DEF 4;

to produce the same results as above, just with a little cleaner code.
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: A sprite frame symbol for no draw, like TNT1 base

Postby RockstarRaccoon » Sat Feb 19, 2022 2:43 pm

I feel like the answer is going to be no, simply because any valid character there could be used as a frame identifier, and this doesn't add new functionality, nor is this a very common problem.

What are you even using this for? Because what you're talking about basically makes the sprite flash suddenly in and out of existence...
User avatar
RockstarRaccoon
Totally Babies
 
Joined: 31 Jul 2016

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Graf Zahl » Sat Feb 19, 2022 3:02 pm

RockstarRaccoon wrote:I nor is this a very common problem.



Touché.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Gez » Sat Feb 19, 2022 4:26 pm

With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.
Gez
 
 
 
Joined: 06 Jul 2007

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Sir Robin » Sun Feb 20, 2022 8:16 pm

RockstarRaccoon wrote:What are you even using this for? Because what you're talking about basically makes the sprite flash suddenly in and out of existence...

You know, that's a good question. This post is about 2 weeks old, so I'm racking my brain trying to figure out what I was doing 2 weeks ago where I wanted sprites to pop on and off in their animation. Then it finally occurred to me - I was working on weapon HUD sprites. Some weapons will go out of player FOV - for example when reloading or charging certain weapons, or melee weapons being drawn back and/or slashing through FOV and out of FOV. So my weapons have a number of off-screen moments and thus no-draw frames.

Gez wrote:With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.

Absolutely right. And now that I think about it, this problem is entirely my own making. I wrote a script to generate weapons for me. First thing it does is figure out all the frames of animation needed for ready, charge, and fire, then draws those frames to png files, and then builds a textures lump to point sprites to them. It's my own code that looks for a no-draw frame (an attempt to draw a png with 0 pixels) and replaces it in the sequence with the TNT1 reference. Instead I should let it define a sprite with the NullTexture flag and then I can use that in the sequence like any other frame.
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Graf Zahl » Mon Feb 21, 2022 1:21 am

Gez wrote:With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.



Keep in mind that TNT1 is not a NullTexture. The checks for it are very different.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Sir Robin » Mon Feb 21, 2022 9:07 am

Is there any functional difference between TNT1 and a textures lump sprite declared as a null texture?
User avatar
Sir Robin
 
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: A sprite frame symbol for no draw, like TNT1 base

Postby wildweasel » Mon Feb 21, 2022 10:55 am

Yes - something displaying TNT1 is completely skipped by the renderer. With a null texture, the renderer still has to determine that there is a sprite here, load the graphic into memory, and attempt to draw it - in this case, the graphic is (usually) a 1x1 sized canvas consisting of a single transparent pixel. On its own, this won't be noticeable, but in great enough numbers, using TNT1 instead would be marginally faster.
User avatar
wildweasel
from a different perspective.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: A sprite frame symbol for no draw, like TNT1 base

Postby Graf Zahl » Mon Feb 21, 2022 12:58 pm

TNT1 means that the sprite will be discarded right at the very beginning of the sprite processing logic. Any empty sprite first needs to run through all substitution checks for voxels and models before it can be discarded.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest