I'm using the 3D RPG Playground tutorial (as well as the ORK2 grid tutorials (orkframework.com/ork-2/tutorial/gameplay/grid-battles-part-1/)) and attempting to add a battle grid. The ORK2 tutorial creates a few battle AIs. I'm running into a strange issue during combat using the "Move Into Attack Range" battle AI. When it's the enemy's turn the player moves. Player moves toward the enemy then backs away. Afterwards, the enemy is warped to the player.

I've tried debugging ORK but haven't found the issue yet.

Any ideas what might be happening (where to look)?

Thank you,
MMalone
  • Hm, sounds a bit like your grid move schematic is wrong.

    Check out the grid move tutorial for the 2D grid battle series, it basically works the same in 3D.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The 2D "GridMove" schematic got the character moving. I can't get the player to smoothly following the path. This makes sense with the GridMove schematic since it's moving a cell at a time. I tried reducing the wait times but it didn't help.

    I also tried using the "Follow Path" node but no matter what settings I use the player warps to the end.

    Thank you,
    MMalone
  • Follow Path is for something different (using waypoint paths, a Makinom feature).

    Try playing around with the options in the Change Position node, e.g. moving by speed instead of time. Also, depending on how your movement setup is, you can also use different move compoment setup).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Tried lots of combinations but still having issues:
    1) character won't rotate to face direction of movement. I tried setting the "Face Direction" option and using a "Grid Rotate To Target" node. If I use a wait after "Change Position" the rotation happens but only after a cell or two has been traversed.
    2) depending on options set, character will move a couple cells then warp to the end then back again. If I add a wait it helps.
    3) If I use a wait then the movement isn't smooth.

    Thank you,
    MMalone
  • Are you using the wait options in the Change Position node?
    Without waiting for the move to finish, you'll basically browse through the path in an instant, reaching the last cell and being placed on it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yes, I have the wait option set. Doesn't seem to matter if it's set or not.
    Here is a link to the project (zip). Library and ORK DLL folder removed. If you can't access it let me know and I can just email it to you.

    https://1drv.ms/u/s!Ag-mfJnYw3BZgclKZv11FQHf0gFzpA?e=l09PyL

    Load the world scene, use wasd keys to move. Move forward until battle starts. Pick move action from battle menu. It probably doesn’t matter where you move to, but I went up a few cells then to the right a few cells.

    Thank you,
    MMalone
  • edited April 2022
    Tested it - there seems to be an issue due to the disabled node. I'll investigate what's causing this.

    Anyway, to fix your setup, just remove the disabled node. Also, the Wait node after moving isn't needed and will just make those stops you don't want.
    For turning into movement direction with this setup, change the Change Position node's rotation setup:
    - rotate component: Transform, otherwise it'll try rotating with the attached rigidbody, which is set to be kinematic (i.e. not doing anything)
    - lock rotation: enable X and Z (i.e. it'll only rotate on the Y axis)

    Edit: Alright, checked why the disabled node causes this.
    Due to the loop the schematic keeps hitting the same disabled node multiple times, which causes the schematic to stop. It's a safeguard thing to prevent the schematic to run forever and potentially causing a crash.
    I'll look into a better solution for this, probably limiting it to check nodes (i.e. having multiple next slots).
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That helped!

    I would like the combatant to rotate to face the new direction instead of a sharp 90 degree turn. I tried unchecking is kinematic and setting rotate component to rigidbody (rotation function set to "Move Rotation") but that didn't work. Also tried unchecking X and Z rotation lock but that caused a delay in facing the new direction.

    Also, the move component is set to nav mesh agent.

    Thank you,
    MMalone
  • Looking into direction via the Change Position node will immediately look into it, since it'll look into the movement direction. You'd need to use separate rotation nodes for this.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I'm using "Rotation Function" of "Move Rotation". According to unity docs (https://docs.unity3d.com/ScriptReference/Rigidbody.MoveRotation.html) the rotation should be smooth if "Rigidbody's interpolation" is set. I did set it but no change.

    Also, how to determine if the next cell is a "turn" so I can use a rotate node? Which node would be the best to use?


    Thank you,
    MMalone
  • As said, the Change Position node immediately sets the rotation into the movement direction - it doesn't matter which rotation function you use here.
    Use a separate rotation node for that insteand.

    You can e.g. use a Check Orientation node (or Orientation Fork node). Check if the next cell is in front of the user (machine object), if not, do your rotation.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2022
    gamingislove said: For turning into movement direction with this setup, change the Change Position node's rotation setup:
    - rotate component: Transform, otherwise it'll try rotating with the attached rigidbody, which is set to be kinematic (i.e. not doing anything)
    - lock rotation: enable X and Z (i.e. it'll only rotate on the Y axis)
    That's vital information for anyone trying to do grid tutorials after 3D RPG Playground.

    The instant 90 degree turns are what all the old SRPG's did, and it wasn't a noticeable problem. Here though, I think due to a combination of character proportions, animations, and camera settings, it's quite jarring. After adjusting the Change Position node's Move By Speed time value to 0.3, and tweaking the Main Camera settings so that it's either rotated to a 45 degree angle with low FOV, or set to Orthographic mode, I think the Cleric model at least looks passable during the sharp turns.

    Movement across cells wasn't smooth for me, and sometimes (around 50% of the time) the combatant had a noticeable 'bounce' at the end of the grid move—the bounce part was mostly fixed by getting rid of the Wait node from the 2D tutorial Grid Move Schematic, but it still happens for a millisecond. The movement across cells became much smoother by editing the Change Position node to Move By Speed > Speed Type: Run.

    I like the idea of having combatants rotate before turning. Thanks for the helpful thread.
    Post edited by Scyra on
  • edited May 2022
    Scyra said: Sometimes (around 50% of the time) the combatant had a noticeable 'bounce' at the end of the grid move
    When using Move By Speed, the combatant sometimes does not arrive precisely at the center of the new cell. In this case, ORK automatically re-centers it. That's the 'bounce' or jerking motion I was seeing. It looks like the combatant is stopping movement slightly too early. The node setup is exactly the same as the tutorial:

    image

    Disabling the Wait node at the end fixes the problem, but if you try to do anything further with the schematic, like adding a Grid Orientation Selection node, the problem reappears.

    I guess I could do Grid Orientation with an after-menu-close schematic...hmm...
    Post edited by Scyra on
  • The combatant is automatically assigned to the path's final grid cell at the end, which also places it on the cell. That's most likely what's causing it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.