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
Check out the grid move tutorial for the 2D grid battle series, it basically works the same in 3D.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I also tried using the "Follow Path" node but no matter what settings I use the player warps to the end.
Thank you,
MMalone
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
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).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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
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.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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.
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...
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
see https://youtube.com/watch?v=n0bTeiXnGx0&ab_channel=ESO, time: 34:32.
Also,
https://youtube.com/watch?v=PvJ41bF1fm4&ab_channel=CohhCarnage, time: 12:46
I'm still getting a late turn (usually one cell) by the character after going around the 90 degree turn. Here is my schematic:
https://bl6pap004files.storage.live.com/y4mdJoJqPvIPIUmOb69P2pIR807j-4FaKLDJMep-yWN99fc2dh-1hfoZF8FZac7qyP0080ETkXcq8dyzy-sGd702C-ezyBKa8yntkZFVv2o9Uz9Ub3ABU8u9Ceb9XKJUkZQnPyKPc4vMGc2jTbPrqdsJ2K-scd1OsW45it8VUzvpt8So4DO85_hRpq0KDcjLLID?width=1548&height=602&cropmode=none
Thank you,
MMalone