RafaelMatos's Forum Posts

  • When you have two sprites with both scroll to behavior enabled at the same time it wont work. Ensure that you have only one scroll to behavior enabled.

  • I've solved by using the viewport. Here it is in case someone need.

    Set position to:

    X = abs(ViewportLeft("Interface") +ViewportRight("Interface"))/2

    Y = abs(ViewportBottom("Interface") +ViewportTop("Interface"))/2

    This will get the current min and max pixels of the screen, sum them and divide by 2 to get the center. Do it for the X and Y axis.

  • I've tried everything.

    X= WindowWidth/2

    Y= WindowHeight/2

    X= LayoutWidth/2

    Y= LayoutHeight/2

    Scrollx

    Scrolly

    Nothing works. I thought it would be easier to do such an usual thing. Am I missing something?

    Thanks!

  • thanks a lot...could u post a capx . that's easier 4 me to understand...thank u so much

    [attachment=0:sbiper59][/attachment:sbiper59]

  • While pressing a button or touching - > set scale to lerp(a,b,c)

    a = start point

    b = destination point

    c = "Transition's velocity"

    For the c, use 1*dt,2*dt,3*dt, etc

    Don't forget to always use dt (delta-time)

    Example:

    lerp(1,3,1*dt) ==> Went from scale 1 to 3.

    Remember that you can always use expressions to get the current scale for the "a" and then use it again on "b" plus any number that you want to add ou subtract in order to zoom in and zoom out.

  • hyem

    2400px isn't high man. You are fine about that =P

  • Mobile devices are not a goal, but there's no reason why it shouldn't work there. My target is first getting all the features working well first with a good design for the events. If i encounter any major problems I'll try to adress them as they come up, and every export platform should benefit from it.

    Alright, thanks for the answer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as I know, layout size doesn't interfere on that. The game processes everything that is ON screen only.

  • It should be just as possible as using box2d. That being said I don't know how this compares to box2d in performance on mobile devices.

    So mobile devices aren't your goal? Because, regarding to performance, Box2d isn't that great.

  • When you say you made a new project with more objects and it ran smoothly, are you talking about normal physics objects, or were you using r0j0hound's plugin?

    About normal physics objects.

    After all changes it's running way better, I think I can stick with it. However, It's far from what we usually call a good performance . I don't know yet how to export so, in order to do a decisive test, I think first I'll backup my original project and test Chipmunk Physics by R0J0hound.

  • Using construct 2 to do it was very creative for sure. Nicely done.

  • R0J0hound

    Is it possible to make a physics behavior based game for mobile using your plugin? I'm asking you that because Box2D has a poor performance for mobiles and I just discovered that now :/

  • Physics are pretty brutal on mobile, any way you slice it.

    I don't know how much code you've already done, but you might take a look at this amazing plugin by r0j0hound:

    To me, it seems to run smoother than box2d. It also has some amazing features that box2d doesn't, like collision groups (these objects only collide with each other).

    Also, spawning/destroying objects is hard on the engine if you handle too many in one tick, even if the action only happens occasionally.

    I've already done all the basics mechanics, so it would take a while. It worth all the work to change my entire project?(no disrespect to r0j0hound)

    Also I don't know if building my entire game using a beta plugin would be the best choice.

    What do you think?

    Anyway, the physics behavior's performance really let me down right now =/. I thought I was doing something terribly wrong.

    Edit: I've quickly made a new project with a lot more objects (with physics) and it ran smoothly. So I don't know anything anymore ... Don't know what to do

  • I've done so many changes to increase performance and still a pain in the ass to run smoothly. The game run with lots of lag spikes and slowdowns but sometimes, in a short period of time, run smoothly. I'm starting to think that a game based on physics behavior is not possible for mobiles.

    Alright here it is all the data about the game's performance running on my Xperia L. Also I've tested in a Samsung S3 as well and it's a little bit worse, which is weird because it has a better cpu.

    All tested using wifi and chrome browser.

    FPS: 30~55

    CPU: 45~80% (mostly around 70%)

    Object count: Around 85

    Image memory usage: Around 20mb

    Colision Checks/sec: 150~500 (mostly around 350)

    Poly checks/sec: 0~150

    ---

    Settings:

    Pixel rounding: off

    WebGL enable

    Sampling: Point

    Physics engine: Box2d web

    Construct 2 version r192

    Clear Background: No

    ---

    I'm using tiled images instead of sprites when it's possible. Actually, after doing this, my object count went from ~700 to less then 100 and still had a small effect on performance.

    I have less then 30 objects with physics behavior at the same time.

    Only one event is using 2 particle effects at the moment, which is the fire when I shoot. Their rate is 10 and 20 and last less then a second or two.

    PLEASE, if I forgot any information let me know. I really don't want to leave this project just because apparently it seems impracticable, which I don't believe.

    I appreciate a lot any help.

    Thank you.

  • I own a Construct 2 personal license for almost a year and I've never earned a medal on my avatar. I bought using steam so I don't know if it has something related.