Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Grid based, turn based, movement system

Discussion in 'Navigation' started by Aerokes, May 19, 2018.

  1. Aerokes

    Aerokes

    Joined:
    May 18, 2018
    Posts:
    1
    I'm new to unity and programming in general (I have an excellent understanding of the rules of programming, I'm just not completely fluent with the syntax and lexicon yet). I'm making a turn based, grid based, tactics RPG, heavily inspired by Final Fantasy Tactics. I'm in the very beginning stages and while I understand that trial and error is a critical part of the learning process, especially with programming specifically (I have a background in web development), I'd just like to at least be on the right road if i'm going to be falling over!

    My question is in the movement system. Every player will have a speed and jump value between 1 and 10. For each 1 speed they have, they can move 1 square(same for jumping). A diagonal move would count as moving 2 squares. How do I use the Navmesh (I think I also might need to use Ray scattering as well, but i don't fully understand all that) to highlight the area of valid movements based on their speed, jump, and map boundaries/objects. I was wanting to use this system as the movement controller as well. When they click on the highlighted square, the active character moves there.

    example:

    https://cdn.wikimg.net/en/strategywiki/images/0/02/FFT_BattleGrid.jpg
     
    Last edited: May 20, 2018
  2. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    When you say jumping, does that mean that your game has a significant amount of verticality? It sounds to me like you may want to not use a navmesh and write something custom. I have a 3D grid system in my game to allow enemies to fly around in space that a navmesh would never work in. I basically created a bunch of nodes at regular intervals in along all three axis, then do raycasts from each node to all of it's immediate neighbours to determine if there was a valid link between them. Once I have all of that information, it's a simple A* routine to get the best path to jump around the nodes.
     
    flipwon likes this.
  3. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    533
    I think Navmesh is overkill for this a simple tile grid (array) with A* is better for a grid based rpg.

    https://unitytutorials.ca/systems/full-games/tactics-rpg-systems

    Scroll down to "Tactics RPG" if the link doesn't bring you there directly, the tutorial contains everything that you need to make a Final Fantasy Tactics Clone.