R0J0hound's Recent Forum Activity

  • One idea for the jumping would be to relax the spring forces momentarily then make the spring forces stiffer for a bit. But I guess there may be other ideas.

    Making other shapes should be possible, but it just would take more setup. All the rest lengths of the edges, and all the rest areas of the triangles. The other issue is while a grid is easy to texture with distort meshes, other shapes could be trickier.

  • It’s hard to reason about more complicated cases. One thought that comes to mind is objects that are side by side on the x axis may be considered overlapping with that bounding box code. That would throw things off. Maybe shrinking it a bit may help:

    A.bbboxleft is between B.bboxLeft-A.width+1 and B.bbboxRight-1

  • I changed mine so z up is positive and compared what I did with yours:

    yours: dy = (A.y+A.z)-(B.y+B.z)-(A.sy-B.sy)/2
    mine: dy = (A.y+A.z)-(B.y+B.z)-(A.sy-B.sy)/2
    
    yours: dz = -A.z+B.z-(A.sz-B.sz)/2
    mine: dz = A.z-B.z-(A.sz-B.sz)/2
    
    yours: best = ((abs(dy)-(A.sy+B.sy)/2)>((abs(dz)-(A.sz+B.sz)/2))?dy:dz
    mine: best = ((abs(dy)-(A.sy+B.sy)/2)>(abs(dz)-(A.sz+ B.sz)/2))?dy:dz

    It's just your dz equation that is off. The rest looks correct from what I can tell.

    You can do your own bounding box check if you want to reserve the collision poly for collisions. These two conditions would do that:

    A.bbboxleft is between B.bboxLeft-A.width and B.bbboxRight
    A.bbboxTop is between B.bboxTop-A.Height and B.bbboxBottom
  • AnD4D

    Here is one possible way if all your layers are visible.

    global text name="fish"
    
    is layer name visible
    -- layer exists
    else
    -- layer doesn't exist
  • Here is the sorting with the perspective you're using.

    dropbox.com/s/m1p2f090xmqa230/alt_iso_sort.capx

  • I like how simple alextro's formula is. Unfortunately that will only work with isometric blocks with the same size.

    For different sized blocks you need to figure out which objects are in front of the other. Consider the simplest case of two blocks. This site does a nice job at explaining a way to do that:

    bannalia.blogspot.com/2008/02/filmation-math.html

    Once you have a way to decide which of any two blocks should be in front of the other you can use that to progressively sort the scene. You only need to sort objects visually overlapping each other. For making everything sort more instantly, you can use a topo sort if needed.

    In my latest tests I've found the step of figuring out which of two blocks should be in front of the other is closely related to pushing one object out of the other for Collison detection. Basically find the normal of the collision/overlap of each pair. Even if the objects aren't overlapping in 3d it's possible to find this normal. If you're not familiar with normals, they are just the 3d direction from one contact face to the other object.

    Anyways with that you dot product the normal vector with the direction of the screen. If <0 then one object is in front, otherwise the the other is in front.

    Here's a test of that.

    dropbox.com/s/9veb43lyxd7bja0/iso_sort3simplified.capx

    Anyways, for the perspective you're using it will be simpler than sorting for a isometric view, but the idea is similar. I was attempting to adapt my example to your perspective but not much luck yet. Hopefully it gives some ideas, or you stumble on a simpler solution.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Link now fixed. Guess I need to verify the links I’m copying from Dropbox. That’s been happening a lot lately.

  • alextro

    Ah, thanks man. That's at least the second time i've done that this week. Link fixed now.

  • Here's a test using verlet physics since I've been using that a lot lately. Looks more like a pony tail, but if using a distort mesh stretched over the points it may look better.

    dropbox.com/s/niureg675c6ae8h/scarf_verlet.capx

    Further test adding wind and air resistance. Events got a bit messy. Not super happy with the wind.

    dropbox.com/s/37fi58li47jpspc/scarf_verlet_wind.capx

    There are probably other creative ways to make more appealing scarfs.

  • Here is a test of keyboard controls. It involves two steps:

    1. find the minimum and maximum y of all the points.

    2. apply an acceleration to the points while a key is down. It uses the previous ymin,ymax to apply more acceleration to the top points than the bottom points. This causes the object to roll.

    The formula used is: 800*mdt*((self.Y-ymax)/(ymin-ymax))^10

    (self.Y-ymax)/(ymin-ymax) gives a value from 0 to 1 for each point. The top points will have a value of 1 and the bottom have a value of 0. It's changes linerarly for the points in between. I added the ^10 to give it a steeper curve. Basically with that the points at the top will still have a value of 1 but more of the points below will have a value closer to 0.

    The 800 is the force, and mdt is the timestep.

    Can be read as a force of 800 is applied to the top of the blob. The force bleeds to some of the points close to the top but most of the low points will barely have any force.

    I only did it for the plain c2 version but it should be simple enough to add the the others. Events 7-12.

    dropbox.com/s/s1m388u87wbajn0/jello_no3rdParty_keyboard.capx

  • Yes, that’s what I meant. That else will only run if none of the previous ones run.

  • Sorry didn’t see the other posts above my reply. Dividing by dt doesn’t sound like a great idea. Should be multiplied. Dividing by dt would make it faster at higher refresh rates.

    100*dt would be 100/60 at 60hz and 100/240 at 240hz. Which is correct.

    When you divide

    100/dt would be 6000 at 60hz and 240000 at 240hz. Which doesn’t seem right.

    Also your last post seems to be going opposite to the suggestions by going from using dt to a fixed step.

    Anyways, as to your other question, no, there isn’t a way to make the game use a fixed refresh rate. There have been attempts at ways to do it but it’s overly complicated and doesn’t really work with behaviors and such.