arneon's Forum Posts

  • Is your grid also isometric, as in the gif?

    How to make a grid isometric?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This will snap the sprite to 10x10 px grid:

    > Sprite On Drop
    OR Sprite Is Dragging
    
    -> Sprite set position to X: round(self.x/10)*10, Y: round(self.y/10)*10
    

    There is no smoothness in movement, and it is very difficult to fit the edge to the edge of the tile when dragging. If I set position to X: round(self.x/2)*2, Y: round(self.y/2)*2 for example, it's not quite what I need.

    What's shown in the gif is done somehow differently. The question is how?

  • Hi Guys!

    I want to do the same as in the gif. Move the object a set number of pixels so that the tiles don't overlap and line up in neat rows. How can I do this?

    dropbox.com/scl/fi/xl0fkmbxwnxspugvgresi/test01.c3p

  • This is how I would use pathfinding with move to behaviour to solve problem with overlapping... https://www.dropbox.com/scl/fi/hskyrprwwz8eh3s8evdmx/push_out_solid_v3.c3p?rlkey=wo90bvqk3al790bo0b9bsgdp6&st=8l710umu&dl=0

    This partially solves the problem. If remove this part, the movement precision breaks.

    Now the character doesn't reach the position where I click the mouse, it might stop 50px away, or 20px away.

  • Main problem that I see here is that pathfinding cell size is smaller then your sprite image 8 vs 10. Try to change it to 12 or to 10 and cell border -1

    Here is my idea how to deal with it. Check if it helped

    https://www.dropbox.com/scl/fi/9hcf7836pdufcgnbi3bgs/push_out_solid_v2.c3p?rlkey=nehksxjs0es07z8pq3gb4prnu&st=7lru8avh&dl=0

    Not the best solution. Very often, the character isn't pushed out and stopped in place, but teleported a short distance.

  • I tried to prevent the character from getting stuck on solid objects. To do this, I pushed the character's base out when it overlapped a solid object, but it looks weird and sometimes it pushes out at the wrong angle.

    Does anyone have an idea on how to do this?

    dropbox.com/scl/fi/jd828qo8z2khuca9los74/player_push_out.c3p

  • Create a new sprite. Move it randomly somewhere within your original sprite's bounding box. Test if it overlaps. If it does, you know your second sprite's X & Y coordinates are within your original sprite's collision polygon.

    https://drive.google.com/file/d/1lXK463Gy_pxs1DvlUoKuIZBtdkcIB6UY/view?usp=sharing

    Thank you very much, this is what I needed

  • I have a sprite with this collision mask. How do I get a random coordinate within this collision mask?

    Tagged:

  • Here's one of those ideas implemented. To use you just need to set the collision polygon to cover the object and set the two image points to the left and right of the base of the objects. Sorting should work fine as long as the bases of the iso objects don't overlap, and even then it seems to mostly be fine.

    https://www.dropbox.com/scl/fi/yuhfzrh8qie1u1946gzh4/iso_sort_6.29.25.capx?rlkey=zq3x4v0kdzambky1i6gt4kla9&st=qpexssm6

    The nice thing about this method is you aren't restricted to blocks aligned to the iso grid, so you can have thin walls or blocks with rotated bases.

    Keep in mind this is for if all the blocks are on the ground. aka no stacking or floating blocks. If you need those then the idea would need extending.

    Currently it just doesn't try to sort between two objects if their bases overlap. I'm kind of curious if it would work better to instead figure out how much on one side of the line or the other the object is and use that. But that's an idea for another day.

    thank you very much, just what I needed

  • With iso if the objects are all the same size you can just y sort by the bottom corner.

    Do you mean sort objects like this?

    Here’s an older but useful link about isometric sorting.

    https://bannalia.blogspot.com/2008/02/filmation-math.html?m=1

    It's very interesting, but difficult to understand.

  • Perhaps the easiest solution for the fences specifically would be to split it up into individual sprites (and use hierarchies to stich them back together), so that sorting by Y position would approximate more closely to what you'd expect.

    cutting a long object into several parts is a bad idea. 1 object (fence) will turn into 5-6, and there can be 100 or more fences and there are still other objects.

    It may seem that this is a simple way, but it is not, there are also other problems - when draging the fence, it becomes visible that it consists of several parts, between which the distance can change (+-1px). I tried this method

  • You watched this topic, there are live links.

    https://www.construct.net/en/forum/construct-3/how-do-i-8/set-player-move-behind-front-185721

    This is not suitable for sorting rectangular isometric objects. In the gif you can see why

  • I'm making an isometric game and I'm stuck with the problem of sorting objects by the z-axis. The game will allow you to move objects and I need them to overlap each other correctly. How do I do this?

    I searched the forum for an answer, but most of the threads no longer have links to examples that work.

    dropbox.com/scl/fi/sddltg8u5xkk1qu94xoby/test.c3p

  • You do not have permission to view this post

  • You do not have permission to view this post