Metathronos's Recent Forum Activity

  • Where it says "Luminocity" it should say "Luminosity"

  • Dang, yes you are right, i don't know why I typed 8 direction. Yes, i meant tileMovement

    also , i must be doing something wrong because in the layout editor, if my sprite has the origin point at "center","center", the sprite snaps to the intersection of 4 tiles at the sprite's center. But if i place it on any of the corners, my 16px character sits correctly inside the 16*16 tiles.

    I think i need to read the manual again to refresh my memory about that.

    I will try what you suggest, because if i manage to make it work, that will simplify my events a lot. Thank you.

  • I am, just not all at the same time. When walk group is enabled, only 8 direction is enabled. When chase group is enabled, only pathfinding and move to are enabled.

    I initially used 8 direction because I am going for a specific look for the movement. Like an old dragon quest game.

    I would definitely switch to pathfinding and move to behaviors exclusively if I can somehow manage to make it work in 16 px increments, to simulate the way 8 direction movement looks. 8 direction is more straight forward regarding collisions.

  • I adjusted the grid offset of tileMovement just for the npcs and that seemed to correct a number of things:

    Npcs no longer place themselves 8px and 8px between grid cells

    Npcs no longer go through solids.

    Npcs behave more predictably, following the grid when they chase.

    I also disable pathfinding and move to behavior when "walk" group is active

    this reduced the instances of npcs getting stuck in solids significantly

    what hasn't been solved:

    Npcs still randomly get stucK in 1px overlaps with solids occasionally, but can be "dislodged" by activating "chase" which makes them head towards the player.

    Npcs that get "trapped" in between 16px increments when chase gets deactivated, get paralyzed in place unless "dislodged" as mentioned in the previous case.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for your previous suggestions. I've been testing my NPC movement logic. I'm using TileMovement within a "walk" event group (controlled by a global boolean) to simulate random roaming, and it produces the desired orderly 16-pixel movement without passing through solids.

    The "chase" event group, activated when the boolean is false , disables the 8 direction behavior, and uses the behavior you recommended for following the player. While this works perfectly in the example file you provided (with a single pathfinding call on load and a static player), I've observed significant issues in my project file when the player is controlled and the pathfinding is recalculated every 'n' seconds.

    Specifically, in my file only, once the chase events are active, the NPCs end up with a fractional tile position (e.g., 8 pixels in one tile and 8 in another). This breaks the 16-pixel grid alignment and allows them to move through solids. In your file I also observed that the pathfinding + move to combination seems to create similar issues if I add 8 direction behavior to the player and make frequent calls for pathfinding (necessary to locate a moving player).

    In both cases the behavior is a bit erratical and npcs can suddenly start overlapping solids. Crucially, this prevents them from returning to the correct TileMovement behavior when the boolean is set back to true since they don't move in 16 px increments and I suppose the game doesn't know how to handle this when the boolean is toggled, or I haven't provided a way for the game to remedy their location.

    It appears the dynamic, repeated pathfinding updates while the player is moving are the primary cause of this instability and the inability to resume normal walking.

    Which brings me back to my initial question. I don't need to just move within the grid, I need each movement to de done in 16 pixel increments with the NPC only being able to move again after each step is completely finished.

    I know how to conceptualize this but I definitely do not know how to implement it.

  • THanks, that seems to sort out the movement, but now i have a strange behavior. it's as if the origin point of the npcs switches from being at top left, to center center. Or I don't know what is happening. It's as if their origin point, has to go through the center of each tile and when they reach the player they reach it at the players center, even though the origin of the player is also top left.

  • my grid is 16*16 px., obstacles are a tileset with solid behavior, tilesets are also 16*16, characters are 16*16

    I am unsure of what you mean by aligning the tilemap and configuring the pathfinding grid.

    currently these are the pathfinding settings:

  • or can an NPC using pathfinding chase a player while only moving within a grid, like TileMovement?.

  • i am running into this problem

    the issue happens at 0:16 and at the end of the video.

    youtu.be/AT9PxmuGB2g

    this is the player's collision box:

    I'm not sure how to prevent it. The player size is 16x16, its mask is 12x13px

    the platform is a tileset and each tile has a mask 16x16 in size.

  • Real nice. thank you

  • I tried using (random(0,100)) as the parameter value but the changes can be a bit drastic, is there a way to do it gradually?

  • Thanks, i'll try that

Metathronos's avatar

Metathronos

Member since 16 Mar, 2018

None one is following Metathronos yet!

Trophy Case

  • 7-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies