citron2010's Recent Forum Activity

  • How would I go about troubleshooting a crash (if in indeed that's what's happening) that only happens intermittently if the game has been in the background for a long time and other apps have have been opened (that presumably use up all the OS's RAM)?

    Can Xcode help with this?

    I wish I understood more about how Construct/iOS/Webview works with local storage...

  • You probably answered your own question, sounds like the app crashed so nothing was saved.

    I've just done a test on Windows (WebView2) - I figured out that local storage is written to this file:

    C:\Users\<username>\AppData\Local\<game name>\EBWebView\Default\IndexedDB\https_app.localhost_0.indexeddb.leveldb\000003.log

    And that file is updated as soon as I call: LocalStorage - Set Item

    So even if the app crashed, the data's already written to disk.

    Maybe iOS handles it differently? Maybe if the app crashes, the OS rolls back the local storage to a previous version? (It looks like that 000003.log file contains all previous entries, so in theory the OS could roll back).

  • Hi,

    I've noticed that on occasion, specifically when I've left my game in the background for a while then return to it, data I've written to local storage isn't restored.

    I'm pretty sure my code's correct - when one of the variables I store in local storage changes, I call a "save" function that writes all the variables I want to save to a dictionary, then saves that dictionary to local storage. When the game starts, I read the dictionary back from local storage, parse it, then update all the variables ready for the game to start.

    If I just put the game into the background, then resume, all is fine (the game's still running, all the variables have their correct value and nothing is read back from local storage).

    If I force quit the app and restart it, all is fine too. The game restarts and loads all the values correctly.

    If I put the app into the background, then start load of other apps, come back to my game it restarts (as opposed to resuming) - this also works without issue.

    It's almost as if iOS is caching the storage but if the app is left in the background for too long, it never actually gets written. I thought the last two scenarios above would replicate the issue, but they don't - it seems to only happen when the app has been in the background for a long time AND several apps have been opened in the mean time (presumably eating up all the RAM forcing my game to shutdown without saving the local storage).

    This is on a 6th Gen iPad with iOS 17.5.1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can diff the JSON files for the event sheets. I realize it might not be too easy to read but it will show things like where additions, changes and removals have been made.

    winmerge.org is perfect for this - works with entire directories. Windows only though.

  • bwnate - thanks for all this!

    My game's just been approved for release (just a bit nervous about hitting the "Publish" button!

    1. I might switch to that to get the Steam overlay working!
    2. I've implemented using either the F key or the Select/Menu gamepad button to toggle full screen*
    3. The official plugin has this too.
    4. I might add a "quit game" button and hide it on mobile but adding buttons to my existing UI isn't that straightforward - a) I'd need to make room somewhere to display it, and b) I need to update the gamepad menu navigation code.
    5. The problem I have is that the gamepads I have are PS1 clones with Back/View and Start/Menu buttons - but they don't have the XBox or Playstation buttons which I understand launch the Steam overlay (in the same way that the Steam button does on the Steam deck). In C3 - Gamepad - On Button Pressed, there's no entry for this button - do you (or anyone else) happen to know what button index it is? (I know Back/View is 8 and Start/Menu is 9). My initial submission failed due to lack of full gamepad support, so I just changed it to "no support" to get the game passed, but I'd really like to get it all working properly. I also know I'm supposed to show gamepad glyphs in the UI, handle gamepad connection/disconnection & pause the game when the overlay is displayed - but one step at a time I guess!
    6. Any updates on this?
  • This error keeps popping up more and more frequently for people - including myself. One thing I've noticed is that it happens more often when double-clicking the .c3p file in Windows Explorer. Instead, try launching C3, then using its Open - File menu.

  • I've just implemented an obvious workaround - if the game over screen's visible on resume, I just simulate the user clicking the arrow button which restarts the whole layout and clears the graphical glitch. Impact to the UX is minimal.

  • Deconstructing the project's going be too much work for the moment, so I tried a different approach.

    On resume, I loop through all the layers to check whether they're visible and if so, write that state to an array, make the layer invisible, then on the next tick, loop through the array and make any layers that were visible on resume visible again.

    This fixed issues 1 & 2 above, but I'm still getting this issue:

    If I flip the image vertically and squeeze it, it's clear that it's the first row from one of my sprite fonts:

    This is the sprite font in question:

    Anyone any ideas why this might be happening? (It's on resume on iOS after the game's been in the background for a while and always at the same "game over" stage of my game)? Any workarounds?

  • I’ve only disabled collisions between specific objects in event sheets but just checked the scripting reference for physics and see the equivalent: setCollisionsEnabled

    Failing that, any reason you can’t use event sheet actions to disable them?

  • i-Life Games is the name of your game, right?

    Click on the error and it should open the pods-debug.xconfig file

    Ignore the "// DO NOT MODIFY -- auto-generated by Apache Cordova" warning

    Remove the "#include "Pods/Target Support Files/Pods-i-Life/Pods-i-Life Games.debug.xcconfig" entry.

    Now try to build the project again.

    This happens to me when I export from C3 as an Xcode project but not if I export as a Cordova project and build the Xcode project myself using "cordova prepare" as per:

    construct.net/en/tutorials/building-mobile-apps-locally-21

    I do this for production so I can insert this plugin which hides iOS's home indicator bar:

    github.com/chipbell4/cordova-plugin-hide-home-indicator

    But for testing, to save a few clicks, it's easier for me to export as Xcode and delete that line from the pods-debug.xconfig file.

  • Just wanted to say that Show more information for -> Layers & Layouts is a godsend.

  • Keyboard - on any key pressed:

    Spritefont - append text - Keyboard.TypedKey

    Not ideal as:

    • You'd need someway to detect whether the SpriteFont should be accepting keyboard input or not (i.e. equivalent of a text entry box having focus)
    • Someway to handle cursor movement, delete, backspace, tab etc.
    • Word wrapping/resizing to fit
citron2010's avatar

citron2010

Member since 12 Mar, 2014

Twitter
citron2010 has 2 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies