Psprites scaled different between hardware/software

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
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Psprites scaled different between hardware/software

Post by NeoTerraNova »

Greetings, everyone. Once again, I humbly ask for the help of anyone and everyone that can assist me. Again, as always, I thank each of you that stops by to help. You all really have no idea how thankful and grateful I am for all the help I get on here.

I think my problem might be simple, but I don't know. I have a number of weapons that have an Aim-Down-Sights function. In relation to my most-previous post regarding flashlights, I decided to set about trying to run in Hardware mode, if I can. The problem is, the "center" of my screen seems to have "dropped" somewhat.

To put it another way - I have the graphics for the Aim-Down-Sights options configured to be precisely at the center of the screen, so the Player can put their sights on the target and know the bullet is going to hit right there. This was set up for Software mode, as it's the only mode I've used for years, given my Potato Spud of a computer. When I switched over to Hardware Mode to see if I can manage it (I haven't in the past, but, you know, things can change), the point-of-impact dropped significantly.

Given that different users will use different configurations, is there some way to be absolutely certain that the position on the screen where I want to imply that the fired bullet will hit, will be the same, no matter who's computer it's on? Barring that, is there some way for the end user to manipulate the menu options to move the point-of-impact to where it "should" be in Software mode?

I apologize for posting here - I wans't sure if this was a Scripting issue, or something to do with the game's settings.
Last edited by Caligari87 on Wed Nov 24, 2021 10:05 am, edited 2 times in total.
Reason: Title edited for topic move to Bugs forum
User avatar
determin1st
Posts: 57
Joined: Wed Oct 06, 2021 11:23 am

Re: Wandering Zero (center of screen)

Post by determin1st »

i think center is 44 units, and zero in A_FireCustomMissile is at 41 units, so to center projectile offset should be +3

anyway, it will go to the center point from any offset (when angle/pitch=0)..

also check the puff sprite, if it's not centered, may showup screwed
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Wandering Zero (center of screen)

Post by NeoTerraNova »

Hey, thanks for the reply, but I think you might be missing what I'm trying to explain. I apologize, I should have been a bit more plain.

When in Software Mode, my Sights and the Point-of-Impact like up like this:

__{RS}_X_{RS}__

Where "{RS}" is the rear sight, and X is both the front sight and the point-of-impact of each shot.

Now, in Hardware Mode, it's coming out like this:

__{RS}_[FS]_{RS}__

..........X............

Where "[FS]" is the Front Sight, and "X" is the point-of-impact again. In Hardware Mode, for reasons I don't understand, the point-of-impact is significantly lower than where it is in Software Mode. As a result, the graphics I have for Aim-Down-Sights are horribly mis-aligned in Hardware Mode, where in Software Mode, they line up perfectly.

Is this a better explanation? I apologize if I wasn't clear, before.
User avatar
Caligari87
User Accounts Assistant
Posts: 6001
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Wandering Zero (center of screen)

Post by Caligari87 »

I'd wager this isn't the "center of your screen" being misaligned, but rather your sight graphics being placed differently on the screen between the hardware and software renderers for some reason. For the record I've not heard of this and it might be an engine bug, but I'm not 100% sure of that.

Unfortunately this isn't possible to troubleshoot based solely on your description. Can you strip down your mod and make a minimal example that shows the problem happening, then upload here? Also please make sure to post your GZDoom version, and your system specs (GPU, CPU, operating system, graphics driver version, etc).

8-)
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Wandering Zero (center of screen)

Post by NeoTerraNova »

I'd wager this isn't the "center of your screen" being misaligned, but rather your sight graphics being placed differently on the screen between the hardware and software renderers for some reason.
This is exactly what I was thinking.
For the record I've not heard of this and it might be an engine bug, but I'm not 100% sure of that.
Oh, dear.. I hope not.
Unfortunately this isn't possible to troubleshoot based solely on your description. Can you strip down your mod and make a minimal example that shows the problem happening, then upload here? Also please make sure to post your GZDoom version, and your system specs (GPU, CPU, operating system, graphics driver version, etc).
The potato is:
Acer Aspire
Intel 2020M Dual 2.4GHz
Windows 7
Standard Intel HD Graphics card/on-board, Driver version 8.15.10.2752 from 2012.

