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 /
avatar image
0
Question by Kthieu · May 31, 2014 at 09:34 AM · aigridgraphhexturn based

How to simulate Turns in Turn Based Strategy Game?

Hello all. My group is doing a turn based strategy game using a hex grid. The objective I seek is to simulate a turns system between the player and the AI.

The simulation is envisioned to be shown as each unit moving individually one at a time and commencing its attack if possible. Right now, I made a temporary system that does all the AI unit's actions at once upon ending a turn. Think Fire Emblem or other turn system where enemies move one at a time and does what it does; this is something I am trying to achieve.

alt text

Here is a pic of the current grid state. Once the player units(blue) ends the turn by clicking the turn end button, the enemy moves all its units and does something each. How can I go about accomplishing this? Does Time.deltaTime play a factor in doing so?

Also, I can move this question to the forums if the moderator deems necessary, but I just want some quick links or advice as to how to get what I need. Thanks.

qinhelp.png (413.5 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by getyour411 · May 31, 2014 at 06:13 PM

 foreach (enemy in aiUnits) {
 // do stuff
 }
 
 debug.log("AI turn over");

Keep a list of aiUnits

Comment
Add comment · Show 2 · 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
avatar image Kthieu · Jun 01, 2014 at 12:03 AM 0
Share

That does everything at once. I'm looking for a one at a time effect here. So I do understand that is necessary, but again, looking for a delay between each unit's actions.

avatar image getyour411 · Jun 01, 2014 at 03:50 AM 0
Share

That doesn't do everything at once since it's an iteration through a loop; if you need a pause just do

 foreach(this in That) {
 // do stuff
 // pause 5 seconds
 }

Or provide a more specific example of what you are looking for

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

20 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

Related Questions

ai pathfinding project getting started scene problems 1 Answer

infinite 2d grid in an Editor Window 1 Answer

Hex grid Help, Move from Cartesian coordiantes to slanting one axis along the hex diagonal 0 Answers

Creating Hex Grids from Mesh Vertexes 0 Answers

Hexagonal Grids 2 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