hydracastlelabyrinth
hydracastlelabyrinth copied to clipboard
Game freezes
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.
OK, found the code. Seems rand() issue on Amiga.
The function rand()
cause the freeze?
Game loops if it is run on low end cpus. For example when enemy wizard disappears.
Oh, I see. Sounds bad. Did you find a fix or wrokaround?
I'll try to optimize game first. If that won't help I'll make some workaround.
Overall looks like rand() issue, yes.
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);
I have to investigate...
Setting gridY to 3 worked for me. Maybe lower FPU precision issue.
I still haven't looked into this. But glad you found some workaround!