Page 1 of 1

Does the game need this?

Posted: Thu Apr 10, 2014 3:31 pm
by juanjp600
In MouseLook function:

Code: Select all

;If 0 Then 
;fixing the black screen bug with some bubblegum code 
Local Zero# = 0.0
Local Nan1# = 0.0 / Zero
If Int(EntityX(Collider))=Int(Nan1) Then
	
	PositionEntity Collider, EntityX(Camera, True), EntityY(Camera, True) - 0.5, EntityZ(Camera, True), True
	Msg = "EntityX(Collider) = NaN, RESETTING COORDINATES    -    New coordinates: "+EntityX(Collider)
	MsgTimer = 300				
EndIf
;EndIf
It seems to be some code that resets the player's position if it's invalid, and displays a message. However, I haven't seen this message ingame. Removing the code doesn't seem to have any negative effect, so I'm not sure why Regalis added it.

Re: Does the game need this?

Posted: Thu Apr 10, 2014 4:55 pm
by Jill
It's to prevent a bug where people on 32-bit systems would get a bug where the camera spazzes out and they end up with a black screen.

Don't take that shit out or I will hurt you.

Re: Does the game need this?

Posted: Thu Apr 10, 2014 5:37 pm
by juanjp600
So you see that message pretty often when you play the game?

Re: Does the game need this?

Posted: Fri Apr 11, 2014 12:16 am
by Jill
I haven't seen it since I don't have time to play much, But I know i have definitely seen it at least once.

Just leave it in there. For the love of god don't hurt it. It has a wife and kids. I love that code ;_;

Re: Does the game need this?

Posted: Fri Apr 11, 2014 12:29 am
by juanjp600
I won't remove it, but maybe they is a better way to fix the black screen bug. I'll see if adding any debug stuff will help in making a better fix.

Edit:
https://www.mediafire.com/?5024jzrxe0q374a

For anyone that experienced the black screen bug with version v0.2, please download and play with this executable. Once the player's position becomes NaN (the NaN message appears, and you might have a lag spike), upload "bug_detect.txt" so I can see when things go wrong.