Hey I'm very new to Ork and absolutely loving how customizable everything is. I'd like to make a game similar to Final Fantasy Tactics. I've been going through the initial tutorials, especially the Grid Battles Gameplay tutorial, which have been very useful. While the tutorial didn't cover it vertical height, it looks like that is an option to set that, which is fantastic as that is one of the biggest features I was looking for! The other big feature that I'd like to implement is horizontal jumping. What I mean by that is say you had a small stream and if a character had a high enough jump they could just jump over it, whereas a character with a limited jump would be forced to walk through it, costing double movement points. Here's a link to a gif I made showing one of the characters jumping over swampy tiles if my explanation was a bit confusing.

https://makeagif.com/i/DpFwgy

Is there any way to implement this with Ork? I was thinking of maybe setting custom grid path links from one cell to another that can be jumped to via the Grid Setup connections, but it looks like there isn't a way to add additional connections that I can see, just remove them :/ Also I'd need a way to limit that connection to people with a high enough jump stat, which I'm not sure if connections allow.
  • That can all be implemented via the grid move event. You just have to do all kinds of checks - e.g. checking the combatant's current position vs next cell's position for heigh differences (Check Height Differences node) or check the cell's type (Check Grid Cell Type node) and move according to that.

    So, jumping up/down - next cell is higher or lower.
    Jumping over river - next cell is a 'river' type cell, so you get the next cell until you get a non-river cell and directly jump there, etc.
    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 want to implement this but I have a problem at the very beginning: The Set Grid Cell Combatant node can warp the combatant to any cell within movement range, but I can't get it to set the combatant on an elevated cell — it always ends up underneath it.

    And, after confirming height differences (I got that part to work fine), how would I go about playing a jump animation? Thanks for your answer.
  • Individual cells are just game objects in your scene that are used to position their cell prefabs and combatants placed on them.
    Is your elevated cell actually elevated in the scene or is it just using a prefab that's higher than other cells?

    As for the jumping animation - this is done like any other animation, i.e. you just play 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!
  • edited May 2022
    Here's what's going on:

    image

    I elevated a cell and the combatant tried to move there but his pathfinding broke and he's stuck there. It doesn't matter if I do the cell elevation in the Scene view or apply an offset or set it up as a unique cell type in the Makinom editor, the result is the same.

    image

    In this example, I generated the grid on a relatively flat part of terrain, but you can see the corner cells are at an angle. I flattened the whole grid by selecting all cells and zeroing out the Y position and XYZ rotation, but this now causes pathfinding issues that weren't there before; it's like the mesh colliders from the grid prefabs haven't moved, and now combatants have trouble running into/over them.

    One last thing I tried was setting up a new Battle Grid on a flat plane with a cube in the corner, so that some of the tiles would be generated at elevation. Even in this case Set Grid Cell Combatant actually set the combatant inside the cube, below the grid cells.
    Post edited by Scyra on
  • I finally figured out that if I change the combatant's movement component type from Nav Mesh Agent to the Default it will move to the elevated cells properly while player-controlled. The player combatant also no longer suffers collision issues with the aforementioned corner cells that I flattened out.

    But, unfortunately, without the Nav Mesh Agent, the enemy combatant is now sinking into the ground.
  • Scyra said: But, unfortunately, without the Nav Mesh Agent, the enemy combatant is now sinking into the ground.
    This turned out to be caused by having 'Apply Gravity' ticked in the Change Position node within the Grid Move schematic I was using for enemy combatants. It looks like I'm back on track for now.
  • Well, yeah - gravity will make them stick to the ground :)
    Elevated cells would usually also have some physical thing that makes them elevated, in which case applying gravity will still work.
    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!
  • gamingislove said: Jumping over river - next cell is a 'river' type cell, so you get the next cell until you get a non-river cell and directly jump there, etc.
    I could use some pointers for setting this part up. My Grid Move schematic is based off the 2D tutorial setup:

    image

    Between the Store Grid Path and Change Position nodes I put my height checks and that all works great for vertical movement. Now for jumping over a river cell, I know I need a Check Grid Cell Type node somewhere, I'm thinking probably as a precursor to my height checks, so I can execute that part as it is currently on a Failed condition for Check Grid Cell Type: river. But on a Success condition I need to "get the next cell until I get a non-river cell." What nodes should I use to set up that loop?

    Thank you again for your help.
  • The loop works just like the already existing loop to cycle through the cells, i.e. if it's a river cell, loop back to the Store Grid Path node to get the next cell.
    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!
  • So that gets me jumping over cells, which is great. The only problem now is that the river cells are still charging their doubled move cost. By disconnecting everything after the first Settings node, I see that move range calculation is not actually handled by the GridMove schematic and occurs prior to it, so I don't know how to approach that.
  • edited May 2022
    Don't know if it will work in your particular case, but in my grid battles I make the move cost on certain terrain a formula. The formula checks for specific status effects on the player. Depending on their "move mode", those different status effects are applied. Perhaps you could do the same kind of thing - apply a "Jumping" status effect while the combatant is jumping, and have the move cost for the river cells be a function that returns a normal value if that status effect is present, and double cost otherwise?

    (But yes, you would need to be able to know that the jump was going to happen and do that calculation before the move itself starts, you couldn't apply the status effect mid-move).
    Post edited by StevieJay on
  • @StevieJay - Thanks for the suggestion. It has given me some ideas.
  • Well, move costs are calculated when selecting the path and just comsumed at the end of the move.
    As @StevieJay suggested, using a formula checking the user for things (e.g. if the combatant can jump over the river) should be the way to go.
    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
    Ok, I can work with that, thanks.
    Post edited by Scyra on
Sign In or Register to comment.