Nathan's Recent Forum Activity

  • theames It's interesting that it's working for you with full http urls. I've just tried my example in the launcher and it still doesn't work.

    The reason why I want to load images in this way is we produce educational games, primarily for teaching languages. We would like to be able to dynamically load images from a very large pool without loading all the images into RAM.

    For our purposes the problem should be solved when CocoonJS releases WebGl and layout by layout loading. However, it would be nice to be able to keep one code base for the online version (Load by URL so the user doesn't have to download all the images) and the mobile version.

  • Bump. Ashley

    Please can you implement back button control as a Cocoonjs feature?

    It makes the game look more professional and is actually essential in order to get featured on Google Play. Also at game exit is the optimal place to place a full screen ad and make revenue.

    I'd really like to make enough revenue to upgrade to a business license. ;-)

    Thanks

  • It's great to see ajax now working for project file imports in CocoonJS, but it still isn't working for loading images by URL. Thanks

    Link to .capx file (required!):

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

    dl.dropboxusercontent.com/u/41218343/LoadByURL_2013_04_12-07_32_07_debug_signed.apk

    Steps to reproduce:

    1. Install file on Android or preview in browser

    2.

    3.

    Observed result:

    Works fine in the browser not in CocoonJS. Nothing is loaded in CocoonJS

    Expected result:

    2 Colours should load instantly and then after 10 seconds alternate between instances

    Browsers affected:

    Chrome: no

    CocoonJS: Yes

    Operating system & service pack:

    Android 2.3 Samsung Galaxy S Clear

    Construct 2 version:

    R25

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the info guys.

    It makes sense now. As any layer can have a coloured opacity and that would count as a draw, it makes sense that the background layer would as well, in the same way as clearing the background with a transparency would count as a draw.

    I suppose I was hoping that flushing the background with 1 colour (or transparency) would be a simpler task for the renderer than rendering an image.

  • Does a coloured background layer count as a "draw" compared with a full texture, in respect to overdraw?

    For example, we have a static background image for a small layout (480x800) which is composed of half a screen of pictures at the bottom and then largely 1 blue colour at the top (i.e. sky) with a few additional images in the sky.

    The options as I see it are:

    1)Using a blue background layer and overlaying half a screen of pictures at the bottom. Would this count as the first draw or a second draw in addition to the blue?

    2)Using a tiled blue on a transparent background with some overdraw where the jagged pictures overlap.

    3)Using one full background image on a transparent background, being only 1 draw but with the need to load a larger texture into RAM.

    Number 1 seems the best good option, but not if it causes half a screen of unnecessary overdraw.

    Thanks

  • ome6a1717 Have you tried declaring your text as strings? i.e.

    str(data)

    Clearly declaring the data type often fixes a few idiosyncrasies across browsers.

    Also check you're not setting your variables incorrectly as text or number, which can be an easy mistake to make.

  • 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

  • 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.

Nathan's avatar

Nathan

Member since 7 Sep, 2011

None one is following Nathan yet!

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies