Words Fail Posted January 23, 2023 Share Posted January 23, 2023 I have some weird bug.. I have 50 levels in my game.. I can play through all of them one by one testing them.. setting my game to load a certain level, recompiling, and playing the level.. no issues.. however, there's some kind of bug that if I start at level 1 and play through on level 12 the game bugs out and resets back to level 1, resets your score, etc. If I change my code to start on say level 10 or level 11 I can play through level 12 just fine. It's only when I go through a 12 levels. Another time I had set my game to (I forget what level to start on) and when I got to level 18 it reset to whatever level I started on! What's the easiest way to find my error? I've been trying to figure this out all day. I have space left in every bank: DPC free RAM= 603 39 bytes of ROM space left in bank 1 246 bytes of ROM space left in bank 2 3919 bytes of ROM space left in bank 3 1495 bytes of ROM space left in bank 4 133 bytes of ROM space left in bank 5 913 bytes of ROM space left in bank 6 3039 bytes of ROM space left in graphics bank bank 2 has game code. bank 3 is going to house code for the boss levels. bank4 has playfield color stuff. The level data is all stored in banks 5 and 6. I tried seeing if maybe the data was wrong somehow, so I made level=12 variable load level 13 instead. Same error. It resets back to level1, resets score, etc. I have no "messages", "warnings", or "errors" listed.'' I did the breakif {_scan>262} and my game will play fine.. the ONLY issue is playing 12 levels in a row the 12th level makes it crash. I don't know what number it goes to, but one time I saw 310 in the corner of my screen really quick. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 23, 2023 Share Posted January 23, 2023 You could send the code to me in a PM and I could take a look and see if there is anything I can find. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 23, 2023 Share Posted January 23, 2023 I have had similar issues that were the result of missing a return otherbank. 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 23, 2023 Share Posted January 23, 2023 And to answer your topic question I usually play and if something breaks I go to the part of code where that is supposed to happen and I see what the issue is. Over time I have gotten better at figuring out what went wrong, like if I did something like use the wrong variable or had a syntax error that wasn’t picked up before compiling. like I mention before I had this issue when I missed a return. I also experienced something similar when I forgot a “:”. Hopefully you find what is wrong. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 24, 2023 Share Posted January 24, 2023 I agree that it sounds like a missing return or the wrong kind of return, and I'd check those first. 1 Quote Link to comment Share on other sites More sharing options...
Words Fail Posted January 29, 2023 Author Share Posted January 29, 2023 On 1/24/2023 at 9:28 AM, Karl G said: I agree that it sounds like a missing return or the wrong kind of return, and I'd check those first. Here's the thing.. The game works fine up until level 12 it crashes. However, if I set the game to start at level 12 you can play through level 12 fine.. if I set the game to start at level 10.. it will then crash on level 17. Let's say I start on 17.. it will then crash on 24. If I start on level 16 it crashes on 23. So after level 12, it seems like it's crashing every 8 levels. All my levels are in bank5 and 6 and have return otherbank. Man.. I did find one spot I did a goto instead of a gosub, but that was on levels 1 through 8.. and didn't affect gameplay.. .. and then I thought I'd try a pop command on my levelend routine.. I thought I had the issue fixed, but now it crashes on level 15. .. so I removed the pop command and chaned all my gosubs to gotos.. it crashes on level 15 in a different way.. instead of the game resetting I get a black screen and 310 scanlines. Anyway, I'm adding a few features I had in the old version of my game and I'm gonna let Random Terrain have a looksee. Enemies firing, some levelend pizzazz, and I forget what else and if I haven't figured it out he offered to take a look. Quote Link to comment Share on other sites More sharing options...
Words Fail Posted January 29, 2023 Author Share Posted January 29, 2023 Hey I just fixed the issue! I just played to level I dunno 25 or 30 and it works fine. Here's what happened.. gosub coldet If you indeed collided with a playfield block it does it's routine for getting rid of that block. It awards you points based on how fast you were flying (50 points for normal flying, 100 points for faster flying). It then returns out of that gosub. HOWEVER, if you just cleared the last block on the level it GOTO a level ending routine. Adding a POP command before that goto fixed the issue, cancelling the last gosub called. PS - Not related to this thread, but one of you guys showed me a routine to speed up the ship using data statements.. so it builds up speed then slows itself down. I may use that in the future.. then it'll be even more of a challenge to score higher points.. you'll get 50 points for normal speed, 75 points for speed 1, 100 points for speed 2, and 125 points for the top speed. But you need to be careful they do eat your gas faster. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.