Begeegee's Forum Posts

  • Put this CAPX together real quick. It's just a simple project with 4 layouts (3 regular layouts and an Inventory layout). The 3 regular layouts share a single event sheet - note: you don't NEED to do this, as they can still have their own sheets and work. Inventory layout has its own inventory sheet.

    "On Start of Layout", as suggested by Equinox80, the layout name is stored in a global variable called Last_Layout. I've made it a text variable, and one easy way to do it would be to simply use the system expression "LayoutName" to automatically set the variable to the name of the current layout.

    In the Inventory Sheet, when the Back button is pressed, I simply use "Go to layout (by name)" and type in the "Last_Layout" variable.

    Remembering Last Layout CAPX

    Hope this is what you're looking for!

  • This feature sounds really useful! Would love to see it if possible, having just made an app with a lot of audio in it!

  • Thanks for the feedback. I guess i'm still wondering if this is a bug with the platform? I say that because I thought the idea behind the platform was to abstract any issues or dealings like this away from the developer and "just work". If I say it's a solid, it's a solid, it absolutely will not allow anything to pass and the platform should calculate and guarantee that. Or maybe this is an intentional design that developers want, wherein x% of objects will escape a solid?

    I think it's extremely unlikely to be a bug with the platform (and by that I'm assuming you mean Construct 2 itself). As in any software, bugs in C2 do happen, but I would think this is not the case, and the problem you're experiencing is due to the limitation of how computers actually work and how the ticks actually run and are computed. I believe the above posts are correct. That tutorial is massive so I've not been able to look at exactly what you're talking about, but I think in my words, this is what's going on:

    • Bullet is shot
    • Bullet travels at speed 2000
    • The above means it travels very fast at 33 pixels per tick or something
    • The wall is not thick enough/the bullet is too small, meaning:
    • Bullet literally is able to teleport through the wall and this is normal

    Construct is working like this: During one frame, the bullet is close to the wall but not yet colliding with it, so Construct has no reason to check for collisions. It cannot predict the future! During the next frame, the bullet has to be moved at its speed (still assuming 33px per frame). The bullet is moved and appears on the other side of the wall. Construct didn't check for collisions because it never hit the wall. This is due to the "jump" of 33px per frame being too big; wall thickness / bullet length is not enough to even cause physical contact between the two to happen. As far as I'm aware it can't detect between a tick.

    The only solution I can think of would be to detect when the bullet is outside of the wall (either by using its X or Y, or having some kind of large, invisible sprite outside of the wall that a collision could be detected from). When you detect that collision, you run your code that's supposed to happen after that, and for example that may be destroying the bullet and creating particles on the inside of the wall at the appropriate place using some kind of calculations. It's a bit dodgy though imo. Hope this helps!

  • We reverted to r200 and the game is working FINE on iOS! Absolutely no audio issues (yet) and no black screen either, and scripts minify fine. Would suggest if you don't have any dependencies on later Construct versions (like the new Local Storage or whatever else has been added), then you should be fine to revert...

    It's probably not recommended to do so but you can change your project's version number by saving your project as files (not as single CAPX file). Open the .caproj in Notepad and near the top find:

    <saved-with-version>VERSION NUMBER</saved-with-version>

    and replace the number with your desired version number followed by two zeros.

  • I'm gonna sound like an ass but it's just not even funny, like, the stress we are having... in our case we recently released a game on iOS and got some good numbers, only to later realize there's somewhat infrequent but catastrophic audio problems (not a problem with the game)! We exported after 206 which had apparently had audio bugs or clashing with Safari in some way. Beta 213 should have fixed this but we still get the audio issues and now we're presented with a lovely black screen too...

    As was suggested earlier in this thread, tried this:

    • find function that starts like: C2AudioInstance.prototype.getDuration = function (applyPlaybackRate)
    • change

    let ret = 0;

    to

    var ret = 0;

    Black screen is gone, game works (unminified of course), but still get audio issues 213 was apparently going to address...

    We're very apprehensive to push a much needed update for the game just in case the problems get worse! Would have been great if we could have done that while we were riding on the wave of downloads we were having...

    We are so behind!

    ahh!

  • Having this same issue on R213 about script not being minified.

    Using Windows 8.1.

    Even updated to the latest Java (Java 8 Update 60 for 64 bit).

    However, I am exporting as Cordova from Construct and then using Intel XDK to transform it into an iOS app. The app just opens as a black screen and does nothing.

    Can't test to see if the new release addresses our audio problems :'(

  • Ashley Ahh good to know.

    I'm curious, you said it's a bug in Safari 8 but from what I remember Cordova/Crosswalk makes the game run in a sort of limited Chrome browser? Or if the target is for it to be an iOS App does it use Safari then?

  • I'm so glad I found this thread. yCUzWzM2HJGV IJCT just to be sure have you guys physically published to the App Store or is this a browser based app? Did you use Intel XDK or other wrapper?

    I'm experiencing this exact problem on an app published on 27th August to the iOS App Store. When you press the home button to come out of the app, and then go back into it, every single SFX that has played so far IN THAT LAYOUT will play at once. This could blow the speakers on the device! It affects all SFX that have been placed inside the "Sounds" folder. The bug has been seen on iPad Air 2 and iPhone 5c (devices we have available) both of which have the latest version iOS installed.

    The app is exported out of Construct with the Cordova option and then we use Intel XDK to wrap as an iOS app. Also created a test app and was able to reproduce them all playing when coming back into the app. It seems the issue is in the export process of either Construct or XDK, as it won't happen when previewing.

    Made quite a long worded thread about this in the General forum, but no replies. Have since done some tests so I'm going to make another thread in here very soon with better information.

    This is quite a big issue and we're also experiencing some even worse audio problems that could be related. We get a random loud POP or BZZT that often kills all audio on the app permanently, EVEN IF THE APP IS RESTARTED. Only fixes itself if another app with sound is loaded before loading the my app again. That issue can sometimes trigger when receiving a touch input. Might have something to do with music only being able to be heard after a touch input?

    Another issue we have is all SFX randomly becoming very low quality, sounding bitcrushed and lower pitch.

    So weird and frustrating! We've staggered an update to our app just because of this issue and have lost WEEKS OF TIME OVER IT. This needs to be addressed ASAP.

  • New post for a revelation on the problem:

    It's very likely the Intel XDK could be doing it. Made a blank app with some heavy audio usage in it and have experienced the 3rd and 4th points at the top of my previous post.

  • It's certainly an impressive plugin, but we did find the workflow in which you had to do stuff quite weird and we took forever trying to figure out how to do simple things. And we could never get the game to export (just came out as a black screen). We also tried resizing the view for different aspect ratios (tested in the browser because we never got it to export), but it would always STRETCH the game rather than reveal extra space. We tried loads of different combinations of settings. If you're looking to do serious 3D stuff, personally I would say go with a new engine. :/ Sucks to have to relearn stuff but we're exploring Unreal because it has the Blueprint system (visual coding).

  • Hello there, (I am updating this thread as I find out more info)

    Got a very serious and bizarre audio problem on a released iOS app that has several symptoms (while only running on device):

      1) Can only be described as all sounds in the "Sounds" folder (SFX) becoming downpitched and low Q/bitcrushed. 2) Device will sometimes emit a loud BZZT or POP (no such sound exists in game) and after this, audio as a whole usually doesn't work, SOMETIMES EVEN IF you close the app and restart it. To get audio to work again you need to load another app to get some sound to play and then open ours again which forces it to work. It's as if something is temporarily BREAKING on the device. 3) Audio can just not work. EDIT: 4) Forgot to mention that if you press the home button to come out of the game (but game is still running in background), when you re-enter the game EVERY SFX that has been played so far inside that layout will play at the same time. Can be repeated.

    All of these problems generally happen quite randomly (and less than 50% of the time in our tests) with a slightly higher chance happening when a new layout is loaded or a new audio track plays, or after an Admob advert has been watched. Restarting the app can sometimes even cause or fix these problems!

    Only tested this on iOS so far but it does happen across different iOS devices (iPhone, iPad). The fact we had a few players tell us is pretty worrying.

    Some maybe relevant technical details (since I cannot provide CAPX):

      - 6 music tracks, on average 45s long for each.
      • 18 SFX files.
      • The most demanding layout will play all of these bar one music track.
      • Even so, the problems can still occur in the menu layout which is much less performance heavy.
      • EDIT: Minifying script changes nothing.

    We haven't got the slightest clue what's causing it, hence why I posted in General. So far we've suspected:

      - Bad audio code (done a complete overhaul, read below)
      • Bad audio performance (maybe something to do with bandwith or overloading the audio thing on the device, hence bitcrushing esque noise)
      • Construct bug
      • We updated Construct (EDIT: tests have now shown this is unlikely a cause)

    Something to do with the HTML5 limitation that requires a tap to trigger audio. Can sometimes emit the BZZT or POP on the first touch.

    I will now elaborate on a few of these below to try to give you as much info as pos. Brace for wall of text:

    We're leaning away from it being a problem in our code as we've since re-coded the whole audio system in the game to be more efficient, and the problem still exists. But just in case someone spots anything weird, here's the old audio system we had:

    The audio system always had to be a bit dodgy in the first place. We export as Cordova out of Construct and we use Intel XDK to wrap it as an app. Now, with this workflow, I've read Crosswalk cannot fire a "Set Silent" or similar event and I do remember we had problems with this way back in early dev. So we had to find ways around that to mute music and SFX independently.

    Our game is essentially an endless reaction game, and as you score higher you go through "zones" within the same game layout that each have a different audio track. Each audio track was composed to the second according to how long it would take to transition to the next zone. So when you hit a new zone, track 1 is already tailing off and track 2 begins. Due to latency issues/HTML5 only playing things when the screen has been touched, we had to set all music tracks to play on start of layout and then immediately pause all of them if they hadn't been set to muted (in that case, they were just stopped), meaning when we needed to play a certain one, we would tell which one to resume and it would play instantly as the screen had been touched way earlier in the game. This led us to think all this paused audio was sort of hogging resources. Oh and I forgot to mention, for all the SFX, when muted we would add a mute effect to every single one. Doesn't seem too efficient, adding a mute EFFECT? Which is why we did the following:

    All SFX now are inside a function in its own event sheet that gets included where needed in the project. No SFX ever has a mute effect any more, the function behaves in a way that just listens for when a SFX is needed, picks the appropriate SFX, and only plays it IF muting is OFF. A lot more efficient right? I have no idea why we didn't do that in the first place.

    As for the music, it now works as a sort of relay system, so that 2 tracks are only ever loaded at once instead of 5. So at the start of the layout track 1 and 2 are set to play but then 2 gets immediately paused. When 1 finishes, 2 resumes, 3 is set to play and then paused. And so on. So is it safe to say the sound in the game and the way it's coded is not the problem? We (maybe) think so! An update to the game that incorporates this new system will be pushed tomorrow (not that it fixes the problem...).

    Finally, we built the majority of the game in Construct version 200 and since about a month ago we've updated and are using the latest versions. We cannot help but wonder... is it related? We don't think we had these problems before then... Did any updates since 200 address or cause any audio issues?

    Anyway we haven't had the time to replicate the problem yet (nor do we even know how...).

    Apologies for lack of details, but given the nature of the problem... what can I do? I do apologize for not uploading a CAPX but we obviously don't want to give people our game. You can find the game on the App Store (search for Fallen). We would greatly appreciate if anyone could try and reproduce the bug and post their thoughts. Try opening/closing the app and muting/un-muting to try and get it to trigger. You'll know it when it happens! It will be updated to version 1.0.1 probably within the week. That version will have the new audio code as described above.

    Long post... but looking forward to see if anyone has any ideas!

    EDIT: We've opened an old build built with version 200 and and exported with the new and old sound code and the problems STILL OCCUR.

  • You need to scale the game slightly oversized. Check out this tutorial my help. https://www.scirra.com/tutorials/998/screen-resolution-for-mobile

    Sorry for the late reply, but thanks for that link! It was not the video itself that made it work, since that required changing the size of the layout which can't really be done this late into development without costing a lot of time. But one of the comments! I simply changed Unbounded Scrolling to Yes on all layouts and FullScreen in Browser to Scale Outer, and magically, it worked!

  • Hi there!

    I’m looking for a simple and smart way to auto-size my game on different devices. So, the game is primarily designed for iPhone 5 and up which means the game is built on a resolution of 640x1136, and is in portrait. When played on higher resolution devices of the same aspect ratio, such as the iPhone 6+, everything scales up fine.

    The problem is with iPads since they have a wider aspect ratio, and while the game still scales to fill the screen as much as possible, there’s black bars by the sides of it.

    Here’s my solution, but I don’t know if it’s possible since whatever I tried so far hasn’t worked. Without changing the resolution of the whole game (since that’s going to break everything and require time I don’t have), I’m wondering if these black bars on either side of the game can be removed, revealing a sprite behind them (placed outside of the layout) which looks like an extension of some buttons, and can be tapped on. So whatever width greater than 640, the game will automatically scale up to fill the screen and reveal part of this sprite.

    Here’s a basic diagram to help visualise what I’m trying to explain:

    https://www.dropbox.com/s/5pnqco54w12s4 ... m.jpg?dl=0

    So imagine it like a pinball table (which the game isn’t!). You see inside the all of the table when at aspect ratio of iPhone 5 and above. But when the aspect ratio is wider, you see outside of the table (the floor/walls etc.). Hope that makes sense <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    With this idea, I don’t see a need to detect the device width and manually resize the game and shift all the sprites across by X. I’m actually hoping I won’t even need to touch the code! I figure if it’s doable it must be something to do with the “window”, “layout”, “margins” settings etc. so that when the game scales up automatically, the back bars are not shown, instead it just sees outside of the layout (so I don’t have to change positions of any sprite in the game based on the device width, which is a massive undertaking…).

    Off to sleep now but will check the thread tomorrow!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I actually just posted this tutorial in another thread hehe. But we used it in our game to take a snapshot of the screen on death, and when you click a "share" button, it will bring up the official Android menu or iOS equivalent with all your sharing options, or even if you just want to save that screenshot you can do so to your photos.

    https://www.scirra.com/tutorials/1457/s ... os-android

  • Might want to check this tutorial! We used it in our game for screenshot sharing and it brings up the official Android or iOS menu with all the sharing options. Unfortunately, couldn't tell you how to do it though as I didn't work on that feature myself.

    https://www.scirra.com/tutorials/1457/s ... os-android