State with No Sprite

Status
Not open for further replies.

Metal96

Member
How would one go about making a state with no sprite? Not a completely transparent sprite, but really no sprite? Would you just put the sprite to -1 or leave it blank?
 
Well what I'm doing is making all the scenery objects so that they stop rendering when they are far enough away from the player. So I want the game to legitimately render nothing to save time when the object is too far away, switching to the real sprite when close enough. Like how ambient-sound things or player start or the like don't render a sprite.

EDIT: Disregard the above. I actually looked up the sprite and saw that it was an empty, non-erroring sprite :-P
 
You either use DISS or you toggle MF2_DONTDRAW.

Although, if you're having issues with the renderer drawing lots of objects, what you need to do is split the level up with some single-sided linedefs (in SRB2's case, that'd be behind a thok barrier) as the renderer generally stops polling when it hits one of those, due to how the BSP tree is set up. Also, learn how to use the culling plane. I haven't learned how, but it's apparently a great tool for stages with lots of objects you can't see.
 
Well what I'm doing is making all the scenery objects so that they stop rendering when they are far enough away from the player. So I want the game to legitimately render nothing to save time when the object is too far away, switching to the real sprite when close enough. Like how ambient-sound things or player start or the like don't render a sprite.

EDIT: Disregard the above. I actually looked up the sprite and saw that it was an empty, non-erroring sprite :-P
How are you actually planning on detecting when the player is "far enough away", anyways? The only SOC-based method of doing that I'm familiar with, A_TurretFire callback, is inefficient and is only worth it for performance reasons if what it's preventing is a major drain, like the special firing mechanism used by the trap gargoyles in ATZ.
 
Last edited:
How are you actually planning on detecting when the player is "far enough away", anyways?

If it were me, I would have the objects' SpawnState be an invisible state lasting 1 tic and looping back to itself forever with A_Look as the action and Var1 set to, say, 1280 fracunits all around the object. Then, I would have the objects' SeeState be visible, last 1 tic, go to the SpawnState after it's finished, and have no action. That way, the object will appear as soon as the player moves within range and disappear when they move out of it.
 
I am not sure how the sprite disappearing ideas outside a certain area is going to work in a multiplayer game. I would try shadowhog's ideas first.
 
I am not sure how the sprite disappearing ideas outside a certain area is going to work in a multiplayer game. I would try shadowhog's ideas first.

Actually, my method will work fine. The only change will be that if there is any player within range, the object will be visible, and if there is not, then it will be invisible.
 
If it were me, I would have the objects' SpawnState be an invisible state lasting 1 tic and looping back to itself forever with A_Look as the action and Var1 set to, say, 1280 fracunits all around the object. Then, I would have the objects' SeeState be visible, last 1 tic, go to the SpawnState after it's finished, and have no action. That way, the object will appear as soon as the player moves within range and disappear when they move out of it.

Guess what? That's the code that I already have! And it works fine.

And Shadowhog, I would use the culling planes, but don't they only work vertically? If not then I'll grid up the map a bit and it'll work.

EDIT: Do culling planes remove FOF shadows? If not I'll just stack them at good locations. Also, do zero-height sectors halt the renderer? Because I could make "boxes" that instantly raise/lower a sky-rendering ceiling to clip distant stuff.
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top