RollCenter is calculated differently for billboard sprites

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

RollCenter is calculated differently for billboard sprites

Post by Sir Robin »

I noticed this because I have an actor that is a rollsprite and is a standard billboard sprite out in the open but becomes a wallsprite near walls. Best I can tell, the "empty space" in a sprite is ignored for a billboard center but considered for a wallsprite center.

Reproduce:

Code: Select all

//TEXTURES: Create a sprite with some empty space:
sprite JGLRA0, 14, 36
{
	offset 7,36
	sprite BON1D0,0,18
}

//ZSCRIPT:
version "4.11.1"
class jiggler : actor
{
	default {+RollSprite;}
	states {spawn: JGLR A -1; stop;}
	
	override void tick()
	{
		roll = sin(360. * (level.time % 35 / 34.)) * 45;
		super.tick();
	}
}
class JRC : jiggler {default {+RollCenter}}
class JWS : jiggler {default {+WallSprite}}
class JWSRC : JWS {default {+RollCenter}}
class JFS : jiggler {default {+FlatSprite}}
class JFSRC : JFS {default {+RollCenter}}
Summon these classes near each other. Jiggler, JWS, and JFS should all be similar and they are. JRC, JWSRC, and JFSRC should all be similar and they are not.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: RollCenter is calculated differently for billboard sprites

Post by Graf Zahl »

I am fully aware that all these options are not really usable, when they were implemented, maximum flexibility was rated higher than a robust foundation. If there weren't actual projects using them they would long have been removed by now.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: RollCenter is calculated differently for billboard sprites

Post by Sir Robin »

I haven't had a lot of issues with wall sprites but I know flat sprites are pretty wonky. I realize you can't change them because they're already in use. Any chance we could get a +WallSprite2 or something like that that would function as expected?
I know you're also working on a build engine, and I remember duke3d using sprites quite extensively. is that code better and portable?

I realize the work-around for now is to use a model with a plane on its floor as a wall sprite.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: RollCenter is calculated differently for billboard sprites

Post by Graf Zahl »

Build's code is better than what got into GZDoom for flat and wall sprites but it's far from perfect. because it has no concept of attaching such sprites to a surface. The result is countless errors with wall and floor decals in the games.
User avatar
Enjay
 
 
Posts: 26573
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: RollCenter is calculated differently for billboard sprites

Post by Enjay »

Graf Zahl wrote: Fri Oct 27, 2023 8:34 am I am fully aware that all these options are not really usable, when they were implemented, maximum flexibility was rated higher than a robust foundation. If there weren't actual projects using them they would long have been removed by now.
Is there any mileage in deprecating the current implementation and introducing a new, better one (as and when time and priorities allow, of course)?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: RollCenter is calculated differently for billboard sprites

Post by Graf Zahl »

You may already consider it deprecated, as is evident by not changing this.
The main problem here is that a proper wall and floor sprite implementation needs to be done very differently, especially how they handle in-game collision testing.

Return to “Closed Bugs [GZDoom]”