As for which Source Ports, I'm using GZDoom 4.5.0 and LZDoom 1.88, and the problem is with both of them.

I was picking through GZDoom 4.5.0 and hot-swapping the rendering modes, and I actually saw my graphic increase in size on the screen, between the two modes. In Hardware mode, it appearing larger on the screen, and in Software mode, smaller. This right here is the source of the issue - somehow, between the two rendering modes, my graphics are being magnified (or, to the eye of the person playing, they appear larger). And the magnification is enough to throw off point-of-aim from point-of-impact. Any idea what might cause THIS?

Also, it would be VERY hard for me to strip down my Mod to display this problem - frankly, every graphic that's involved with this problem, is my own hard work, and I don't want any of it displayed to the world until I'm as done as I can get. I've seen too many times what happens when a broken Alpha or something gets "released" before the creator is ready. If I have to, I'll make a separate set of graphics that has the same demonstrable problem and make a special WAD file. However, I'd really prefer to avoid that.

EDIT: I should also note that switching Aspect Ratio also causes this problem - the Sprite for my weapons is stretched somehow, and it also throws off Point-of-Aim from Point-of-Impact. Just found this out.
User avatar
Caligari87
User Accounts Assistant
Posts: 6001
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Wandering Zero (center of screen)

Post by Caligari87 »

The aspect ratio scaling part kinda makes sense? Some modes simply have different pixel stretch ratios.

The scaling difference between hardware and software rendering does sound like a bug though (unless someone smarter and more knowledgeable than me can chime in). I've moved this topic to the Bug Reports forum for better visibility and changed your thread title accordingly (if it's not a bug we'll close it or move the topic back to an editing help forum).

I understand not wanting to make your mod public, but we do need something to troubleshoot. Please be prepared to private message a developer with your mod. Note that the more complex a mod is, the harder it is for devs to troubleshoot, so please try to find a way to strip it down to an easy example like a single weapon if possible, and clearly describe how to reproduce the issue.

8-)
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Psprites scaled different between hardware/software

Post by NeoTerraNova »

Alright, I think I can strip it all the way down to one weapon that I no longer use, that still exhibits the problem. Give me a couple hours to see if I can reproduce what's going on, with this, and I'll post everything here.

EDIT: I have something all ready to test.
User avatar
Caligari87
User Accounts Assistant
Posts: 6001
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: Psprites scaled different between hardware/software

Post by Caligari87 »

The OP ( NeoTerraNova ) just messaged me, they now have a minimal example ready. Can someone on the dev team post if they're able to test this report?

8-)
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Psprites scaled different between hardware/software

Post by NeoTerraNova »

On Caligari's advice, I'm posting again in this thread. I'm still having the issue described above.

Here is the stripped down file, if anyone can help.
https://www.mediafire.com/file/vo4srdd ... V.pk3/file
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Psprites scaled different between hardware/software

Post by Graf Zahl »

Now, if I only knew what to do with this.
I see a weapon - it's in the same place in both renderers.
There are no other elements that look out of place.
User avatar
Rachael
Admin
Posts: 13211
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Psprites scaled different between hardware/software

Post by Rachael »

Is it the same if you do r_noaccel 1?
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Psprites scaled different between hardware/software

Post by NeoTerraNova »

I'll be honest: I don't understand what you're saying. I'm terribly sorry.
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Psprites scaled different between hardware/software

Post by NeoTerraNova »

Sorry, Mr Zahl, I just realized you posted here. I only saw Rachel's comment.

