How do you clear the JavaScript Text Buffer?

Hi,

I have an oddball game error problem, that sometimes occurs and sometimes doesn't. And when it does occur, after a little bit of time, it corrects itself. What happens is that after playing for a bit of time, text stops being posted/printed to the screen and then after a bit of time, starts posting again. I thoroughly checked my logic, and ensured that the issue wasn't being created by a logic error; ie bad initialization of a variable, dangling pointers, null references, division by 0, infinite loops, and bad conditionals for Booleans. And, I found that even when it didn't post things on the screen, it still performed the appropriate calculations. So, if it was supposed to tell the player the monster did 8 damage, reducing your health to 72 HP, your HP is reduced to 72, despite no message appearing on the screen.

So I discussed it with a friend somewhat knowledgeable in JavaScript, and he says that it sounds like I'm overflowing the Text Buffer. He says that when the buffer is overflowing, no text will be posted/printed and once the buffer is cleared, that's why the issue corrects itself and starts posting again.

So... as per the title of the post... How do I clear the Text Buffer, prematurely? As my game is played in rounds, and up to 6 messages are posted to the screen each round and rounds can be done very quickly, its understandable that the Text Buffer is getting overflowed. But, as the issue corrects itself after a few rounds of no posting, I'm assuming there is some way to clear the Text Buffer.

Anyone know how to do it?


K.V.

Um...

Is it this game?

If yes, is it the version that can currently be downloaded from that link?


That is correct


K.V.

Does all the text stop printing to the screen, or does it only effect certain text (like the custom status pane or the location/status bar)?


It stops posting text in the main part of the screen. The Status pane and the custom Status Pane are unaffected.

Appears to only affect print (expression) while print (message) still posts.


Does this happen in the desktop version, or when playing online?

Appears to only affect print (expression) while print (message) still posts.

There's no way the JS can know that.


I've only played the Desktop version, so I don't know if it does it for online players. No one has reported it, but then again, I don't think any of my playtesters have touched the game recently, either.

Hmm, interesting. Okay. Well, its just that when the bug occurs, only messages with "print message" appears on the screen and anything with "print expression" doesn't appear on the screen while the bug is active and once the bug isn't active, it properly posts to the screen. Most of the time it properly posts to the screen, which makes trying to understand the bug extremely difficult or finding what is the issue. It is probable that it is an issue with my code, but I've skimmed over it for 2 hours and rigorously tested edge cases and it works fine... until it doesn't for a period of time, then goes back to working.


K.V.

Could you play until it happens, recording a walkthrough, then post the steps here?

That way we can look at exactly what you're looking at.

I tried a few times, but never noticed it not printing messages.

Of course, I don't know when messages are missing unless nothing prints after entering a command...


Well, its just that when the bug occurs, only messages with "print message" appears on the screen and anything with "print expression" doesn't appear on the screen while the bug is active and once the bug isn't active, it properly posts to the screen

Does that mean that when it goes back to normal, the "print expression" messages that should have appeared previously appear at the end of the output in a bunch? Or in between the "print message" messages where they should have been? Or it just goes back to printing new ones normally, and there's still previous output missing?


How do I do a walkthrough?

It happens apparently randomly, or perhaps I'm just not noticing a pattern (that is entirely plausible). Basically, all I do is I choose a Dwarf, (melee playstyle) buy Shield Spikes, and descend into the game proper. Then I fight mostly Quicks and Toughs (as the melee playstyle usually gets destroyed by Spellcasters) until they die and once dead, I explore a new room, and keep fighting monsters and exploring until it occurs. Seems to occur after fighting 5-6 monsters and exploring rooms all in a row.

I'll post a screenshot of it when I get it to happen again.

When it returns to normal, they do not appear at the end in a bunch and any ones that weren't posted previously aren't posted still. It just goes back to printing things normally.

Its plausible that there is some kind of weird logic error that is going on that is preventing message printing, but I'm at a loss at what it could be. I've ensured that all values get initialized with integer values (as they are integer variables), I'm making sure there are proper conditionals and no infinite loops, I'm making sure that if something goes into the negatives, it gets defaulted to 0, and I'm ensuring that I don't have division by 0 even when I default something to 0. Plus even if there was something wrong with the conditionals, I'd still expect it to use the ELSE path, which also posts a message to the screen.

So yah, I'm at a loss at what the issue is. If there was a problem with the monster I'd expect that then I'd be able to figure it out, but it will often post messages for a monster, stop, and then go back to posting. So dunno.

I guess, the question is, is there anything that could prevent a message that normally posts, from posting, as a rare edge case error. Something like a null reference, or text buffer overflow, or ...

A calculation had an issue for a value that would be included in the posting and prevents the entire message from posting. ie If the message is supposed to display how much damage it did to the player, and there was a problem with the calculation that produces the damage dealt, could that prevent the entire message from posting?


K.V.

How do I do a walkthrough?

image

image

image


Then, just play until it messes up. When you stop the game, the walkthrough will stop recording.

(This only works in the desktop version of Quest.)


Ok, where would I find the walkthrough, once built?


K.V.

Oh yeah! Sorry about that!

Enter full code view, and it should be the last thing from the bottom of the code.


K. I also released a quick hotfix, addressing a playtester's concerns with the Tutorial and Help commands, for the game. Now that it is addressed, I'll look into making that walkthrough.


I've terminated development of the game. Gave a lengthy reason on the games description. It is very playable and enjoyable in its current state, but I'm moving on to try and translate the game into an ASCII based roguelike instead of a text adventure. Thanks for trying to assist me in this problem at hand and all the help you guys, and other posters have helped me with developing a text adventure. Cheers!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums