Showing sprites without an actor?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Showing sprites without an actor?

Post by Matt »

I find I spawn a lot of smoke, puff, flame, etc. sprites. Most of these don't need anything like all the stuff that gets initialized when a new actor is spawned.

I remember reading on the forums a while ago about a special thinker or something that doesn't do anything but show a sprite and now I'm wondering if using that might help.

Does anyone know what I'm talking about? And does it actually use significantly less CPU time to spawn if not maintain?
User avatar
zrrion the insect
Posts: 2411
Joined: Thu Jun 25, 2009 1:58 pm
Location: Time Station 1: Moon of Glendale

Re: Showing sprites without an actor?

Post by zrrion the insect »

I may be remembering wrong, but IIRC it had something to do with randi's work on blood compatibility.

EDIT: [wiki]Classes:CustomSprite[/wiki]
Could this be it?
User avatar
Rip and Tear
Posts: 185
Joined: Tue May 02, 2017 3:54 pm

Re: Showing sprites without an actor?

Post by Rip and Tear »

zrrion the insect wrote:I may be remembering wrong, but IIRC it had something to do with randi's work on blood compatibility.

EDIT: [wiki]Classes:CustomSprite[/wiki]
Could this be it?
CustomSprite still inherits from Actor.

There are some flags like +NOINTERACTION which can reduce the load of an actor.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Showing sprites without an actor?

Post by Caligari87 »

Well, I just tested and it's already possible to inherit from something as low-level as Object, though I can't seem to do much with it. Might it be possible, with a few exports, to build such an actor from scratch?

Although Matt, in your case it's probably the translucency overdraw that's causing a lot of the lag, not necessarily the number of actors (unless of course you've tested and found otherwise, but that's just my guess)

8-)
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Showing sprites without an actor?

Post by Matt »

zrrion: That's what I was thinking about! But yeah, it's an actor. Oh well, I'll think of something (possibly even just not spawning as many actors...)

R&T: I'm aware of the advantages of +nointeraction but it doesn't stop the overhead of initializing all those actors at once.

Caligari: Maybe, but the actor-spawning is definitely contributing - try using a doorbuster (or five) on a larger door, say the north secret on Map01, and unless you've got a much faster computer than me there will be a noticeable pause as all the debris actors appear.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Showing sprites without an actor?

Post by Nash »

I think the real solution here would be skinnable particles.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Showing sprites without an actor?

Post by The Zombie Killer »

Caligari87 wrote:Well, I just tested and it's already possible to inherit from something as low-level as Object, though I can't seem to do much with it. Might it be possible, with a few exports, to build such an actor from scratch?
Classes inherit from Object by default, therefore:

Code: Select all

class Example : Object
{
}

// is the same as

class Example
{
}
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Showing sprites without an actor?

Post by Matt »

Nash wrote:I think the real solution here would be skinnable particles.
Are those possible right now? I have this vague recollection of this being implemented at some point but I could be imagining things (and I can't find anything on the wiki).
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Showing sprites without an actor?

Post by Caligari87 »

Sort of, but not really. You can replace the particle graphic in GZDoom.pk3 and it'll be used in place of all particles as expected, but hasn't been exported to be generally usable by mods. I'm not an engine dev but that seems like a reasonably straightforward thing to do, considering it, y'know, already halfway works.

8-)
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Showing sprites without an actor?

Post by Nash »

There's a small discussion but that's about it. viewtopic.php?f=4&t=55737

There may or may not already be an open suggestion yet; I'm too tired to search
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Showing sprites without an actor?

Post by Apeirogon »

I looks through all base definitions of object, thinker and actor, in zscript part of gzdoom, and did not see any function/way which can show sprite, or make from thinker something, which from far distance looks like default actor.
But that probably because I am a blind kitten in programming.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Showing sprites without an actor?

Post by Graf Zahl »

To render a sprite there needs to be some reference object in the map - that's the Actor. Sorry, it cannot work any other way.
Post Reply

Return to “Scripting”