RANDOMTEST FAILED: InternalError: too much recursion

I’m having trouble with Randomtest.

The error I’ve been getting is

AAAAHHHH

1008

AAAAAAAAAAAAAAAAH

1501

AAAAAAAHHHHHHHHHHHHH

1523

ARRRRRGGGGHHHHH

1554

NOOOOOOOOOOOO

1555

GAAAHHHHHHHHHH

1563

WHYYYYYYYYY

AAAAAAAAHHHHHHHHHH

1588

ARRRRRRRRRRRRGGGGGHHHH

1608

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

1641

So these all happen about 1500 iterations in. They often occur during Molloth’s text file, but also at random points in other text files, unprompted. Often in the middle of a *fake_choice or a *page_break that isn’t doing anything at all.

I know that a recursion means that it’s repeating on itself endlessly. But as I mentioned this error occurs seemingly in innocuous sections of the game. What’s going on here?

6 Likes

An update.

I turned off the option “Avoid used options (less random; finds bugs faster)” “Show Choices” and

10000

1 Like

Wait, nope, that’s not the solution. Apparently it was actually turning off “show choices”.

Don’t understand why removing a purely aesthetic option would prevent this error.

1 Like

Try downloading the latest version of ChoiceScript from Github.

This is a “stack overflow” error. Firefox calls it “too much recursion.” Chrome calls it “Maximum call stack size exceeded.”

randomtest wasn’t popping the call stack when you *return from *gosub_scene, so if you *gosub_scene 1,000 times or so, you could hit this error.

6 Likes

Seems like a case of too much recursion.

3 Likes

Throwing my pitch in. But, maybe the random test is hitting an upper threshold of looping? Have you tried *looplimit?

2 Likes

I’ll give it a shot! Any ideas why this error occurs when choices are shown but does not occur when choices aren’t shown?

1 Like

I’m chiming in on this a little late, but I’ve just been hitting the exact same error, always at around 4900 iterations, and always in a different part of the game.

My solution: change browser. I’d always hit the error when running the randomtest in Firefox; in Chrome, the test passed without any problems.

So, y’know… if you don’t like the result that the test is giving you, maybe… change the test? Worked for me, anyway.

2 Likes

Earlier in this thread, I suggested using a newer version of ChoiceScript. Did you try that? Did that work or no?

1 Like

For my part, this error was occurring with the newest version of ChoiceScript, just downloaded yesterday. Pretty much the exact same thing that was happening in the original post.

1 Like

Just going to a newer version did not have a suitable result. I’ll try the *looplimit suggestion next. I’m able to get a complete randomtest pass, but only with certain settings at the moment.

1 Like

I think your best bet is to try the new Node-based randomtest tool, described in our online documentation. Testing ChoiceScript Games Automatically - Choice of Games LLC

To begin, if you haven’t already, you’ll need to install Node.js. Node 10 or higher should be fine.

On Windows, you can run the tests by double-clicking on the included run-randomtest.bat and run-quicktest.bat files. (If Windows SmartScreen Defender gives you trouble, click More Info, Run Anyway.)

On a Mac, you’ll need to use randomtest.command and quicktest.command . (If you get the “can’t be opened because it is from an unidentified developer” error, hold Control, click on the file, and click Open.)

I think you’ll find that these tools run faster than the randomtest.html you’re used to, and that they won’t randomly fail with a “too much recursion” error under any circumstances.

4 Likes

I had this problem once and I want to ask if all the lines the test ended all lead to one scene it could be that you’ve created an indefinite loop . Try using the looplimit command of if they all lead to one exact label in a scene try looking for any signs of an indefinite loop and if the loop is caused by an if statement ,try making a new stat of temp with either a changing random variable or you set it as “+1”.

1 Like