Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game freezes #20

Open
arczi84 opened this issue Apr 19, 2020 · 10 comments
Open

Game freezes #20

arczi84 opened this issue Apr 19, 2020 · 10 comments

Comments

@arczi84
Copy link

arczi84 commented Apr 19, 2020

Hi,
I'm having issue on Amiga 68k port (Big Endian).
Game freezes in fifth level LOLIDRA'S CAVE.
I'm in location when there are 3 enemies that dissapear and when they do game freeze.

@arczi84
Copy link
Author

arczi84 commented Apr 19, 2020

OK, found the code. Seems rand() issue on Amiga.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 19, 2020

The function rand() cause the freeze?

@arczi84
Copy link
Author

arczi84 commented Apr 19, 2020

Game loops if it is run on low end cpus. For example when enemy wizard disappears.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 19, 2020

Oh, I see. Sounds bad. Did you find a fix or wrokaround?

@arczi84
Copy link
Author

arczi84 commented Apr 19, 2020

I'll try to optimize game first. If that won't help I'll make some workaround.

@arczi84
Copy link
Author

arczi84 commented Apr 19, 2020

Overall looks like rand() issue, yes.

@arczi84
Copy link
Author

arczi84 commented Apr 19, 2020

Not sure again.

collisionTiles[gridX][gridY] is alwas same as collisionTiles[gridX][gridY+1]
therefore it never breaks the loop and gridY is always 2.

wizard.c
			do {
				gridX = (rand() % 16)+ 1;

			} while (collisionTiles[gridX][gridY] != 0 ||
			             collisionTiles[gridX][gridY+1] != 1 ||
			             gridX == lastGridX);

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 19, 2020

I have to investigate...

@arczi84
Copy link
Author

arczi84 commented Apr 28, 2020

Setting gridY to 3 worked for me.
Maybe lower FPU precision issue.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 28, 2020

I still haven't looked into this. But glad you found some workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants