SketchyLogic's Forum Posts

  • Right now, AJAX requests are exclusively for dialog, but I might use them for save files in the future, so sure, I'll make that change.

    I'm running a stress test now. I'll update if I can find anything unusual.

    Update:

    After running a test with tens of thousands of AJAX requests, I haven't been able to create a spontaneous error. This is a good thing, I suppose - it means the problem is probably with my code, not with AJAX.

    I did notice one thing - the speed of AJAX completions skyrockets when the window is out of focus, I guess because the game loop is no longer confined to the framerate. Not too surprising.

  • Sure, here's the important bit of code. Request the file, stick it into an array, then if the level calls for it, immediately call the function that parses the array. I think, when the request fails, "on any completed" doesn't trigger at all.

    A stress test is a good idea. I'll set one up later.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For in-game dialog, I like to use separate text files which I load through AJAX at the start of a level, save to an array, and then parse line by line.

    This works perfectly 99.9% of the time.

    But on very rare occasions, the requested text file simply won't load. For my current in-development game, I've added an "on any error" condition so that I can see if a request failure happens in the future, but given how rare and seemingly random the error is, it might be hard to test for. I might go months without seeing the error again.

    Bearing in mind that my game is offline (NW.js) and that I'm not doing something silly with file names or weird file contents, my questions are:

    1. What might cause a file requested through AJAX to return successfully most of the time, but occasionally fail?

    2. Is there an alternative way to load text files that never results in failure?

  • Just a quick update of what I've learned from fiddling around:

    1. For me, Electron has the same recording problems as NWjs. This wasn't surprising since the problem lies with Chromium, not NWjs.

    2. Reverting to the oldest version of NW listed on the Scirra site (v0.11.5, Chromium 38, 5th January 2015) fixed my issue of a black screen when recording through OBS. That's a relief. If this matches other people's experiences, then that means that simply using an old version of NWjs can make a game more streaming/recording friendly.

    Would anyone happen to know which Chromium version started the more severe screen recording issues? I'm guessing it was around 50.

  • Apologies for reviving this thread. I don't want to retread something that's already been discussed extensively, but I wouldn't mind clarification on a few things.

    1. What are my options for making an executable more likely to be stream-friendly? I saw some suggested additions of "--single-process" and "--in-process-gpu" to package.json, but they didn't make any difference for me.

    2. Has anyone tried recording an Electron application? I might give this a go myself if no one else has.

    3. Recording works fine with Firefox, which makes me wonder if there's a NWjs-like application wrapper for Firefox. I'm guessing not. (Why not? Firefox is open source, right?)

    4. I remember managing to get OBS to work with little issue on an older version of C2/NW (some time in 2015). Was there a particular NW version that started the black screen issues, or has this always been a problem?

    I'm a little eager to solve this issue because I'm balls-deep in the development of a game that I think would benefit greatly from streaming. I'm aware that it's a tricky issue though, and it's clearly not Scirra's problem to fix.

  • I'll tell you why I made the switch: I discovered that Windows magnification settings would cause regular text to be displayed at "incorrect" sizes. I needed my text to look absolutely consistent between computers, and I couldn't find a way to make text objects ignore the magnification settings, so I figured it would be easier to just switch to sprite fonts rather than have unreadable text for any players who had the setting turned on.

    I don't think this is a big issue, especially since only a tiny portion of players use Windows magnification, but it's worth considering if you suddenly see enormous text on someone's computer.

    Edit: rephrased for clarity.

    No, that's fine. I just wanted to congratulate you - not many people your age manage to make it so far into developing a game. Keep it up!

    I played your demo up until the Flappy Bird section, but had to give up around there. I think you need to make sure that the player has enough time to react on each screen, otherwise they'll end up dying before they know what they're in for.

    I notice that your profile says that you are 9 years old. Is this accurate?

  • This plugin works nicely. I just tried making an isometric dungeon by putting down an object for every wall, door, and floor in the appropriate isometric position, and it turned out great.

    Is it possible to return a new seed after editing a level?

    If you're asking whether you can return a new seed after putting down a few custom characters, then no, that wouldn't be possible due to the nature of how seeds work. However, you could use the "for each cell" event to iterate through the data and dump it to a JSON file, and then load the custom dungeon with the "load from JSON" action.

  • I think the image memory goes up to around 250MB. Some down-sizing will definitely be necessary, but I think it's doable.

  • Thanks. Yes, we have a site and twitter account. We're currently looking into our options with porting the game to mobiles or (less likely) consoles.

  • Last month, my partner and I launched Aviary Attorney on Steam. It's been quite a success!

    http://store.steampowered.com/app/384630

    I know the game's genre and style is quite different to most other Construct 2 games, so I thought I might briefly share my experience with using C2 to develop it.

    Areas where Construct 2 helped:

    • C2 allowed us to develop at a lightning-fast pace, especially in the early stages. We went from a blank canvas to a working prototype in under a week, and went to Kickstarter in 2 months. All in all, it took 14 months to create an 8 hour game. I don't think that would have been possible with another engine.
    • We used a lot of enormous sprites. There were 40-ish animated character sprites, each over 1000x1000 in dimensions, and numerous backgrounds that were often over 2000x1000. I know that large sprites are supposed to be one of C2's main weaknesses, so I'm happy to report that nothing bad came from this. A few users complained of long initial load times... and that was it. There were no memory or CPU issues, as far as I know.
    • There was half an hour of music files that played without issue.
    • JSON loading and parsing worked flawlessly - that's what drives the dialog scripts. If you have the game, feel free to unzip the package.nw file and see the dialog scripts for yourself.
    • We used the sepia WebGL filter on literally every layout. I was expecting this to set some people's graphics cards on fire, but surprisingly, there were few issues on that front.

    Areas where Construct 2 was a pain:

    • Switching from regular text to spritefont text was a nasty process.
    • The game is using an old version of C2 and Node Webkit because I was hoping to get Steam achievements running with Greenworks. I couldn't achieve this on Mac and Linux, so they had to be scrapped. Disappointing, but not an enormous deal.
    • I used C2's save states, and this resulted in some game-breaking save issues. I was unable to pin-down the exact cause, and it's possible that these problems have been fixed in a later version of C2, but it was frustrating to see dozens of people complaining of corrupted saves and having no way to fix them. In any future games, I'll probably write my own save files in plain text through NW so that I know exactly what's going on if a save file corrupts.
    • In the later stages of the project, the C2 worksheets started to become cumbersome to work with. I knew this would happen due to the scope of the project, but there were occasions where I longed for a text-based interface. Still, the speedy aspects of C2 probably outweighed the cumbersome aspects.
    • I had some issues with the NW window frame, and I think these problems are inherent to NW itself. For example, the custom cursor would occasionally change to a resize icon. This is hardly Scirra's fault, but it was infuriating to encounter "unfixable" bugs. Again, my issues may have been fixed in a more recent version of NW.

    Conclusion

    All in all, I'm generally happy with our choice of engine for the project, and there's a good chance that we'll be using C2 (or C3) for the next. C2 is clearly not designed with text-heavy adventure games and enormous sprites in mind, but it's great that the engine supported the assets without crashing under the weight.

    I can't help but wonder how the game would have turned out if I had switched to, say, Love 2D in the early stages of development. I think the game would have probably turned out a little more bug-free, but then, I'm not sure how much longer development would have taken. C2's layout view saved me weeks of valuable time over the whole course of development.

    206. I'm using version 0.3 of Greenworks so I can use the jankless 10.5 version of Node Webkit.

    Greenworks works fine for me on Windows, but even after following instructions and trying different combinations of versions, I have yet to get it working on Mac and Linux. Has anyone managed to get it working on these platforms? If so, I would love some information on exactly what I need to do.

    I would wait for the new version of the plugin, but my game's release date is fast approaching.

  • I initially posted this under the "How do I" forum, but now that I can reproduce the bug it's probably better suited here.

    Problem Description

    In Chrome (latest version), when a looped music file is playing, other non-looping, tagged audio files occasionally pause upon finishing, rather than fully stopping like they should.

    Attach a Capx

    https://www.dropbox.com/s/4uvx5dh58x2u4 ... .capx?dl=0

    Description of Capx

    The file plays a looped music audio file on start-up. Then, every tick, it checks if a tag is not being used, and then attempts to play a sound file with that particular tag.

    Steps to Reproduce Bug

    • Run in Chrome.
    • Hear beeping over piano music.
    • After a few seconds (can be anywhere from 1 to 30), the beeping stops.

    Observed Result

    The tagged audio sound file stops after a few seconds. Checking the audio debug menu at this point shows that the audio has paused at its last millisecond, and has not fully stopped; the tag has not been freed.

    Expected Result

    The tag ought to free up every time the sound file finishes, and as such the beeps ought to keep playing indefinitely.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (NO)
    • Internet Explorer: (?)

    Operating System and Service Pack

    Windows 8.1.

    Construct 2 Version ID

    204.2 (Also tested in 192)