faulknermano's Recent Forum Activity

  • Problem Description

    Keyboard Plugin does not consistently detect keyboard physical position in certain situations (ie when key is released)

    Attach a Capx

    ____ Upload a Capx to this post ____

    Description of Capx

    Sprite element contains CustomMovement plugin. CustomMovement is simply mapped to WASD keys.

    Steps to Reproduce Bug

    • Run the game, then hold down the W key. Sprite moves up.
    • While W key is held down, press and hold D key. Sprite moves up-right.
    • Then release D key only (W still held down). Sprite nudges up, but stops afterwards.

    Then try another variation:

    • Hold down the W key. Sprite moves up.
    • While W key is held down, press and hold D key. Sprite moves up-right.
    • Then release W key only. Sprite moves right and does not stop.

    Observed Result

    When W key is held, and then D is held afterwards, releasing the D key will stop the movement altogether. But if the W key is released, the movement smoothly continues.

    Expected Result

    It seems like only the last pressed key is being received during a keyboard position check. I'd expect that the the keyboard's input is checked more actively so that player control is smooth. By the way, this behaviour is also the same when using 8-direction, and using arrow keys. As it stands, this behaviour limits the use of keyboard-driven movement.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Win 7 Pro

    Construct 2 Version ID

    Release 184

  • +1. I primarily come from vfx apps like Maya/LW which have their own way of dealing with UI workflow; this 'forgetting' of window layouts, especially when you have numerous event sheets and layouts, is one of the first things I that bugged me about C2.

    I'd encourage the devs to consider this issue and other UI workflows (the new auto-complete feature is a good example), as it will increasingly be a recurring issue in the long run as C2 is being used as as serious tool.

  • rexrainbow, thanks for your help. I finally got it working! The first few times I tried to make it work, the function became messy. But during the debugging I started to understand how slg_movement's moving path function worked, and I came up with something more straightforward, and something that I could read and maintain later.

    Like you suggested, Board.NeighborUID2DIR was used to get 'check direction', used a 2-dim array to get the 'reverse direction', corner1 (left of direction), and corner2 (right of direction).

    Then I made 2 checks: first check is destination Tile; if an edge exists the 'reverse direction', or any of the reverse direction 'corners', it means tile is inaccessible: movement is blocked (cost = -1).

    Second check is PreTile: if edge exists in the 'check direction' of PreTile, or any of the check direction corners, then movement is blocked.

    Else, default variable cost value of 1 is used.

    Again, thanks for this suite of plugins you've made. Although at the beginning it was hard to use because I didn't quite understand how it worked 'under the hood', now that I have more experience with it, it is getting easier to tweak and get specific results, making it a powerful tool.

  • Thanks rexrainbow! Your download tool updated it, and now I can see the NeighborUID2DIR expression.

    However, just so you know your GitHub repository doesn't seem to be updated; I compared the new edittime.js with the one in my GitHub directory (which I'm always synching), and NeighborUID2DIR only appears in the tool-updated one, not in GitHub.

    Thanks again.

  • Hi rexrainbow, I've updated the latest on GitHub, but the NeighborUID2DIR expression doesn't seem to be registered in the editor (need to update edittime.js, too?). Thanks!

  • Hi rexrainbow,

    Thanks for the suggestion. I've used 4 direction successfully, but I am currently trying to find a way to combine it: using 4 direction when it hits an edge, and 8 direction when no edge is involved.

    I'm trying to find a logic solution, but it would be nice to get your thoughts on it because you're obviously more familiar with the moving path algorithm.

    What I will attempt is this:

    -request a moving path from slg_movement

    -move chess accordingly

    -for every GridMove On tile, determine if current tile has an edge

    -if current tile has edge, switch to 4 direction

    -then get rid of moving path

    -request another moving path from current position to original destination

    (That's just the rough idea)

    (I will, of course, update if I get anything working)

    Thanks again!

  • Hi again rexrainbow,

    I've been trying to implement the board_edge plugin, and so far, for a certain configuration, it works.

    However, when using squareTx's '8 direction' the edge only respects one direction. I've attached an image which demonstrates the behaviour: the player is behind a long wall, and if the target tile is behind the wall, it will try to move diagonally (because there is no edge between the diagonal tiles). If I use '4 direction' it works fine.

    I've tried switching squareTx.Direction based on slg_movement's PreTile and Tile conditions, but I can't get it to work and I'm not sure if this is correct approach.

    I'm still trying to play around with the switching, but you have any tricks/ideas to get around this, it would be much appreciated.

    Thanks again!

    best,

    lernie.

  • rexrainbow, thanks so much for pointing me here! I still have to try to implement the board_edge plugin, but it looks very promising.

  • Hi, rexrainbow, I have a question/feature request about slg_movement. I'm trying to create a moving path that goes around 'thin walls'. I don't know if this already possible.

    I've attached an image to try to explain what I mean.

    The top part of the image shows the behaviour that I'm suggesting, where you can define a 'wall' so that the moving path goes around neighbouring tiles depending on constraints.

    The bottom part of the attached image shows a suggested implementation which allows the user to limit, per tile, a direction where the chess piece is allowed to enter from.

    Thanks for reading.

    best,

    lernie.

  • Thanks rexrainbow! Pardon the newbie mistake.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi rexrainbow , I get an error when I attempt to put this behaviour into /exporters/html5/behaviours/

    I've attached a screenshot of the error message.

  • faulknermano

    Thanks, I will test it as soon as possible. Or could you provide a test capx?

    rexrainbow

    Sorry I haven't gotten back sooner; been so preoccupied with the game. Though I instead used your ZSorter plugin to solve all my sort rendering issues, it would still be a useful thing to know the limitations of the Board function.

    In the attached chess_neighbour_check_debug_1.capx (which is based directly from your own isometric sample capx), look at event 'grid_movement_event' EVENT # 22 and # 23. #22 is called when player overlaps family 'gameobjects'. Then the subevent queries Board so 'pick neighbor chess' of 'gameobjects' class. When you click on tile and intersect the player with another sprite, the game hangs.

    Thanks again for all your work.

faulknermano's avatar

faulknermano

Member since 26 Jul, 2014

Twitter
faulknermano has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies