Nathan's Forum Posts

  • I have been experiencing similar issues. The audio just seems inconsistent. It often doesn't play or sometimes it is perfect and I can't work out why.

    One thing I've notice is even when you only compile for Android the APK export still contains .ogg and .m4a files. I've started deleting the oggs from the zip file, which has saved RAM and file size, but doesn't affect the inconsistency of performance.

    It happens even when FPS is quite high and the game is running smoothly. The sound clips are all small (less than 1 sec at 96Kb/sec ), with a maximum of 20 on any one layout).

    Results so far have been the same on:

    Samsung Galaxy S1 and Samsung Mini both running Android 2.3

    Google Nexus 7 running Android 4.2

    HTC Evo running Android 4.0

    ludei, I noticed on your forum back in December you were planning to re-write your audio engine. Please could you give an ETA (or how high it is up your priority list) of when these audio problems are likely to be fixed?

    Our current game, soon to be released, relies heavily on audio, and it really is a priority for us.

    Many Thanks

  • ludei Ashley My current game uses a lot of different images (not animated) that, for simplicity of logic, are stored within one object as animations frames and referenced by an array. I should be able to load the images by URL and save RAM (dumping the old images would do this, I assume).

    The fact that ajax still isn't working in cocoon means I can't load by URL. I believe ajax is needed to do this. Either way, load by URL and file imports are not working in cocoon.

    Please could you put this up high on your current to do list? I am starting to experience RAM issues and have plans to significantly expand the game further. In fact, it's expanding the game with in-app purchases that will allow me to monetise my app!

    Many Thanks

  • From your level editor you can download the contents of an array as a json textfile (array->download). In preview mode your browser will download it when you trigger it.

    You then import the json textfile into your game in C2.

    You then set your array to load the file.

    scirra.com/manual/108/array

  • xexeo Yes 0db is the standard digital max volume. It means if a sound file is "normalised" the maximum peaks in the wave will be at 0db.

    It avoids clipping where the tops of the waves get cut off causing distortion (you can't exceed 1111111111111111 in a 16bit file, which is your 0dB).

    If your files are too quiet, you can "normalise" them using an audio editor, which will place the loudest sound in the sample at 0db.

    Anything you want quieter should be reduced below that.

    Audio editors allow you to go higher but its basically a multiplication (adding 6db for every perceived doubling in volume). With an audio editor you make sure you don't go into the red (which is the total audio output exceeding 0 db). So you could have a recording at -12dB and set +10dB in the audio editor, but your output would be -2dB. An audio editor will let you go into the red but the sound will be distorted.

  • ASHLEY. Please, would it be possible to implement the application quit control/back button API for CocoonJS in the CocoonJS plugin?

    Control over what the back button does is quite important for a consistent user experience in Android.

    From Ludei's blog (http://blog.ludei.com/):

    "Application ?quit? control

    In Android (not in iOS) the back button can be used to destroy the activity. Now, there is a way to control this behavior from JavaScript. The default behavior has changed and now, if the developer does not specify anything, CocoonJS will prompt a dialog and pause the application to let the user decide if the app should be destroyed or not. Moreover, the developer now has the possibility of specifying that he/she wants to take control of the app finalization. The process is as easy as specifying a function that will return a boolean by calling

    CocoonJS.App.setAppShouldFinishCallback(FUNCTION_THAT_RETURNS_A_BOOLEAN)

    .

    If the function returns true, it means the app should finish and if it returns false, it means it should not finish and that the developer takes control of the finalization. Whenever a developer wants to finish the application, there is a function called

    CocoonJS.App.forceToFinish

    This feature is specially useful in Android (in iOS for example none of the functions will work)."

    It would be nice to have the condition:

    "On Back Button Pressed"

    • so we cab specify what it does.

    and the action:

    "Close Application"

    Control over this would give us massive boost in terms of how professional our apps look compared to the stock Android "Are you sure you want to exit?" dialogue box.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dformer I ran a little comparison test project comparing text objects to sprites a while ago. I think my sprites were about 128px square (sorry I can't be a bit more scientific with my benchmark).

    Running on a desktop I was getting about 10-12 times as many sprites as text objects for the same frame rate. So a graphic object is much better than a text object if you can pre-make the graphics.

    For things like "Score: " , "Time: ", "Player 1", "Game Over" etc, then making a single graphic is definitely much better than a text object.

    It's very possible to build words dynamically either with a font graphic and your own events system or with the SpriteFont plugin. What you should do depends on the size of your text. If your texts are more than 12 characters long, the text object is better (if you build words character by character).

    The Spritefont plugin might be a bit better than my 10-12 character rule because its written deeper with the javascript SDK. I haven't done a comparison with the actual SpriteFont plugin so don't know how its performance compares. I'd just put your phrases on single graphics if you only have a limited number and they aren't dynamic.

    The last time I checked the SpriteFont plugin didn't work with CocoonJS so I used my own events based spritefont system, which was great for prototyping because I had a lot of short texts (single words). In the end though, it was much more efficient to create all the words where possible as graphics and just use my own spritefont system for the dynamic stuff like the digits in scores and timers etc.

    Basically large bodies of text need a text object if dynamically produced, but for single words produced dynamically or for large bodies that you can prepare on a single graphic, graphics are better.

  • Tobye

    I could only get it working through "Reload", which was quit straight forward. Just make a project (with no spaces in the title) and throw in the files from a C2 HTML5 export.

    However, my project was much slower than a CocoonJS APK build, I didn't get any sound and it was stuck in portrait.

    To make a fair comparison with CocoonJS I wanted to make a proper APK through the MoSync SDK, but I couldn't work out how to do that either.

  • Tobye In reload you get an error if you have any spaces in your project name. Have you tried removing them?

  • 56fps in Chrome. Dell i5 laptop.

    Very interesting info regarding overdraw. I was only thinking in terms of object counts and sizes before. Thanks Guys.

  • It definitely seems quicker on Android, although I haven't done a proper test to verify that.

  • This would be a very useful feature.

    I'd also like to be able to delete all unused variables. I've got loads that need sifting from my current project, now I'm using the new functions feature.

  • Thanks Peteer. It seems so simple now.

    Here's an updated capx showing how:

    dl.dropbox.com/u/41218343/LoadFromURLtest.capx

  • Ashley - "you should be able to 'load image from URL' in to each instance separately".

    I can't get this to work either. I can only load one image at a time and the other one will stay black.

    dl.dropbox.com/u/41218343/LoadFromURLtest.capx

    Many Thanks

  • I managed to get it working on phonegap a while back (maybe cordova 1.7) which is way too slow for most stuff. I haven't used phonegap for a while. The latest version (2.2) is supposed to be much better at handling javascript and audio so depending on what you are doing (i.e if the graphics are minimal) it might work for you. I might try the new version myself out of interest. I think you have to compile it using Eclipse to get ajax working.

    To get it working with phonegap put your .txt file in your assets/www folder

    I couldn't get it working on cocoon, even with the new version released yesterday.

  • How about on mobile via cocoon? How well is it likely to perform given how minimalist you need to be with the sprite counts?

    Do all the elements count as individual objects or do they get stitched together and stored in memory temporarily? For example, if I wanted to use it to dynamically create words from PNG letters, would a 5 letter word count as 5 sprites or be held in memory as 1 sprite?

    Not being proficient in javascript, I've always wondered whether it is possible to stitch images together (efficiently)on the fly to count as 1 image (in the way you can with GD functions in PHP), or whether that's just how the system deals with rendering static images anyway.