Zoom in by pressing the right mouse key. Fire a shot at something and note where the graphical reticle is versus where the shot lands. Now, change renderers. The graphical reticle on the weapon itself will be off by a measure. Again, fire a shot at a wall or something and note where the center of the graphical reticle is, compared to where the shot lands. There's no deviation in the shot (set to 0,0 - no randomness in up/down or left/right). In the software renderer, the shot should be perfectly on target to the center of the graphical reticle. In the hardware renderer, the reticle has drifted out of place and the shot won't land where aimed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Psprites scaled different between hardware/software

Post by Graf Zahl »

I'm sorry, but I do not see any difference between renderers. In both the shot lands quite a bit below both your reticle and the engine's own crosshair, which is to be expected, because the center of the view is where your eyes look, but the weapon is a few map units lower normally.
User avatar
NeoTerraNova
Posts: 153
Joined: Tue Mar 14, 2017 5:18 pm
Location: Western North Southlandia (East Side)

Re: Psprites scaled different between hardware/software

Post by NeoTerraNova »

I apologize, Mr. Zahl. Allow me to demonstrate. Note that in these images, the point of impact is exactly the same, even though the point of aim is different. These screenshots are with GZDoom 4.5.0 64bit. I simply started a new game in Hardware Renderer, zoom-aimed and fired at the wall. I repeated the process with three rounds in the Software Renderer. I did not move the mouse in any direction between shots. All shots landed at the exact same spot, even though the center of the reticle had shifted. The FIRE state for the weapon is coded to 0,0 for vertical and horizontal displacement.

Software:
https://i.ibb.co/B6PDQZX/Screenshot-Doo ... 115048.png

Hardware:
https://i.ibb.co/DfGmdSM/Screenshot-Doo ... 115014.png

POI vs POA in Hardware Mode showing Reticle Center:
https://i.ibb.co/vXhx3vC/POI-POA.png

Image Stretching in Hardware vs Software mode:
https://i.ibb.co/gtbHsD7/Renderers.png


Code for the FIRE state:

Code: Select all

    Fire:
    	M17A A 0 A_JumpIfInventory("SACOG",1,"FireZoomed")
    	M17A A 0 A_JumpIfInventory("Mk17AM", 1, 2)
        Goto DryFire
        TNT1 A 0
    	M17A A 0 A_FireBullets(0,0,1,135,"SPuff",FBF_USEAMMO|FBF_NORANDOM,6502)
		M17A A 0 
    	M17A A 0 A_GunFlash
        M17A A 0 A_TakeInventory("Mk17AM",1)
    	M17A A 1 A_PlaySoundEx("MK17FIRE","weapon")
    	M17A D 1 BRIGHT Offset(6,35) A_FireCustomMissile("RifleCasingSpawner",-3,0,2,-2)
    	M17A D 1 Offset(4,34) A_FireCustomMissile("RifleSmokeSpawner",0,0,2,3)
    	M17A A 1 Offset(2,33) A_AlertMonsters
		M17A A 3 A_Refire
    	Goto Ready
	FireZoomed:
    	M17A A 0
    	M17A A 0 A_JumpIfInventory("Mk17AM", 1, 2)
        Goto DryFire
        TNT1 A 0
    	M17S A 0 A_JumpIfNoAmmo("SACOGDryFire")
    	M17S A 0 A_FireBullets(0,0,1,137,"SPuff",FBF_USEAMMO|FBF_NORANDOM,6502)
		M17S A 0 
    	M17S A 0 A_GunFlash
        M17S A 0 A_TakeInventory("Mk17AM",1)
    	M17S A 1 A_PlaySoundEx("MK17FIRE","weapon")
    	M17S D 1 BRIGHT Offset(4,30) A_FireCustomMissile("RifleCasingSpawner",-3,0,2,-2)
		M17S D 1 Offset(3,28) A_FireCustomMissile("RifleSmokeSpawner",0,0,2,3)
    	M17S A 1 Offset(2,25) A_AlertMonsters
		M17S A 3 A_Refire
		Goto ReadyZoom

Return to “Closed Bugs [GZDoom]”