RafaelMatos's Forum Posts

  • You could use tokenat and left expression but I don't know if it would be the best option since it will run every tick.

    example(if your timer is a number, use str to convert to string):

    tokenat(timer, 0, ",")&","&lef((tokenat(timer,1,","), 2)

    The first tokenat should retrieve the integer numbers and the second should get two numbers after the comma

    Example: timer = 4,37079798734234

    Would return 4,37

    I didn't tested it on c2 but should work.

    edit: https://www.scirra.com/manual/126/system-expressions

    Edit: How are you doing this timer?

    I think it would be an option doing this way too.

    Every 0.01 seconds > add 0.01 to timer (timer as a number)

    This way you don't need to do anything and never would return more than 2 numbers after the comma.

  • > 27 physic objects on html5/js based engine is already too much

    >

    I don't think that advice is true any more with the asm.js physics engine. It should run close to native speed.

    Make a minimal .capx that demonstrates the problem and share it here. If even 6 objects is slow, that suggests physics is not actually the problem, it must be something else.

    Here is the .capx

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

    Thanks for the help.

    Edit: Ashley , did you find something? <img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very Sad">

  • Are you using asm.js physics?

    Share a .capx so we can take a look.

    I was using Box2D web. I switched and nothing changed. Is it possible to send the .capx for you by pm?No offense to anyone else, everyone here is incredibly helpful and cool, but it's internet and I'm in the final stage of the first version of the game, just need to change some things a bit and create more levels.

    Facet

    I already tested it using only 6 objects and the slowdown persisted.

  • Alright, I'm really frustated. I'm working on a game based on physics for 2 months and I have slowdown issues since the beginning. The slowdown is more intensive at the beginning of the layout. Restarting lower the slowdown a bit but can and will increase again. I've read Ashley 's tutorial (https://www.scirra.com/manual/134/performance-tips) and I've made some changes that improved my game a lot, regarding to memory usage and size. It didn't solved my problem though. I know that physics behavior is very cpu intensive. However, my game is really simple and never go more than 27 objects with physics at the same time, actually in the entire layout. So here are some informations that might help you to help me lol

    Smarphone: Sony Xperia L.

    Fps

    Completly unstable, going from 20 to 50 all the time. Frequently around 30 and 40.

    CPU utilization

    Around 65~83%. Frequently around 75%

    Object Count

    Never go more than 160

    Objects with physics

    Rarely ever have more than 27

    Colision checks

    It's really low. Around 200(7 per tick) and 2000(38 per tick)

    Pixel rounding = off

    Sampling = Point

    Window view: 1280x720

    Fullscreen in browser: Scale outer

    All images are in power-of-two (32x32, 64x64, 128x128 and 256x256)

    [attachment=0:hdp46bxz]3213123123123.jpg[/attachment:hdp46bxz]

    Topics from Ashley 's tutorial

    Common causes of poor performance

    These topics below isn't a problem.

    -No hardware acceleration

    -Changing Text objects every tick

    -Inappropriate usage of the Tilemap object

    More important Topics

    Make sure WebGL is enabled

    It's enabled

    Place objects using the same blend modes or effects on the same layer

    I'm doing it. However, It didn't had any effect since I'm using 3 or 4 objects with effects, and they are sporadic.

    Avoid objects with large areas of transparency

    All objects have 100% of opacity

    Avoid large areas of overlap between objects

    I've changed all my background images to achieve it. Now they are overlapping each other only enough to hide the end of the image.

    If you have an opaque background, set Clear background to No in Project Properties

    I've already set it to yes.

    Too many objects using Physics

    "You should design your games to use a few large Physics objects rather than many small Physics objects."

    As I've said. I always have 27 physics objects or less. They are in different sizes and angles to follow up the curves.

    Example:

    [attachment=2:hdp46bxz]fisica objetos111111111.jpg[/attachment:hdp46bxz]

    Creating too many objects

    Again. Can't be a problem. I'm using less than 160 objects in every layout.

    Using too many effects

    I'm using almost no effects. This isn't a factor here.

    Using too many particles

    Particles isn't a problem either. I'm using it in some of my levels just recently and I'm aware of the object count in this situation and yet it's very low.

    Using Sprites instead of Tiled Backgrounds

    I'm using Tiled background for almost everything. In order to not have a completly square look, I'm using masks.

    See:

    [attachment=1:hdp46bxz]masks111111111111.jpg[/attachment:hdp46bxz]

    Not placing all used objects in the layout

    I don't think it's a problem. I have all objects that i'm using in all levels in one layout. On start of layout, I destroy them.

    Using too many loops

    Certainly not a problem.

    ----------

    I'm sorry for this wall of text, but I'm working on this project for more than 2 months already and I have this f***ing slowdown haunting me forever. Seriously, I don't want to give up on my game (crying face \o/). I followed every single step of these tips and many others that I found. Nothing helps.

  • You do not have permission to view this post

  • Create a global variable called Timer and Every 1 second -> add 1 to Timer

    Example (If you only need to set visible/invisible)

    While Timer is >=0 AND While Timer is <= X ---> Set visible

    Else ---> Set invisible

  • Since it scales out and get more grafics/objects to be shown at the screen at once I think appear to affect it's performance.

    Thats what I'm doing: I'm using sprites and tiled backgrounds objects with 64x64 resolution and I have the option to scale out(0.7) and scale in(1.0).

    Since the performance of my game isn't 100%, which is based in physics simulation although it's simple and have nothing more than 27(max) objects in each layout, isn't better invert everything? When I say invert, I mean changing the grafics to 32x32 and then my fully normal scale(1.0) would be equivalent to 0.7 of what I have now and then, to scale in I'd stretch the images.

    Summing up:

    What I have now - 64x64 resolutions.

    Normal Scale - 1.0

    Scale in to 1.0

    Scale out to 0.7

    What I would have- 32x32 resolutions.

    Normal Scale - 1.0 (with the appearence of a totally 0.7 zoom out of what I have now)

    Scale in to 1.3

    Scale out to 1.0

    So the question is: will these changes improve the performance of my game on mobiles, or It's a waste of time?

  • AndreasR, imaffett, metameta

    The problem was the "()" in my folder name. Yes, thats ridiculous but at least you guys already know that you can't use it.

  • For the app icon question <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    http://shatter-box.com/knowledgebase/ad ... crosswalk/

    Hi, Thanks for the answer! I'm doing this way, but I don't have this folder

    See:

    [attachment=0:10qcye8e]222222222223333.jpg[/attachment:10qcye8e]

    imaffett

    Why is that?Performance issue?

  • the icons must be located within the source directory (location of the Construct 2 export)

    It's in there, right next to xdk files.

    So what's the difference between project path and source directory?

  • imaffett

    I'm using crosswalk, since admob only accept this build. I would change it because a 7mb project turning to 25mb is just ridiculous.

  • Nobody knows why?

  • Someone help me, please. This problem has no sense to me, can't even start to figure it out. Actually, it makes no sense. All files are in the right resolutions.

    [attachment=0:1z820qa6][/attachment:1z820qa6]

  • This is happening all the time and I have no idea why.

    When I exported this test version of my game in the first time, all icons was working but not the splash screen. Now, everytime I try, both of them are not "found", the build log says. It's been like this for a week, even deleting the project on intel xdk.

    Could someone help me, please?

    [attachment=0:19i35bgp][/attachment:19i35bgp]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!Very appreciated!