Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This question was closed Jul 28, 2013 at 07:44 AM by robertbu for the following reason:

Design discussion

avatar image
0
Question by Applesauce · Jul 28, 2013 at 05:52 AM · tilesboardgameadjacent

How can I find an adjacent tile, if the tiles vary in shape and size?

Working on a risk-style game, need to be able to find which tiles a unit can move to, depending on which tile it is on, keeping mind that the tiles are countries/territories. Any ideas? Each territory is an individual 3d game object.

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 robertbu · Jul 28, 2013 at 07:43 AM 0
Share

General discussion questions like this one, especially with such sparse information about the problem, are not a good fit for Unity Answers. Unity Forums has a much better format for this kind of discussion. Even there, this question has little to do with Unity, and is mostly a data structure question. If you ask at the Forums, I suggest you include more details...number of countries, range on the number of adjacent countries, factors effecting player movement...

1 Reply

  • Sort: 
avatar image
0

Answer by RPGstandard · Jul 28, 2013 at 07:25 AM

You could do this by implementing a location state within your territories. For example, if you have Units sitting in the United States territory and you want them to move to either Canada or Mexico, you can assign the units a value based on their current location and using some type of number system (possibly Octal, based on the territory with the highest number of bordering territories) you can determine what areas your units are capable of moving to.

So essentially set up a function that gets where the selected units are located and allow for a total possible number of movements to other territories. Each territory would be assigned a true value that never changes ( to label the territory)and your units have a maximum of 8 (octal) movements they can make at any time.

So in the case of the United States give it a value of say 3, whenever the units return the value of 3 for their location, you know that they are positioned in the United States. Then when you select a unit it will have a total possible moves of 8, so assign the value 0 through 3 to mexico and 4 through 7 to canada. You would have to make an array that houses all of the numbers of each territory and what octal value leads from each territory to the next.

hope this helps.

Comment
Add comment · Share
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

Follow this Question

Answers Answers and Comments

17 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

Related Questions

How to make a player move along a fixed route 1 Answer

Random Modular Hex Board for board game 1 Answer

Filling a board with tiles, with separation 0 Answers

Adjacency information in geometry shaders 3 Answers

yield for animation 0 Answers


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