99Instances2Go's Forum Posts

  • Yes of cours, and i played with that idea 3 days ago. But, you got impatient, so i posted.

    The scale depends on the ratio (i gave you that, you should be able to figure that out). But, it gets complicated because if you size the grabber, you have to take its size into account when moving it.

  • I do understand avoiding browsers, they are a PITA.

    But ! When i mess with Classic (as i did for this), i see and feel how much C2 envolved to something awesome compared to Classic. Is there a way to push you to try it ?

  • Really, i so like this concept of dreaming platforms.

  • Could you drop a summier capX with just the platform & the animations? I would like (without promissing anything) to play with it.

  • If 'jumping' makes the difference. Set a boolean on jump. Unset the boolean on vector y=0, on land, and on grab to climb.

    If the boolean is set = climb up, else it is climb down.

    ?

    Not that i understand that. In my mind, climb up should follow on a vector y > 0 and is by wall. Dont think you need the helper object. (there is to much room in my mind). Climb up should follow on vector y < 0 and is by wall.

    I must be missing something ?

  • That is just beatyfull.

  • Why Classic ? Just wondering.

    https://www.dropbox.com/s/txxmzgffhs96n ... m.cap?dl=0

  • Get a second monitor ? Nothing beats that.

  • No idea why you want a scrollbar with touch, but here goes.

    https://drive.google.com/open?id=0B1SSu ... zQtelpCa3c

    That is an impossible interface (me anticipating) for mobile, the platform where touch would play.

  • Climbing down could be triggerd by ....

    Is falling

    Is by wall

    ?

    Also means if it hit a wall by falling after a jump, it climbs down the wall. But is that bad ?

  • I can only send you to a direction, not solve your problem.

    Look at this video ...

    Subscribe to Construct videos now

    Click on the program settings tab, find chrome, and make it use optimal settings.

    Try chrome with and without hardware accelleration. (chrome settings)

    Check the energy saving modus of you computer, set it to performance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • About lerp. Lerp(start,end, 100 / %).

    This returns a value between start and end, at (100 / %) of the distance between them. So, lerp (100,200,0.5) returns 150 as value. 0.5 = 100/50 ... or 50% of the distance.

    Lerp is not a tweening thing. It returns ONE value. And thats it, and thats all.

    This also means that lerp is LINEAIR, there is no smoothing happening at all.

    So how we make the lerp return a differend value every tick?

    The same way as with (something easy as) a+b=c

    We give a or b different values to have a different value for C.

    Back to the lerp. The way you (and i, if am not lazy - yeah right) should do it is this way.

    lerp(a,b,variable) where we add a certain amount to that variable.

    variable % = 0

    add 0.1 to variable %

    lerp(static number a,static number b, variable %)

    Now it takes 10 steps (ticks) to let the lerp return a value that envolves from a to b.

    The way we almost all do it, is this way.

    lerp(variable a,static number b, static number %)

    When you move a sprite from a to b. The position of this sprite is changing, that actual turns a (start) into a variable. Hence CHANGING.

    When the distance between a and b gets smaller, because a is moving, and % is static, lets say it is 0.5....

    And we gonna move over a distance of 100 pixels.

    Then the first tick the lerp returns a value exactly halfway a to b, or 50 pixels

    We set the sprite at 50 pixels.

    Now the next tick, the lerp start from 50 pixels to 100, and the value halfway is 75.

    As you see, the steps get smaller and smaller.

    We set the sprite at 75, the next value returned is 87,5.

    And here is where the smoothing is happening.

    But that comes with a catch. There will be always half of the distance left. So, at the end, it will never reach the end. It will always be at half of the distance to go. This will, used with the camera, give you a shaking camera at the end of the lerping. Solution: stop the lerp when the sprite is a few pixels away from the destination.

    About using dt in the lerp. Lerp returns a value each tick. No matter how many ticks your computer will run, at tick x the value is y. But a tick does not take the same time on a slow computer compared to a fast computer. As a result, the speed of moving things is faster on a fast computer. Since speed is essential for gameplay, this difference is in fact cheating.

    But, is it cheating if the camera follows a little faster on a faster computer ? I dont think so. Since dt is not static (because dt depends on whats gooing on in a event sheet / tick) the steps the lerp takes are not smooth at all. Using a dt corrected lerp to move the camera can stutter the camera.

    If you have to, then use it this way lerp(a, b, 1 - ((100 / %) ^ dt)).

    Where (100 / %) goes from 0 to 1. But that also means that you have to make the (100 / %) variable and a & b static, wich is the recommended way, the way i spoke about before.

    In short: the lerp should have only 1 variable, else it acts weird. But that is when using it for the camera, not easy to do.

    Specific comments about the way you do it.

    You want to smooth the camera. So, you want the camera to be slower then the player can move. But. The lerp you use 0.1* 60 * dt (thats is 6 * dt) is FAST. When the game runs at 50 frames, that is like 12% the distance each tick. There is for sure not much smoothing happening. And in some cases it can overshoot its destination.

    If i break down you lerp to lerp(a,b,%) ... then ..

    a = scrollx >>> VARIABLE (camera moves)

    b= (clamp(Player.X,zone.X+(160),zone.X+zone.Width-(160))) >> VARIABLE (player moves)

    % = 0.1*60*dt >>> VARIABLE (dt is not static, and its a big %)

    So you lerp(from a variable, to a variable, in a variable %)

    Sorry, but this cant be smooth with that speed, and it probaly overshoots with such a big speed.

    Try gooing for

    value = (scrollx,player.x,0.02) ... yes two variables, but they dont jump, they evolve smooth, and they cant overshoot

    clamp(value, max, min) ... clamp the lerps returned value

    This is how mutch i understand of it at this moment, probaly will change again soon.

  • Steady at 8.3 ms/frame.

  • By try and error we fall and run.

  • The problem (in my eyes & opinion) in 'that' is the 'overlap' check with a family.

    Speaking about the loops behind the scenes.

    (i know you know all that, so excuse me for building the argument from nothing)

    I you check an object overlapping a bunch of other objects, then you actualy start a loop (simular to 'for each) that evaluates each object in that bunch and ads/substracts that object (member of a family/instance) to/from the SOL.

    So, first off, there is a loop. And using a family, that loop can get big. On top, if you check overlap between an instance/famely and another instance/famely, that loop is a nested loop. Evaluating 10 instances with 10 instances gives you allready an iteration of 100, just to check the overlaps.

    Besides that, checking 1 overlap is also no more then a loop. It runs trough the boundarys and checks that with the other boundarys.

    As a result, checking overlaps (but also collissions) is a time consuming thing, and in your case, it can even be slower then just z-order the whole darn layer.

    What i suggested is a bit differend in some ways.

    Pick a bunch of objects with a 'pick by comparing' based on distance loops also trough the whole family, but without the 'overlap loop'. It is fast. The filterd SOL is also done only once, You perform the same loop when you actual do the z-ordening, in probaly the same tick.

    With only a few objects in the SOL, the z-ordening is awwsome fast. Even every tick should not have a big impact.

    Hope i made my point, the general point, i have no idea if that is applicable in your project.