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 chakuze · Jun 04, 2015 at 01:59 PM · aipathfindingastar

A* (AStar) Pathfinding Issue - Path not spawning instantly

Hi,

in my scene I am instantiating a couple of enemies very fast after another (the game has a enemy wave system). As long as I instantiate four enemies or less it works fine -> They spawn, the path to the player appears and they start to chase. As soon as I instantiate more than 4, the first 4 start to move directly on them path, but the rest is waiting like one second or two and then getting their path and start chasing also. In my case this is exactly what I want, because otherwise a bigger wave is impossible to handle BUT NOW I want to implement a pause menu (I did this with Time.timescale=0) and when I pause and then resume the game a couple of seconds later, all of the enemies have their path ready now and they all attack exactly at the same time. It looks like there is some kind of queue behind this: As soon as the queue (which can maximum contain 4 elements?!) is processed, the next 4 elements are being processed. Am I right or does this work completely different? If yes, where can I change the queue size or who do I manage to stop the process of assigning paths as soon as I press the pause button and continue the assignment where it stopped before when I press resume?

Best regards!

Comment
Add comment · Show 2
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 Lahzar · Jul 11, 2015 at 08:55 PM 0
Share

I assume youre using the A* Project by Aron Granberg? I just got the pro version a few days ago, so I don't know these ins and outs, but I think the delay is because you are only using one thread and it can only take 4 before there is a difference in performance and thus the project stops it to prevent FPS loss? $$anonymous$$aybe something to do with repath rates also?

I think the best thing to do if you want some async going, is to code it into your spawn script. You can manually calulcate a path and you really have full controll over that. If you take manual control of the path creation, there are something on this on the getting started pages of the documents, then you can cancel it or just avoid assigning it to the AI while the timescale is 0.

We need some more info here. You want to spawn your AIs and then wait a little bit before they get their paths? Why not spawn your AIs in $$anonymous$$iwaves of 4 etc with a very small delay? What implementation of A* are you using?

avatar image Cherno · Jul 12, 2015 at 10:13 AM 1
Share

I recommend asking this directly in Granberg's own forum for the APP.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How do I go about making a 2d platform enemy ai 1 Answer

Astar Pathfinding ai moves more nodes than it should 0 Answers

Colliders and Astar 0 Answers

Sidescroller AI/Pathfinding/Flags/Waypoints 0 Answers

AI (Prolog) programming on Unity 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