SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing Help

Reply
 
Thread Tools Search this Thread
Old 10-08-2012   #1
Metal96
 
Metal96's Avatar
Default State with No Sprite

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?
Metal96 is offline   Reply With Quote
Old 10-08-2012   #2
Sky The Destroyer
 
Sky The Destroyer's Avatar
Default

Quote:
Originally Posted by Metal96 View Post
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?
I'm not 100% sure on what you mean, but 193 - SPR_DISS is basically a blank sprite.
__________________
<SkyTheDestroyer> Why does the Master Server delist my server once it hits 32/32?
<SpiritCrusher> Your server has attained GOD STATUS
<SpiritCrusher> The MS can't display it anymore
Sky The Destroyer is offline   Reply With Quote
Old 10-09-2012   #3
Metal96
 
Metal96's Avatar
Default

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
Metal96 is offline   Reply With Quote
Old 10-09-2012   #4
Shadow Hog
 
Shadow Hog's Avatar
Default

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.
Shadow Hog is offline   Reply With Quote
Old 10-09-2012   #5
Prime 2.0
Permanently Banned
Default

Quote:
Originally Posted by Metal96 View Post
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 by Prime 2.0; 10-09-2012 at 05:23 AM.
Prime 2.0 is offline   Reply With Quote
Old 10-09-2012   #6
I'll Begin
💪🐑
 
I'll Begin's Avatar
Default

Yeah, implementing something like that with the scenery objects is only going to raise lag, not lower it.
I'll Begin is offline   Reply With Quote
Old 10-09-2012   #7
742mph
My work is never done yet
 
742mph's Avatar
Default

Quote:
Originally Posted by Prime 2.0 View Post
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.
__________________
Quote:
<Evilgasm> the opposite of egoraptor is Toa Tahu
742mph is offline   Reply With Quote
Old 10-10-2012   #8
Torgo
 
Torgo's Avatar
Default

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.
__________________
If you see any people named "Torgo" outside of SRB2, it isn't me. I also go by "TorgoRandomNumbers"
Torgo is offline   Reply With Quote
Old 10-10-2012   #9
742mph
My work is never done yet
 
742mph's Avatar
Default

Quote:
Originally Posted by Torgo View Post
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.
__________________
Quote:
<Evilgasm> the opposite of egoraptor is Toa Tahu
742mph is offline   Reply With Quote
Old 10-14-2012   #10
Metal96
 
Metal96's Avatar
Default

Quote:
Originally Posted by 742mph View Post
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 by Metal96; 10-14-2012 at 02:22 AM.
Metal96 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.