[Fixed] [script]Pitch broken for REAL now.

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Re: [script]Pitch broken for REAL now.

Postby Graf Zahl » Mon Feb 08, 2016 5:25 am

Exactly. If this comes up again, it's a handy tool to do a quick check.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [script]Pitch broken for REAL now.

Postby Graf Zahl » Mon Feb 08, 2016 5:32 am

And here's some output I created on an iPad:
(No, that's not ZDoom running, I just copied the test stuff into an App I am currently working on)

Code: Select allExpand view
Angle = -900.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -855.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -810.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -765.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -720.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -675.00000: xs_RoundToInt = 20000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -630.00000: xs_RoundToInt = 40000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -585.00000: xs_RoundToInt = 60000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -540.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -495.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -450.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -405.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -360.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -315.00000: xs_RoundToInt = 20000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -270.00000: xs_RoundToInt = 40000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -225.00000: xs_RoundToInt = 60000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -180.00000: xs_RoundToInt = 80000000, unsigned cast = 00000000, signed cast = 80000000
Angle = -135.00000: xs_RoundToInt = a0000000, unsigned cast = 00000000, signed cast = a0000000
Angle = -90.00000: xs_RoundToInt = c0000000, unsigned cast = 00000000, signed cast = c0000000
Angle = -45.00000: xs_RoundToInt = e0000000, unsigned cast = 00000000, signed cast = e0000000
Angle = 0.00000: xs_RoundToInt = 00000000, unsigned cast = 00000000, signed cast = 00000000
Angle = 45.00000: xs_RoundToInt = 20000000, unsigned cast = 20000000, signed cast = 20000000
Angle = 90.00000: xs_RoundToInt = 40000000, unsigned cast = 40000000, signed cast = 40000000
Angle = 135.00000: xs_RoundToInt = 60000000, unsigned cast = 60000000, signed cast = 60000000
Angle = 180.00000: xs_RoundToInt = 80000000, unsigned cast = 80000000, signed cast = 7fffffff
Angle = 225.00000: xs_RoundToInt = a0000000, unsigned cast = a0000000, signed cast = 7fffffff
Angle = 270.00000: xs_RoundToInt = c0000000, unsigned cast = c0000000, signed cast = 7fffffff
Angle = 315.00000: xs_RoundToInt = e0000000, unsigned cast = e0000000, signed cast = 7fffffff
Angle = 360.00000: xs_RoundToInt = 00000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 405.00000: xs_RoundToInt = 20000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 450.00000: xs_RoundToInt = 40000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 495.00000: xs_RoundToInt = 60000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 540.00000: xs_RoundToInt = 80000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 585.00000: xs_RoundToInt = a0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 630.00000: xs_RoundToInt = c0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 675.00000: xs_RoundToInt = e0000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 720.00000: xs_RoundToInt = 00000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 765.00000: xs_RoundToInt = 20000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 810.00000: xs_RoundToInt = 40000000, unsigned cast = ffffffff, signed cast = 7fffffff
Angle = 855.00000: xs_RoundToInt = 60000000, unsigned cast = ffffffff, signed cast = 7fffffff


And yes, xs_RoundToInt is the only method that works here, too!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [script]Pitch broken for REAL now.

Postby Graf Zahl » Mon Feb 08, 2016 5:37 am

... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [script]Pitch broken for REAL now.

Postby Major Cooke » Mon Feb 08, 2016 8:09 am

Just a heads up, this means GZDoom won't compile because bam2rad is missing for now.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: [script]Pitch broken for REAL now.

Postby Edward-san » Mon Feb 08, 2016 8:10 am

Graf Zahl wrote:... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...


I believe the problem is more related to the use of intermediate operations with one or more operands in float, then convert the result to int. See what I had to do to fix this bug.
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: [script]Pitch broken for REAL now.

Postby Graf Zahl » Mon Feb 08, 2016 8:11 am

Major Cooke wrote:Just a heads up, this means GZDoom won't compile because bam2rad is missing for now.



I'll get there.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [script]Pitch broken for REAL now.

Postby Graf Zahl » Mon Feb 08, 2016 8:12 am

Edward-san wrote:
Graf Zahl wrote:... which begs the question: If we want reproducable results for float -> int conversions in general because of netgame consistency, I think there's a lot more code that needs to be refactored.
But that's something someone else will have to do...


I believe the problem is more related to the use of intermediate operations with one or more operands in float, then convert the result to int. See what I had to do to fix this bug.



Yes, but if some overflow gets incorrectly truncated, effects can be similar. Who knows what's really in there...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Previous

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests