hydracastlelabyrinth icon indicating copy to clipboard operation
hydracastlelabyrinth copied to clipboard

Game freezes

Open arczi84 opened this issue 4 years ago • 10 comments

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 avatar Apr 19 '20 09:04 arczi84

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

arczi84 avatar Apr 19 '20 10:04 arczi84

The function rand() cause the freeze?

ptitSeb avatar Apr 19 '20 12:04 ptitSeb

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

arczi84 avatar Apr 19 '20 13:04 arczi84

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

ptitSeb avatar Apr 19 '20 15:04 ptitSeb

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

arczi84 avatar Apr 19 '20 15:04 arczi84

Overall looks like rand() issue, yes.

arczi84 avatar Apr 19 '20 15:04 arczi84

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);

arczi84 avatar Apr 19 '20 18:04 arczi84

I have to investigate...

ptitSeb avatar Apr 19 '20 19:04 ptitSeb

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

arczi84 avatar Apr 28 '20 09:04 arczi84

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

ptitSeb avatar Apr 28 '20 09:04 ptitSeb