Rable's Forum Posts

  • Hi,

    I'm encoutering big performance problem in my game project, and I guess this thread covers the reason why. As my game has much different needs than what is discussed here, I'll drop a few lines to explain it, as it may be useful.

    My (mobile) game basically resumes itself to "touching a sprite makes this sprite spawn another object (which is animated) and modifies its instance variables". Pretty simple, but I'm using lots of sprites, which are pretty big, and uses a lot of opacity (full range from 0% to 100%, sqiddster said it was very GPU demanding). There are no moving sprites, no collision, no effects, and the fastest animation plays at 10 frames per second. So basically a FPS of 10 could be enough for me.

    But when I touch an object multiple times quickly when performance is low (it is always low on rather slow devices), each animation is delayed. The result is that if I touch 10 times quickly, then I have to wait sometimes 3 seconds or more for every animations to be finished, and of course instance variables modification only happens when the corresponding animation starts playing, which ruins my gameplay.

    On slow devices, FPS may drop below 20.

    Is there anything I can do besides removing graphics (unthinkable)?

  • Hi everyone,

    I'm encountering a problem with Phonegap export : When I click the "Upload a .zip file" button in PhoneGap Build, I can then select the zip file I just created (from all the files in the exported folder), then I'm back at the previous screen and... nothing happens. Just like I clicked the cancel button...

    I tried it two times with small, test projects, and it's working fine. Is there any reason why my big project (47Mb) would not upload to PhoneGap while small ones do?

    Thanks for your help !

    EDIT : After the upload failed, if I click on "private", it shows the following message : "File is too large. File must be less than 40 MB. "

    Any idea if it is possible to upload files that are less than 40Mb size?

    As I plan to use Phonegap only for iOS 8, are there ways to reduce the exported file's size, such as removing either the .OGG or the .M4A sounds?

    Thanks for your help !

  • Hi everyone,

    My game basically resumes itself to "touching a sprite makes this sprite spawn another object (which is animated) and modifies its instance variables". Pretty simple, but I'm using lots of sprites, so performance is not always very good. I can live with that but my main problem is that when I touch an object multiple times quickly when performance is low, each animation is delayed and performs just like a moving object without dt.

    The result is that if I touch 10 times quickly, then I have to wait sometimes 3 seconds or more for every animations to be finished, and of course instance variables modification only happens when the corresponding animation starts playing, which ruins my gameplay. What I would like to do is that when performance is low, every animation that has been triggered plays as soons as possible, even if it means 5 or more animations playing together.

    I tried to add dt in the "speed" animation property of my spawned object, but it doesn't work... It can only contain numbers.

    To be more complete, when clicking on an object, another "main" object also play an animation and a very short (0.05 second) "wait" action triggers before the touch could be perform again. But "wait" actions already have dt included, right?

    Any idea how I could resolve this problem?

    Thanks !

  • Use the scirra.com/manual/129/image-format Image Format dialog.

    Thank you Ashley, didn't knew about that. Much appreciated !

  • Hi,

    I'm currently trying to lower the size of my project. While checking the image folder after exporting for Android via Crosswalk, I discovered that all my JPEG images, that I carefully compressed in order to be good-looking but not too heavy, are now PNG images. And obviously, they are now around 500Kb each, while they were less to 100Kb beforehand...

    These are large, 100% opacity sprites, so I don't need PNG format for them. Is there any way that I could avoid C2 to turn them to the PNG format?

    I put the option "PNG compression" to none, but it still makes (uncompressed) PNG with all of my files. :-/

    And I have a sub-question : What does exactly the "Brute (very slow)" option under PNG compression in the export window? I tried it, and unlike what I expected, the image folder is still heavier with this option checked.

    Thanks !

  • Hi IntelRobert,

    I'm not a C2 gourou either, but I can tell you that C2 *somewhat* creates sprite sheets automatically when exporting for crosswalk. By somewhat I mean that many sprites are gathered together on sprite sheets automatically, but there are most of the time only 4 sprites per sheet. Sometimes up to 10 or even a little bit more but it's rare. FYI most of the sprites in my game have a 384x384 pixel canvas, so they are not small. But even much smaller sprites (like impacts) are often not placed at all on spritesheets, just 1 per file... So I'll investigate to see if I could create these spritesheets myself in a more radical way.

    Thanks !

    Showing my ignorance about C2: Is there a way to combine multiple images into a sprite sheet so you don't need to load so many?

    > Thanks a lot for the infos. Then I just have to wait and pray for them to fix the bug... or your solution to to work. Actually I have at the moment only about 2/3 of the total images loaded in my project, so it will feature still more images when the game will be finished... (not even speaking about the music)

    > It would be a pity to discard drawings I already drawn because they are too heavy to export...

    >

  • Thanks a lot for the infos. Then I just have to wait and pray for them to fix the bug... or your solution to to work. Actually I have at the moment only about 2/3 of the total images loaded in my project, so it will feature still more images when the game will be finished... (not even speaking about the music)

    It would be a pity to discard drawings I already drawn because they are too heavy to export...

  • Thanks a lot, Knifegrinder !

    At least I know that this is a know bug and that there could be solutions in the future. Indeed, my project has lots of images. And as 99% of the game happens on only one layout (exept title screen and maybe one other), most images are present on that "game" layout. I'll give a look to beufreecasse tool that you're speaking about, but maybe a simple solution would be to create a "container" layout that contains all the images and is never played? The "game" layout just need a handful of images to play each level, so I'll just create the needed object at the beginning of each level.

    Could this work? Or do the bug occur because there are lots of images in the whole project, regardless of the fact that they are all placed on a layout that is never played? I guess I'll try it anyway.

    Thanks again !

  • Hi,

    I just finished reading the 59 pages of this thread to be able to resolve my problems. The first one seems to be a known XDK bug, but I will still explain it here.

    My bug seems to be similar to this one : https_://crosswalk-project.org/jira/browse/XWALK-2655 (delete "_" as I'm not able to post links)

    My game runs perfectly while previewing over wifi on Chrome for Android, on my two devices : Samsung Galaxy Young GT-S6310N and Samsung Galaxy Tab3.

    In the emulator of XDK, it works fine.

    When exporting with Crosswalk for Android, then playing the APK on the devices :

    1) On the tablet, I can see the title screen, then it crashes most of the time. I'm back on the menu screen of the tablet, then if I check the running apps, I can still see my app running there. When I click on it, I'm back to the C2's loading screen, which sometimes freezes, or it either crashes the game again, or succeed to launch the game.

    2) On the mobile phone it's the same, except that I'm not sure the game started even once. It crashes nearly always.

    I tried XDK beta and stable, it behave the same way.

    I send the exact same build to a friend which tried it on a Samsung Galaxy S3 mini, and up to now, he has no problem playing the game. Everything runs perfectly.

    The project is quite big (around 9000 event for now)

    I read some people saying that they have problems with the sounds. I didn't test to delete the sounds yet, but I have a music (placed in the "sound" folder, not "music", because I want it to preload) during the title screen, and the sound plays on both devices, so it's probably not related to sounds.

    I also read that there was problems with the blacklist of webGL on some devices, including some devices from Samsung. I did the following test : created a new project that just displays the name of the renderer, and it returns "webgl". Don't know if it helps.

    I'm also facing another bug, which seem to be related to webStorage : When I activate the loading of webStorage (loading of about 60 number global variables on my title screen) and runs the game on my tablet, it's behaving correctly on preview over wifi running in Chrome for Android (IIRC, need to retest, but at least in Construct preview it works fine), but here, even in Intel XDK's emulator, I'm experiencing another problem. The title screen works ok, but when the game launches, some object simply doesn't appear. On one level I had all my characters diappearing, on another I had the background disappearing. When I turned off all loading of webstorage, this bug was resolved... But I will need webstorage to publish my game...

    One last note : I'm not a programmer at all, and I don't know how to display the error message in XDK, or when trying on the device. Could someone explain, so I can eventually give additional informations?

    Thanks !

  • Hi everyone,

    I'm having troubles with the "export for Crosswalk" option. First of all, I read in the manual "how to export to android with crosswalk" page that there are really minimal difference between this export and the preview over wifi played on chrome (on an android device).

    However, the preview over wifi works perfectly, but when I'm doing an export with crosswalk that I export via Intel XDK, all my characters simply don't appear on the first level... That's on the tablet, on the smartphone, the app simply shuts down as soon as the first level start. To be perfectly clear all of this also works perfectly when exporting over wifi.

    I really need help with this, everything worked perfectly up to now, I really don't understand what's going on.

    Maybe is my project just too big? There are 8500 events now, is there any limit?

    I also use a loading layout, but even this layout takes a LOT of time to appear (sometimes more than 30 seconds), even though I just have a single sprite and the loading bar on it (I read that we should keep it as small as possible).

    FYI the tablet on which I play the app is a Samsung Galaxy Tab 3. Any idea of what's going on?

    Thanks !

  • Hi !

    Thanks for your replies. I'll definitely keep the whole game in only one layout.

    To answer your question I started the game about 2 month ago, and it's not an MMO or anything like that. I suppose an experienced construct 2 user would do the same game with much less events. Still, I have many characters/enemies and most of them need a good bunch of events to describe their behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi everyone,

    I'm currently working on a project that uses only one layout (except for loading and title screen). I was just wondering if this was possible or if I need to make transitions via another layout with maps or such things, to keep everything running smoothly.

    To give you an idea the project is around 6000 events and will have about 100 levels, so it's not a small game. There are sort of world maps (not animated) between each level that I create on a foreground layer, then delete them when going back to the game (which is still running in the background).

    My question is to know whether or not this has technical downside. Will the game start to slow down after a while because I use always the same layout?

    Thanks !

  • Thanks, I'll try that !

  • Hi Everyone,

    I've run into a new problem that I didn't manage to resolve by myself. Here is the simplified code :

    When spriteButton is touched (trigger once), set Object.instanceVariable to true (can only be triggered once by half second, with a cooldown mechanism)

    "Object" spawn object "icon"

    wait 4 seconds

    "icon" start flashing for 1 second

    wait 1 second

    delete icon

    set object.instancevariable to false

    This works perfectly as long as I never repress the button while the script is running, but I would like the player to play the script multiple times during the initial 5 seconds.

    As it is, when I re-run the script while it is still active, a second icon will be created and the instancevariable will be set to false 5 seconds after the first launch, because the first script is still running and will set the variable to false

    So my question resumes to : How can I cancel a wait time (or a whole event) in order to start a new one with the wait time back to 0?

    I tried putting the wait part inside a group and deactivationg the group then reactivating it, but it doesn't seems to work.

    Thanks for your help !

  • Thanks a lot for your time, inquiesco. Indeed your solution works fine, but sadly it is not usable in my complete code. The reason is that I simplified the code to have only one instance of the enemy object, while in the complete code I need 2, or 3 instances.

    So, starting from your version, I duplicated the actions in order to create 2 instances in the same "every thick" event, like you suggested. It works just fine. The problem is that when I need to put the life bar's width to be the same as the health, if I put the actions in the same "every thick" event, it applies logically only to the last instance, not all. So I need to create another "every thick" event at the root, and when I do that, it doesn't work at all... :-/

    Here is the capx demonstrating the problem :

    dropbox.com/s/6s9xegcic5nyl1u/project88_debug2.capx?dl=0

    Any further idea of how I could make it work?

    I also tried to put the "set width" action in a "pick all" event at different places in the hierarchy (root level), none of it works...

    ----

    EDIT :

    Ok my problem is solved. I moved the "every thick" (or pick all, it's the same) event, containing the set width actions, at the same root level of the "level=25" event. This implies that I can't change it based on the level, but I don't need to do that. So It's solved ! Thanks a lot inquiesco for your precious help.

    Still, some things are behaving weirdly and I'll be happy if someone can tell me how I could have done that if I needed to apply this effect on only some given levels, not all...