Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ChemicalFire · Apr 13, 2018 at 12:50 PM · movementarrayspathfindinggrid based gameturn-based

3D Grid Based Movement (X-Com 2012 etc) – How to implement vertical movement?

G'day all,

I'm in the early stages of developing a simplified version of the modern X-Com games in unity. Not sure if it'll turn into anything more than a passion project, but it's a fun goal to have.

Anyway, I'm in two minds about how to implement the gridbased movement – especially considering that I need units to move up and down as well as forward, back, left and right. Worrying mostly about finding paths at the moment, less about actually moving anything.

My first approach is to just create a 3D array grid and use standard A* pathfinding to control movement. My question here is how do I deal with ramps and staircases etc. Basically, how do I specify WHERE units can go up and down and how they should move. And what do I do with all those wasted array cells that won't ever be used because buildings don't tend to be the size of a whole map...

The other potential method is to create multiple 2D array grids and use A* coupled with the ideas here: https://indiewatch.net/2016/05/28/tutorial-multi-grid-graph-navigation-in-unity/ to move between those grids. Though the issue here is that I'm still not sure how best to manage the actual process of moving up and down.

Does anyone have any tips? There are a lot of tutorials on YouTueb for this but NONE of them seem to cover moving units up and down, just left and right. Even if they DO show movement up and down it's never explained.

I've seen some images on google/here with users having lovely geometry hugging grids that allow units to move up and down ramps etc – I'm very jealous!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · Apr 13, 2018 at 01:20 PM 0
Share

In theory, moving up or down is not any different than moving on the ground, as far as pathfinding is concerned. The node doesn't care if it's connected to another node that's higher or the same level. From my own experiences, since you have a grid or rather cell-based layout, I would just declare the position(s) of any pathfinding nodes with the type of ground tile that sits at a certain position. So, a normal ground tile would have the node position right at it's center, while a ramp would have it higher up so it sits where the mesh of the ramp is.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

123 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I get my pathfinding algorithm to know that it cant go through certain sides of tiles 1 Answer

Moving only if straight path dijkstra 1 Answer

Turn-based-RPG-styled movement area color change 1 Answer

How can I make 3d grid based movement for a strategy game on the y axis 0 Answers

Help with RTS style controlls. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges