R0J0hound's Recent Forum Activity

  • I mean I know why it happens. It’s an artifact of how those behaviors resolve collisions.

    The collisions are resolved roughly by moving in steps till there is no overlap. Since it moves in steps it’s only approximate but is generally good enough. With zoomed in pixel art the error is magnified though.

    Anyways, I don’t think there’s any setting to eliminate it, but shrinking the collision poly could shift to look like it’s slightly overlapping instead of having a gap.

    You could also do your own collision handling. Aka don’t use the solid or jump through behaviors and do your own collision detection/resolution. You might get away with doing that with the 8direction behavior but with the platform behavior it would likely be better to just do the whole behavior from events.

    Focusing on how we could do a better collision resolution, we could do a progressive stepping solution that moves in big steps first then increasingly smaller steps to get a very close near perfect touch between the objects. Alternately, you could focus on calculating where the objects should be to be just touching. Either way we’d need to be able to calculate the collision normal to be able to update the velocity.

  • How many cases are you trying to handle? All of them?

    If it’s only some then you just need to know the number of wall to compare the pickedCount with and pick each wall in turn separated by pick all.

    You could make a helper function that returns 0 or 1 if a wall is at a location. But then you’d have to use 8 compares to check for each case.

    Or you could do that idea in my second reply that sets a neighbor variable to whether a wall is at each direction or not. For example “00000001” would be a wall to the NE.

    Not super readable but maybe you could modify it to be “NE” instead or maybe “7”.

  • My bad, it should be comparing the picked count with two in the second example since we are checking two tiles. I edited that post.

    You may just need to work though the logic yourself a bit more. The best solution is one you understand.

  • So it appears you can’t stay logged in on the same account with multiple devices anymore. I check the forum from my phone and laptop and if I login on one it logs me out on the other. I can see the reasoning to avoid multiple users using the same subscription, but I’m kind of the outlier since I don’t have a subscription, I’m just a forum user.

    No worries though. I’ll get used to it.

    More annoying is the incessant huge delay to verify I’m a human almost every visit to the forum from my phone. Often repeatedly if I use “back”. It seems to even be taking longer as of late. I suppose those kind of things are the new reality of the internet.

    It’s just a lot of friction to the point where I think maybe I should spend my time doing something else. Which isn’t a bad thing.

  • The pick all needs to be in the same event block. You’re using multiple.

    All the conditions in the last example I posted can be in one event block and it’ll work. Most of the conditions can have their own block but this at least has to be grouped in the same block.

    Wall: x=tile.x-100
    Wall: y=tile.y
    Pick all wall
    Wall: x=tile.x+100
    Wall: y=tile.y

    All it does if it’s able to pick the first wall it then tries to pick the second. The pick all makes so it can even pick another wall.

  • The trigger once while true condition doesn’t do anything in a loop.

    Looks like you’d need to check for walls in all 8 directions. Where if a wall is there is just as important as if there isn’t one.

    So you’d basically do this 8 times for each direction… you’d have to accumulate the result in a var somehow.

    Wall: x=tile.x+100
    Wall: y=tile.y-100
    — there is a wall there
    Else
    — there isn’t a wall there

    Maybe this?

    For each tile
    — tile: set neighbors to “”
    — repeat 8 times
    — — wall: x=tile.x+100*round(cos(45*loopindex))
    — — wall: y=tile.y+100*round(sin(45*loopindex))
    — — — tile: add 1 to neighbors
    — — else
    — — — tile: add 0 to neighbors
    
    Tile: neighbors=“00000001”
    — do something

    But that’s ugly. Another approach could be to add all the walls to a 2d array to simplify checking a grid for a tile or not.

    Start of layout:
    — array: set size to (100,100,1)
    —array: clear to 0
    — for each wall
    — — array: set at (int(wall.x/100), int(wall.y/100)) to 1
    
    Var gx=0
    Var gy=0
    
    For each tile
    — set gx to int(wall.x/100)
    — set gy to int(wall.y/100)
    — compare: array.at(gx-1,gy-1)=0
    — compare: array.at(gx,gy-1)=0
    — compare: array.at(gx+1,gy-1)=0
    — compare: array.at(gx-1,gy)=0
    — compare: array.at(gx+1,gy)=0
    — compare: array.at(gx-1,gy+1)=0
    — compare: array.at(gx,gy+1)=0
    — compare: array.at(gx+1,gy+1)=0
    — — do something

    Still pretty verbose. And you’d want the array to be big enough to cover all grid positions, and you’d have to update it if you moved or add/remove walls.

    But we could do better. With an overlap check we could pick all the neighboring walls at once. And the case you’re looking for only has one wall next to the tile and we know what position we’d want that tile to be at.

    For each tile
    Tile: overlaps wall
    Compare: wall.pickedCount=1
    Wall: x=tile.x+100
    Wall: y=tile.y-100
    — do something 

    It extends nicely to other possible cases too. Say you want to check if there are only two walls to the left or right.

    For each tile
    Tile: overlaps wall
    Compare: wall.pickedCount=2
    Wall: x=tile.x-100
    Wall: y=tile.y
    Pick all wall
    Wall: x=tile.x+100
    Wall: y=tile.y
    — do something 
  • What if you set the up vector to (0,0,1) instead?

  • So trying it out, the reason it doesn't work is you are picking the tile to the SW of the wall, then trying to pick the tile above that wall. They will never be the same tile, so it doesn't work. Sure the tile could have a wall below it and to the NE, but your logic doesn't check for that.

    Anyways, here is one possible solution with 32x32 tiles. Loop over the tiles instead and check for walls around it. The pick all is so we only need to pick one wall at a time.

  • Enabling both conditions doesn’t do it? It should

  • You do not have permission to view this post

  • You do not have permission to view this post

  • There was a box3d physics plugin released about a week ago, you could try that. There was also a 3d physics plugin released my mikal too that you could try. I'm sure others have patched in a js library too. So take your pick I guess.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads