sacredbanana / lab3d-sdl

Ken's Labyrinth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on 4.1.5 when playing Ken's Labyrinth 1.1

atalarikt99 opened this issue · comments

Every time I choose this version, the game starts fine, but after the first splash screen, the game crashes at the second one, in which Ken's voice "Welcome to Ken's Labyrinth!" plays (or is supposed to play).
Here are my options just in case.
image

Thanks for the report. What firmware version are you using?

My device firmware version is 2F2A5F, whereas my system firmware version is 58062017. (I'm using Windows 10 btw.)

So version 2.1 works then? If you run 1.1 in windowed mode do you see any errors in the console?

Yes, version 2.1 works on my end. I get no error message in the console while running 1.1, as it automatically closes after the crash as well.

If you open kens labyrinth from the command prompt/powershell then the text won't be lost when the game quits. can you try opening up the game with command prompt or powershell?

And sorry for the pointless firmware question, I thought you were running the Nintendo switch version haha

No problem, it's my fault I wasn't specifying where I'm running Ken's Labyrinth on earlier haha.

Anyway, here you go. Oddly, no specific error messages appeared.
image

Can you try older versions starting from 4.0.0 and let me know if that works. If it does, see if you can pinpoint which version it stops working

https://github.com/sacredbanana/lab3d-sdl/releases/tag/4.0.0

Late reply but I see no Windows build in any of them. Only Nintendo Switch and/or Linux build (on 4.0.0 at least).

Sorry I just remembered I only modernised the Windows build starting 4.0.1.

Try this https://github.com/sacredbanana/lab3d-sdl/releases/tag/4.0.1

I tried version 1.1 on 4.0.1, and tell you what, it sometimes works, sometimes doesn't (still with no apparent error message).

Oh, and Microsoft GS Wavetable Synth doesn't play any music either way in any version, despite the ksmmidi.txt file being there. At least on 4.0.1 the sound effect while moving the cursor doesn't bug and make a buzzing noise.

On the other side, Windows Security gave me a false positive for 4.0.1, which caused me to add the executable as an exception because I otherwise couldn't run it.

Sorry for another comment, but is there any way to disable vertical movement by mouse? I don't see any readily available way to do so so far.

Version 4.1.5 actually adds an option to configure that for ken's labyrinth versions 2/2.1, and vertical mouse movement in 1.4.5 is disabled by default. Version 1 there isn't a way to disable it. I can disable it for version 1/1.1 too in the next release I guess. I don't think anybody actually likes vertical mouse movement

image

It's still a mystery why version 1.1 is crashing for you. Are your graphics drivers up to date? It could be a driver issue with OpenGL

My current laptop has an Intel UHD Graphics 600 for its integrated GPU, which, if CPU-Z is to be believed, should support up to OpenGL 4.6.

I have some (good?) news. It's also crashing at the same place in the Nintendo Switch version. Now at least I'm able to experience the crash so I can work on a fix

Hey I managed to fix the crash (for Nintendo Switch at least) so hopefully it's fixed for you too. I also changed Ken's Labyrinth 1.x to support the disabling of vertical mouse movement (can set this in the settings menu as per the screenshot above).

I'm closing this issue but feel free to open it again if it's still crashing for you :)

And if you want me to look into that MIDI issue you should raise another issue for it so I don't forget

https://github.com/sacredbanana/lab3d-sdl/releases/tag/4.1.6

Okay, I've downloaded the new 4.1.6 version and most of the times it still doesn't work, while sometimes it does. At one attempt I only got as far as taking the first "weapon" before it crashed, and just now I've tried running 1.1 again twice and both worked. Not sure why (and how) exactly. At first I thought it had something to do with the screen size (I usually go with 1280x600 for my games), but changing it to 800x600 doesn't do much, other than probably increase a chance of running the 1.x version(s) being slightly more successful.

Also, I think this new version has another bug that could be rather fatal; the in-game options for changing window size only accept four digits, with anything else that isn't four digits being turned into such; for example, when I put 800 for the width and 600 for the height, I instead got 8008 and 6008 respectively, forcing me to change them via the .ini file.

So turns out it won't crash in windows running on my M1 MacBook Pro but it will crash running Windows on my Intel MacBook.

I think I've fixed it now. Expect a release in an hour or so.

And as for the window size input bug, it can't replicate the issue however I've made a change to try to fix it for people who suffer with the issue.

OK done. Try 4.1.7. I won't close this issue again unless you confirm its fixed on your end

After having done a more thorough test of 4.1.7, I think I can grasp what's exactly going on. 1.1 doesn't seem to be happy when I run the game on resolutions other than 800x600 for some reason, which is rather odd, considering 2.1 runs well with my usually-preferred 1280x600 resolution (what can I say, my monitor is 1366x768 shrugs).

Maybe this has to do with the graphics code? Either way, choosing resolution via in-game options now works well, no more of that annoying "four digits only" bug.

Could be due to the fact this game uses OpenGL 2 which is very old and deprecated. Your graphics driver just may not support it as nothing is written in OpenGL 2 anymore. The game itself sets up an OpenGL 4 context but it runs in OpenGL 2 compatibility mode. I had to make some changes one time because nothing would render on Apple hardware so I had to slightly modernise that section of code to use double buffering instead of single buffering. I have a long term goal of rewriting the graphics to OpenGL 3 which would make it run without issues on all modern graphics cards. I already have started this and my work is on a branch on this repo called opengl3. It is a very difficult task and so far only the launcher menu and game splash screens work. The in-game graphics are so bad it's unplayable. all the game objects are either not visible or get stretched across the screen. Unfortunately im a beginner with 3D math and nothing is drawing right because there's an error in my math and I haven't figured out where I went wrong.

Anyway, has the game stopped crashing for you now? I updated the SDL library to the latest version. I think there was a bug in the SDL library itself which is why I couldn't find anything wrong with my code. Updating the library stopped it crashing on my Intel MacBook in Windows

On 800x600? Yes, 1.1 has stopped crashing with that resolution so far.
Do you mind if I suggest you ask the likes of Ken Silverman or maybe even Fabien Sanglard about the 3D math thingy? Just my two cents.

It won't be an issue if I use the GLM library which does the math for you. Only issue is that it's a C++ library but everything here is in C. I could just convert any of the C files that do drawing into C++. No need to convert the entire thing to C++.

I don't want to bother Ken with anything like this when I can figure it out on my own eventually. I did ask him for help once and that's because I was completely stuck. I was new to lab3d-sdl and I decided I want to give myself a challenge and create a Nintendo Switch port of lab3d-sdl since I love Ken's Labyrinth. I joined lab3s-sdl after everyone had abandoned the project so I had nobody to ask help for apart from Ken himself. The only thing I needed to ask Ken for help on was when I finally got the game running on the Switch, the music was sounding glitchy. lab3d-sdl uses an Adlib emulator that Ken wrote himself. I had no clue how the adlib even worked and Ken's code is unfortunately very challenging to read and understand. He said its probably because the adlib emulator doesn't support 64 bit. He went in and fixed the adlib emulator for me.