Verticality with this System?

Hello! I’m thinking about starting on this course. Had a flick through some of the modules, namely the grid section, and looks like the entire course is set on a flat level throughout, including the hex section

How easy is this to adapt to using slopes/different height sections? Just trying to make sure before I start on this that it’s correct approach for what I need going forward, don’t want to pick up something that’s out of my ability to modify

Apologies if this is answered somewhere in the course, I did quickly go through some videos I thought my be relevant but couldn’t see it mentioned

It’s not covered in the course, but there are several posts here asking the same question

Some

Thanks, looks like my keyword of vertical didn’t pick any of them up when searching, I’ll have a read. Thank you!

EDIT: Just for clarity, I wasn’t referring to ‘multiple floors’ as in grids over grids. I was just referring to having one grid, but the ability to have variation in the height for a more interesting map, e.g. hills. Not sure if that changes anything - it’s not clear from the other threads as the answers seem to suggest they’re for multiple floors. I’d assume the answer is the same regardless.

Yeah, I was going to suggest something for those kinds of grids, but I haven’t tested anything so I would be speaking under tremendous correction.

You would have to take the elevation (y-position - not to be confused with 2D grid’s y-position) into consideration. The grid is defined as a 2D grid, but you could add a 3rd dimension. I’ve seen Hugo’s grid system with a 3rd dimension but I can’t seem to find the video where he mentions it.

This is his playlist with all the grid-related videos

From there, you would probably include the elevation (y-position) into pathfinding solutions so that it would be slightly more difficult to walk up a hill, so the pathfinder would favour paths that don’t go over said hill.

The rest will be much the same. Raycasting may need some tweaking, too.

That’s excellent, that’s enough to get me pointed in the right direction. I’ve also since seen people talking about managing to put the grid over a Terrain as well, which might suit me well for my needs. Either way, I think I’ve got enough to keep me going now

Thank you!

If you just want one single grid with visual elevation then it’s pretty simple, for the grid logic you keep everything flat, exactly like the course, you only apply the elevation to the visuals.

Maybe you use a terrain mesh, then when the visual is doing a Move action you fire a raycast down into the terrain to find out on which Y to position the visual. But as far as the logic is concerned everything is still flat.

Doing it that way should be pretty simple since all the code in the course is set up so that the logic and visuals are separated.

2 Likes

fire a raycast down into the terrain to find out on which Y to position the visual

That sounds like a perfect and straightforward solution for what I’m looking for. Thanks for that clarification - just started on the course, looking forward to learning!

Also just in case you want the characters to be “angled” relative to the terrain instead of always straight up, you can use the RaycastHit.normal and set the character visual transform.up, similar to what I did in the Scout Probe Launcher video How it's Made: Outer Wilds | Scout Probe Launcher - Code Monkey

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms