|
Post by kennn on Apr 30, 2020 2:18:31 GMT -6
tbird, You suddenly appeared and quickly destroyed the rock bug. Thank you.
johnno56, There may be a bug about writing score record on hard disk. Sometimes after I input the name, the game stops automatically.(Not every time) I will test the game on another Windows computer later to make sure that it is a real bug. This bug may only happen on Windows computer.
|
|
|
Post by johnno56 on Apr 30, 2020 2:59:47 GMT -6
Can you describe the bug?.. er... Random feature... lol
|
|
|
Post by tbird on Apr 30, 2020 6:17:46 GMT -6
I was able to recreate once....possibly due to sorting or number of hi scores? I deleted the hiscore.txt and it was fine again.
|
|
|
Post by n00b on Apr 30, 2020 8:11:33 GMT -6
Can you describe the bug?.. er... Random feature... lol Lol I was able to recreate once....possibly due to sorting or number of hi scores? I deleted the hiscore.txt and it was fine again. johnno56 try looking in your highscore lib. It might be something simple. I will also look at it when I get a chance.
|
|
|
Post by johnno56 on Apr 30, 2020 8:52:14 GMT -6
I could be wrong... But, when I first set up the high score table, it was configured for 10 scores. The current version is for five... However, for some inexplicable reason, the "hs_maxEntries" was still set for the original table... Try changing it to five and see if the error happens again...
By the way, what was the error message?
|
|
|
Post by kennn on Apr 30, 2020 21:03:25 GMT -6
what was the error message? The error message is from Windows system. I use non-English Windows systems. The meaning of the error message is "A problem happened. Need to close." The bug happens on my second computer, too. Actually, this bug frequently happens. The bug normally occurs if I do these: 1. Delete the highscores.txt. 2. Play the game. After score is 1XX, allow the spaceship to die. Select play again. Input player name. <--| 3. Play the game. After score is 1XX, allow the spaceship to die. Select play again. Input player name. | 4. Play the game. After score is 1XX, allow the spaceship to die. Select play again. Input player name. |---But the number of rounds is not fixed. 5. Play the game. After score is 1XX, allow the spaceship to die. Select play again. Input player name. | Sometimes 4 rounds, sometimes 5 6. Play the game. After score is 1XX, allow the spaceship to die. Select play again. Input player name. <--| rounds, sometimes 6 rounds, sometimes 7. The Windows error message appears and tells me that the program will be closed. 7 rounds, sometimes 8 rounds, etc. Try and error? Ok, maybe I will try this suggestion later as today I may be busy.
|
|
|
Post by kennn on May 1, 2020 20:35:43 GMT -6
hs_maxEntries in hiscore.bas was changed to 5 but this bug still appears.
|
|
|
Post by johnno56 on May 1, 2020 21:20:12 GMT -6
Most odd. I'm going to guess that, the problem 'may' be related to the high score file being written to the hard drive, but because I cannot replicate the error on my machine (Linux Mint), I can only assume that it may be something with how Windows writes or sorts the high score file...
As I am not a Windows user I have no idea as to how to fix this. The syntaxbomb admin says that 99% of the users, on their site, are Windows based. If the problem with the game is Windows related, then it would be foolish, to submit a game with that type of error. The project will now be "put on hold".
|
|
|
Post by tbird on May 1, 2020 21:48:02 GMT -6
As I reported johnno56 I have replicated it and it was on Linux, it's not an OS based error. To replicate, you have to score just above 100 4-5 times in a row getting high scores, then on the final attempt it will crash after entering high score and hitting enter. I will have a look once I get home.
|
|
|
Post by tbird on May 1, 2020 22:37:45 GMT -6
Ok, I think I fixed it. I tested 10 rounds all writing to the hiscore and all went well...so far, lol.
|
|
|
Post by johnno56 on May 2, 2020 0:00:21 GMT -6
Replaced current hiscore.bas... Error occurred each time the score was > 100
|
|
|
Post by johnno56 on May 2, 2020 0:02:09 GMT -6
Quick quest... When the game aborts the message states "core dumped". Any idea where that file is placed? Maybe reading that will give us a clue?
|
|
|
Post by johnno56 on May 2, 2020 0:10:44 GMT -6
Never mind... Found it /var/lib/systemd/coredump/ etc
Looking for a file to open the archive... System doesn't have the ability to open ".LZ4" files... Stupid thing creates it, yet it can't open it...
|
|
|
Post by johnno56 on May 2, 2020 3:17:53 GMT -6
I gave up trying to read a core dump... stupid lz4 files... Instead i went back to hiscore.bas... Tbird, I tackled the problem mainly with trial and error. Reverted the hs_maxEntries to 11, played a series of 100+ games (at least 6), then reduced hs_maxEntries by 1 (deleting the hiscores file each time). When the hs_maxEntries reached 7, each time a game got over 100 points and replay was chosen, the error occurred. Set hs_maxEntries to 8 and the game played at least 10 times without error.
I cannot figure this out. The number of table entries is 5 so why is it that hs_maxEntries need to be 8?
I can understand when some Basic languages dimension arrays don't always do the same thing. eg: Dim a[10] Some mean 0 to 9 others 1 to 10. In both cases there are 10 elements. But this game requires 5 scores. 0 to 4 or 1 to 5... but 8? Doesn't make sense - to 'me' anyway...
I'm going to go over the hiscore.bas file... again... to see if I have missed anything....
|
|
|
Post by johnno56 on May 2, 2020 5:20:07 GMT -6
Tbird, I decided to use your method of "printing" to reveal data at different points. Great idea! I scrutinised the "hiscore.bas" file (with an extreme scrute) and did not find one error... There were in fact 3 errors!! Using the "print" method, I confined the error to the hiscore.bas file. Specifically the AddEntry routine... ' ORIGINAL:
function HS_AddEntry(name$, score) index = 0 ' Check if player score qualifies for index = 0 to hs_MaxEntries - 1 if score > hs_Scores[index] then exit for end if next if index < hs_MaxEntries then for i = hs_MaxEntries - 1 to index step -1 hs_Scores[i] = hs_Scores[i - 1] hs_Names[i] = hs_Names[i - 1] next
hs_Scores[index] = score hs_Names$[index] = name$ if hs_Names$[index] = "" then hs_Names$[index] = hs_DefaultName$ end if return true end if return false end function This is what I have concluded and correct me if I am wrong.... The "for index" loop does not need to be included as this loop has already been done prior to "congratulations". The "for i" loop is checked from hs_maxEntries-1 to index (5-1) to 0. Zero does not need to be checked as the new score will, at least occupy slot zero. Also, within the same loop, hs_Names is numeric, and should be string. This is where, I believe, the error is caused. I believe that it should be: function HS_AddEntry(name$, score) index = 0 if index < hs_MaxEntries then for i = hs_MaxEntries - 1 to index + 1 step -1 hs_Scores[i] = hs_Scores[i - 1] hs_Names$[i] = hs_Names$[i - 1] next
hs_Scores[index] = score hs_Names$[index] = name$ if hs_Names$[index] = "" then hs_Names$[index] = hs_DefaultName$ end if return true end if return false end function
I have run the game MANY times without fail... Oh, hs_maxEntries is now set to 5.... You will need to replace the hiscore.bas and subs.bas with the following. hiscore.bas (3.26 KB) subs.bas (17.28 KB) Please test the game as much as you can... or until you get sick of the "pew-pew"... lol Let me know if the error returns?
|
|