Sigurdman's Forum Posts

  • 11 posts
  • If anyone is interested the issue was this setting (Z axis scaling):

    Works just as Pokemon HG now.

  • I currently have my camera setup like this:

    (22-25 is for testing angles)

    And that looks like this ingame:

    (ignore 2D house on the right)

    The house is a wedge on a box and the player is a wedge with the long side as the player sprite.

  • Just realised I just replied with what the first poster suggested

  • I ended up taking a dive looking a lerping like this in a framerate independent way.

    In a frame dependent way we'd use:

    set a to lerp(a, b, f)

    Where f is a value from 0 to 1. The speed it moves will vary according to the framerate.

    The quick improvement is to just multiply it by dt. 60 is multiplied by it too to make it have the exact same motion as the non-dt version.

    set a to lerp(a, b, 60*f*dt)

    With that it's largely framerate independent and approximately follows the same motion path no matter the fps, but the path can vary a bit and overshoot.

    For full framerate independent version I've found two versions online.

    One is from Ashley:

    set a to lerp(a, b, 1-f^dt)

    and one from Freya Holmer:

    set a to b+(a-b)*exp(-decay*dt)
    or
    set a to lerp(a, b, 1-exp(-decay*dt))

    Where decay is a value from 1 to 25.

    But the rate of change is different between the two. Surprisingly if we tweak either of them to use a f value of 0 to 1 and shift it to match the f and f*60*dt version we get the same equation:

    set a to lerp(a, b, 1-(1-f)^(60*dt))

    Which will give the exact motion no matter the framerate.

    Wow I didn't consider frame rate at all. This looks like "the" solution to this issue. This is what I was doing:

    It achieves a smooth effect and always takes the same amount of time to execute no matter how fast you scroll which is nice.

  • I am trying to make a "2.5D" style game, and I really want to mimmick the style of games like Pokemon HeartGold/SoulSilver:

    But I am having issues getting the same effect. I've tried messing with the 3D camera height and angle, but at a steep angle my buildings are mostly just roof, and at a lower angle my flat ground is too distorted. It never looks like the game. I also don't know how to make the character look right.

    I guess I somehow need to tilt my player sprite to be the same angle as the camera? I tried with a wedge 3Dshape and it looks decent, but clips into buildings really heavily.

    I looked at noclip and besides the trees there seems to be no funny angling going on:

    Any help is appreciated :)

  • Finally got it working like this:

  • Remove last two events and use this one:

    On Every tick: Set layout scale to lerp(layoutScale, ZoomTarget, 10*dt)

    You can try other values instead of 10 to make it faster/slower.

    Thank you!! this is great. I guess dt is delta? I am still new to using these smart functions and there isn't much explanation inside Construct for this. Is there a list somewhere of all the logic you can put inside a parameter?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Accidentally used same screenshot twice.

  • I have 2 objects, friendlysoldier and enemysoldier. Then a "cone of vision" object that gets spawned and set as child for each soldier on layout start. This is their line of sight.

    If they don't have an opposite soldier inside this object, then they are told to calculate a path to nearest enemy and then move.

    When their cone then overlaps with an enemy, I want the pathfinding to stop. But they don't, they just keep going until they are almost on top of the enemy.

    This is how I have set it up:

    '

  • My current zoom is setup like this:

    Since its "static" numbers it means the effect is very fast when I am zoomed i, and takes way too long when I want to zoom out a lot. Is there a way to make sure that zooming always takes the same time? Or just make it feel more smooth in general?

  • I have a world map with a bunch of "Locations". These are all the same object, and I have added their names as instance variables as well as the name of which location the player will get to if they press left/right/up/down on the keyboard.

    Example:

    My hero has a "CurrentLocation" instance variable (could also have been a global variable)

    I want to use the pathfinding behaviour to make my hero move to the next town, so I need to insert the X and Y of the next location for the pathfinding behaviour to run. How do I get this?

    I basically want to: "set NextLocationLeftX = Hero.CurrentLocation.ConnectedLocationLeft.ImagePointX" But I can't figure out how to refer to or get specific instance variables, or how to connect them in a smart way to get this type of nested information.

  • 11 posts