Game Randomly Crashing Without Error Messages

Hello

I’m trying to fix a really weird error in my WIP Blood Moon.

The game sometimes freezes or just stops loading at or near the end of Chapter 10. No error messages pop up, and so far I’ve not been able to replicate this in any of my playthroughs. However, the random test will sometimes freeze at that point too (again no error messages, it just stops working).

I and several other people have looked at the code and we can’t find anything wrong. Furthermore, if I start on a later seed in the random test it’ll choose a different place to freeze at. I tried playing through the game, making the same choices as the frozen random test, but it didn’t freeze for me and I was able to progress to Chapter 11. This makes me think it’s not the code but something else. I hope I’m wrong.

This error has only been reported when I uploaded Chapter 11 but it may be that it has been around since I uploaded Chapter 10 and no one reported it because they didn’t notice.

I know of two people at least this has happened to but it’s probably happened to others. I am really stuck with this one and don’t know what to do. Does anyone know why a game would start to freeze randomly? Again, this doesn’t happen to everyone, and doesn’t seem to be based on the choices made.

Please. If anyone knows anything please let me know. I’m really stuck with this one.

2 Likes

Hi there, can I ask if you’re using CSIDE to play/test your game? Sometimes when my chapter files have a really high word count (10,000+ words, though I only run into issues at 30,000+) and especially if I have the word count feature turned on, it makes the program freeze and very occasionally crash on me. Could this be something similar to what you’re experiencing?

Yes. That’s what I’ve been using to test the game. That could explain the bug in the random test because Blood Moon is roughly 250k now. However, the error where it crashes is happening on dashingdon.

Around which point does it happen? I looked into your code briefly and you have a bit (not much) back and forth jumping at times. the game might simply say screw it due to that.

Typically the end of Chapter 10, though it’s not consistent and if the random test error is connected then it’s not always at the same place.

is it randomly in ch10 or can you pinpoint a label after which it happens?

In regard to the random test, the freeze doesn’t occur on a label, but a choice, and which choice depends on which seed I choose, and sometimes doesn’t occur at all. Typically, it’s near the end of chapter 10.

Again, I’m not 100% convinced it’s connected to the freeze the others are experiencing when they transition into chapter 11, but it may be.

Are all the choices beyond a specific label (e.g. are they all after the ‘nighcourt’ label).

It might be a simple formatting thing (connected to ICF) that has the code hiccup. If that’s the case it would just need some small rearranging.

Edit: basically what might have happened is the code falling through the story. If the culprit can be narrowed down it should be easy to fix.

1 Like

It’s in chapter 11, the first *if block that checks conviction. If you have “survivor” stat, game goes to label “nota”. Then game goes back to checking *if block and triggers the *goto again, creating an infinite loop.

8 Likes

Oh my gosh! I think this is it. Thank you so much. You’ve saved me so much headache. I honestly don’t know how I missed that. :blue_heart:

1 Like

In these situations, when you know there’s a game breaking bug that is hard to find, you can try to reproduce through randomtest.

Start with the highest abstraction layer: in randomtest uncheck every single box, even “Avoid used options”. Start at seed 0. It will execute very quickly in this mode. When or should it freeze, take note of that seed number. Reload randomtest, again uncheck “Avoid used options”, but enable “Show choices selected during game” and “Show full text during game” this time. Input that seed number into the proper field. Randomtest will then either freeze on the line after which the bug resides or it will spam multiple lines ad infinitum if there’s a loop. Which is also an indicator of where the error is.

By the way I love your writing. Can’t wait to see your game published :grin:

4 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.