Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Looking for advice on the best method to create Tactical RPG maps (like FFT)

Discussion in 'World Building' started by Valasty, Nov 22, 2023.

  1. Valasty

    Valasty

    Joined:
    Aug 22, 2013
    Posts:
    125
    Hello friends!

    Sorry if this has been answered before, I tried searching for this solution but couldn't find a definitive answer...

    I have a simple tactical RPG setup with only Unity assets, just put some cubes together with some colliders and it's working great (these are all individual 1x1x1 cubes):
    upload_2023-11-22_13-56-57.png

    HOWEVER, this is just a test scene, I want to start thinking bigger on the best approach on how to bake these maps for them to look something like this:
    upload_2023-11-22_14-2-1.png

    My goal is:
    1) Building the maps with the best possible method
    2) Automatically add TRIGGER colliders for building my grid and detect projectile hits

    So I went to Blender and built a very simple map, exported to Unity for testing and noticed that a Mesh collider can't be Trigger unless it's Convex, but by using Convex the mesh grid doesn't exactly fit the mesh:
    upload_2023-11-22_14-9-23.png

    I thought I could just set all colliders with a single click but that didn't quite work... I'm very bad with 3D modeling, so maybe I'm missing something?

    Triangle Strategy (https://store.steampowered.com/app/1850510/TRIANGLE_STRATEGY/) is the most recent example of this kind of game, but I have no idea how they built it.

    So I ask you... what would be "the most professional way" of creating these kind of maps? Do I just create the maps on Blender and manually add Box Colliders as I did in my test scene?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,320
    Oh that's easy! Hire a team who knows how to do this and turn them loose!!!

    I'm being silly but the actual answer isn't far off.

    The choice of how you do it will have a lot to do with what you are good at doing, what you prefer to avoid.

    Under all of this, a Tactical RPG is some graph of positions and elevations and cover and LOS calculations that "feed into" the game engine during play.

    It's also some presentation of that data to the player, and some way to capture the player's intent (input), either in general (hotkeys) or in and around that presentation (clicks, drags).

    If you make the setup too complex you risk getting bogged down in details before you even get to first playable.

    If you rip it out quickly with cubes and hand-authored points and placeholders, you get to first playable much faster, but then often parts of it need to be refactored.

    Personally I will ALWAYS err on the side of fastest-time-to-first-playable, even if it is all gray boxes and hand-placed cells in a grid. The benefit is that you can quickly find out "Oh gee, this game isn't fun the way I designed it" or "Oh wow, it's far more work than I have time or patience to do in my spare time."

    As for your question about convex colliders, generally speaking do NOT put logic into the scene in order to get it back out and make gameplay decisions on it. Keep all relevant state yourself in your own data structures, if only for the simple reason that as soon as you need a load/save mechanism, you're gonna want all that data in one place to write it to disk, read it back, resume the game, etc.
     
  3. Valasty

    Valasty

    Joined:
    Aug 22, 2013
    Posts:
    125
    I do intend to do that one day, but it's too soon :)

    The gameplay already works and it's up and running flawlessly, that's not the issue.

    The issue is that I have to manually set box colliders all around, but I initially thought that I would just:
    1) build a map on Blender
    2) export into Unity
    3) assign a Mesh collider to it
    4) set it as Trigger
    5) done

    But it seems like I can't do Triggers on non-convex Mesh colliders, so I'm looking for the most optimal way of doing that.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,320
    What's the point of making it a trigger?

    For my thinking I would only use the original model and its colliders to decide the height of the ground so you can smoothly move units from point to point.

    Whether you feed that height into the tactical engine core (eg, use the height difference to give the elevated unit some attack / accuracy) benefits is up to you. Ideally you want a simple repeatable source of truth for stuff going into the game engine. You don't want a tiny art tweak (such as lifting one ledge a tiny bit) to change the engine's behaviour, usually.
     
  5. Valasty

    Valasty

    Joined:
    Aug 22, 2013
    Posts:
    125
    Check out my first screenshot, without Trigger Colliders I wouldn't be able to shoot a projectile under the bridge unless I did a lot of coding. I did try that, it worked, but it was just too much complexity than simply doing a Linecast with colliders. I had a topic here about it: https://forum.unity.com/threads/can-i-detect-a-projectile-collision-without-using-colliders.1480869/

    I also use Triggers to automatically generate me the grid on top of the map by raycasting from above.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,320
    You can use layers and the physics collision matrix to inhibit collisions between certain colliders.

    You can also linecast with a Layermask...

    The difference between Layers vs LayerMasks:

    https://forum.unity.com/threads/raycast-layermask-parameter.944194/#post-6161542

    "There are 10 types of people in this world: those who understand binary, and those who don't."
     
  7. Valasty

    Valasty

    Joined:
    Aug 22, 2013
    Posts:
    125
    Sorry for the late response, had a busy day today.

    I still need to set the colliders in the scene to hit layers.

    What I'm looking for is a solution to easily set colliders in the map without having to manually set several Box Colliders.