RafaelMatos's Recent Forum Activity

  • Ashley, did you see the .capx??

    Also, with the new update, I can't preview it on chrome.

    Error message:

    Javascript error!

    Uncaught TypeError: Cannot read property "isAmazonWebApp" of undefined

    "My local IP"

    Audio_Plugin.js, line 2197 (col 69)

    Edit: I think some unexpected things may have happened on this update. See those Pets on the screenshots in my first post? They are too "heavy" now and I can't take them down like before and I didn't change a thing in the project on this weekend. So i'm pretty sure that is something about the update. It seems that they have a lot more mass or density.

  • how does that work exactly? making something into a string in C2? do i need to make a new variable to put the converted value or is it done in the expression itself?

    using your expression i got a syntax issue.. i think "lef" is meant to be left but still something in there wasn't working right.

    you use the "," throughout the formula which would be a period right for a timer right?

    This looks really promising I've just never had to work with casting values from a number to string or the other way around so the whole concept inside of C2 and the right way to do it is a bit mysterious to me.

    Yes, it is left. I typed wrong.

    Well, you can use it. https://www.scirra.com/tutorials/678/in ... -functions

    It's simple and work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why not using particles? I didn't get the point :/

    On created > every X seconds > subtract 1 from the rate of the particles

    This will create a "fade out fire" effect for each instance of the object, as if the fire was fading out

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

RafaelMatos's avatar

RafaelMatos

Member since 8 Mar, 2014

Twitter
RafaelMatos has 1 followers

Connect with RafaelMatos

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies