Saving Unique File... But only few times? - (project bug)

0 favourites
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hi All,

    I found a bug in my big project and I tried to solve it:

    I can Save few time, and it will open the system-browse window so I can choose where to save and what file name I like to change or use the default, but it works only for FEW times!

    When it stops working (ignoring the action) whenever I save via button OR keyboard (it doesn't matter) Saving won't open the System-Browse Window. I must mention that Loading and other options works fine, it's only the problem with "SAVE" on my project.

    While using the DeBug Preview I noticed that once "SAVE" gets ignore the FPS drop down from 130 FPS to 2 FPS for a moment, than it gets back (other actions such as export / import / load doesn't affect the FPS and keep functioning with no issues. Maybe someone can SEE the issue on my code:

    If I insist trying to "SAVE" more and more... the software crashes, as well Constuct 3.

    I hope that this information helps finding my bug.

    In my original code I use: Press "Btn_Save" | On clicked so I thought maybe it's an unfocus issue, so I changed it to "Ctrl+S" but the issue is still there after saving few times, that means it's nothing to do with the button code.

    Any help will be appreciated, Thanks ahead! :)

    Tagged:

  • It's probably not related, but why do you set IsUndoSave to true in event 124? Remove this action.

    Press F12 and open browser console when fps drops and you have problems with saving, see if there are any errors in the console log. Or maybe you'll see that your game is saved many times per second..

  • It's probably not related, but why do you set IsUndoSave to true in event 124? Remove this action.

    Press F12 and open browser console when fps drops and you have problems with saving, see if there are any errors in the console log. Or maybe you'll see that your game is saved many times per second..

    Thanks for the tip dop2000 I think you've found the issue! :)

    First I got rid of that action as you suggested (that wasn't the issue).

    Second thing I did with the F12 running on the other screen, and one time after another I clicked the "SAVE" button, then canceled (or ESC) to get out of it, then Clicked again, Esc, clicked Esc... until it STOPPED showing the Saving File Browsing window!

    I didn't notice anything unusual on my Windows System (not even CPU or RAM change) BUT! as soon as I Exit the current Run (F5 Preview from Construct 3) I got the message that says:

    94 downloads are in progress. Do you want to cancel the downloads and exit NW.js?>

    which make sense, I did press lots of save and cancel... so I thought it should CANCEL or (eliminate) the save window, which probably is still out there "waiting" BTW there are no popup windows out there waiting for me to save... when I clicked cancel, every window closed itself so this is very weird because where are these 94 saving windows hiding? (Not on any of my screens, not even shown on the taskbar process)

    This is what you've suspected! too many saves that didn't actually CANCELED when I click cancel or ESC.

    SOLUTION?

    What is the most efficient way to LIMIT only 1 save at a time? I guess disable or unfocus buttons won't do the job very well.

    What event / action should I add to accomplish this?

  • I don't know. Did you hit save button 94 times?

    Try disabling the undo system temporarily and test without it, maybe it's messing things up.

  • I don't know if I actually hit it 94 times, but as I explained I did hit SAVE once, canceled (using Esc or the Cancel button) many times one after one... not fast at all, to see if the problem is with the SAVE, because using Load or Export didn't make this issue.

    it's not that I'm flooding the SAVE button, but it's a GOOD to know that saving more than once is not recommended at the moment which is really weird!

    Even with the Undo/System disabled it keep saving zillion times, like it's ignoring the Cancel SAVE and keep saving another copy and another one.

    I noticed an error on the F12 console when I click the IMPORT button, it works fine, it imports an image fine but why it gives this error:

    This is my current IMPORT code:

    TOTAL MESS:

    So one thing I did notice, after IMPORT or EXPORT I cannot SAVE anymore... what a mess, it's more ruined than I thought! (I don't have any errors on export)

    It shows that I did SAVE but again, the original issue is there: No saving window appears not on other windows, not on taskbar manager nowhere... so it's a NW.js / browser issue probably!

    and when I quit my software, the console warning popup window:

    if I tried to save twice for example, so unstable that it's scary!

    Beside that weird RED error for the import which is bad by itself...

    Is there a way to LIMIT the SAVE to "ONLY ONCE" when clicking it?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't know, it's hard to do troubleshooting with screenshots.

    Disable or remove Undo system completely. Add different "Browser Log" debug messages in all events where you are saving or which may trigger the save. Try to find why the game is saved so many times, there is something in your code that's doing it.

  • Disable or remove Undo system completely. Add different "Browser Log" debug messages in all events where you are saving or which may trigger the save. Try to find why the game is saved so many times, there is something in your code that's doing it.

    Thanks for the tips dop2000 I appreciate it!

    Since I want to understand how to HUNT the bugs by using the console via your instructions, I've added different "Browser Logs" (I even included these words to get my EYES! hehe) at the end of the different lines under SAVE / LOAD (same group) as you can see on the screenshot.

    I just got started so I didn't do all the tests, but I wanted to understand something on the console and maybe if I'll understand it, I'll be able to get an idea what's up with my messy project.

    After I put these browsing log notes:

    As soon as I preview (F5) C3 and (12) for its console, I see a YELLOW line with an error and on the bottom these numbers are going up like crazy! (never stopping) something I wouldn't notice without the logs:

    I have no idea what's the YELLOW'ish error message is all about, I'm using a typical PC / Windows 10 and no special device.

    MY (very noob) QUESTION:

    Is that normal? or does it mean that it's on a neverending loop and I need to solve this (maybe by making a sub-event with "Trigger Once while true" to put them inside to make it work?

    OR

    If it's perfectly normal and it should run the endless numbers (emulating every tick I guess..) is that normal should I ignore it and move on?

    I'm asking because I don't want to skip any tiny bug and do my best to fix'em all one by one.

    Thanks ahead for any help! :)

  • I would ignore the yellow warning.

    What's very weird is why browser log for line 127 is triggered on every tick, and there is no message for line 126. Are you sure event 127 is nested (sub-event) under event 126? It should definitely not be triggered without clicking the Load button.

    Or maybe you copied Browser Log for line 127 somewhere else and forgot to change it?

  • Thanks for the reply dop2000 :)

    I hope that that Yellow warning isn't something that may affect other users on different OS: Mac / Linux / Other Windows versions?

    I just reloaded the C3 project and launched it again (I didn't change a thing, it's currently the same as you see on the screenshot) and it works without the 127 issue, only the Yellow warning.

    But I'm not sure if I understand what are these numbers counting on the console, does it mean what I guessed on my last post? the number of how many times the line runs? (endless counting / every tick) or this number is related to something else?

    OK, So the 127 line endless counting thing is gone. (I'm not sure why)

    And I kept trying clicking the "SAVE" button, wait a sec.. Cancel the window browser menu, and save again.. few times (not fast, I didn't want to flood or anything).

    I tried to emulate a user in-session when saving more than once while working.

    And the thing is that after few times, on every ONE SINGLE CLICK on the SAVE... I see 3, 4, 5 or MORE on the number of the side.

    Does it mean that it saving more than ONCE ?

    Hunting the bugs won't be easy but if I'll understand what to look for I may be able to eliminate some of them.

  • Yes, if you see a number increasing to the left of console message, it means that the same message was logged multiple times.

    3-5 repeated debug messages for 1 click doesn't seem right.

  • Yes, if you see a number increasing to the left of console message, it means that the same message was logged multiple times.

    3-5 repeated debug messages for 1 click doesn't seem right.

    Thanks! this is a good way to track some bugs you sure helped me understanding some debugging issues which I can't really understand on the built-in debugger with it's insane overwhelming information.

    I have no idea why the SAVE button do that after X clicks, it start acting normal when using it few times... I don't know what's the direction to check but I'll do some tests maybe I'll track the issue...

  • So after couple of hours messing around with logs, trying to see why the SAVE is not showing the window anymore... I don't see anything weird on the log, it just says what it does by the order.

    The thing is, I found out that if I use any of the UNDO hotkeys: "CTRL+Z" I can save again! but can't see anything unusual based on the current logs.

    The thing is that I don't want to ruin the current UNDO/REDO System since it works fine on everything else beside the SAVE button problem.

    So the BUG is happening after I use the EXPORT button, I can still LOAD project file or IMPORT image.png but I cannot SAVE project.

    So I minimize the bug hunting to the area where it is, could it be something on the order of the last event after EXPORTING the set "isUndoSave" to True? because it supposed to bring the UNDO back to work, which works... but do something to the SAVE.

    EXPORT button:

    SAVE/LOAD buttons: (Load works perfectly fine)

    Any ideas or suggestions I should try to play with?

    Thanks ahead :)

  • Why on earth did you put "Set isUndoSave=true" into event 148 again? This flag should only be set inside the "SaveStep" function! If you are setting this flag here and there in different events, this can easily be the cause of all your issues.

    .

    On a side note, why do you use "On left button released, Cursor is over button"? The problem with this event is that user can click somewhere else, move mouse cursor over the button and release. Why not simply use "On Object clicked" or "Button on clicked".

  • Thanks for this important reply dop2000 I believe that I left it there from the old version where I had issues with UNDO/REDO of the Save/Load when it was automatically saving on a loop (It's GONE now!)

    I hope that I won't do stupid UNDO/REDO mistakes, so let me get this straight:

    I ONLY call the function: "SaveStep" on events that I want to include in the UNDO/REDO history.

    Because of that old UNDO bug I'm a bit confused: if I DON'T include "SaveStep" the UNDO/REDO system just won't save anything? is that how the UNDO/REDO system works? so I don't need to touch ANYTHING but the "SaveStep" if I need it? I hope that you can approve this, if not please explain if I'm wrong here, I'm trying to simplify it so I can move on without ruin it.

    .

    To your question with the On Left released, I'm not sure how much I progressed since that screenshot but the main reason is because I designed original buttons based on sprites and got rid of the UGLY built-in buttons.

    So I made it work with modes: "off", "over", "click" (animation with 3 frames) so I have control on the visual and on the actions:

    It's hard to show, but I made it work like most applications: ONLY if I Release the left button while it's OVER a button it will execute the action, it just made more sense to me:

    So far it works perfectly fine from what I've tested, but I still need to solve some overlapping issues of course, not simple as I thought because it's already a mess with other "dragging / dropping" that may clash.

    And now... TO THE NEXT BUG-STORM!!! (I already SAW something on the console and I'm scared) I'll try to cleanup my code first before I'll post anything.

    Once again THANK YOU so much my friend, I'm learning so much from you! :)

  • Like I said, you need to disable the Undo system completely and test saving feature. If it works correctly without the Undo, then you will know where to look for the problem.

    And of course, if you are not calling "SaveStep" function, then undo won't work.

    .

    Try clicking anywhere on an empty space, hold the mouse button, move cursor to your sprite button and release. It will work as if the button was clicked.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)