Timeline for Navigate multiple Units on a grid through a tight space with different directions
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 11, 2018 at 20:04 | comment | added | blurry | @RIJIK A side note: Units that block a path should remember to clear that path if they are destroyed. You may want to track a unit's "blocked" squares so it is easy to clear them. You could also (instead) have the position track who blocked it, then see if the reference to the unit still exists when someone finds the blocked square. It ceasing to exist could indicate it's been destroyed and that the "block" is invalid. These types of bugs will definitely come up if not considered early. | |
| Apr 11, 2018 at 20:01 | comment | added | blurry | @liggiorgio I think this is best handled by saying "What is the next grid pos I'll occupy" and if it's "blocked" then you set yourself to "wait" mode. If it's not blocked, you check if it's a "bridge" by looking to see if it has X-amount of open nearby squares. You keep checking squares until you find one that satisfies this and then these all become "blocked." This means the unit who arrives at the bridge first (not who was told to move across it first) will get priority, as it'll "block" the bridge. if they arrive "at the same time" it'll be the unit who is iterated over first | |
| Apr 11, 2018 at 13:15 | comment | added | liggiorgio | This seems a nice idea, there's a point though: given two paths on the same plane, if they cross each other it doesn't mean the two instances will eventually bump into each other. This happens if the two objects move at different speeds: one may arrive way earlier than the other, and at least there'll be a global minimum distance between them over time. | |
| Apr 11, 2018 at 10:35 | comment | added | GRASBOCK | I like the idea of marking grid elements as paths that are already taken. I could also add them to the A* algorithm and make some prioritzed path based on that. I will have a deeper look at that and its possible issues. Thanks so far | |
| Apr 10, 2018 at 23:39 | history | answered | blurry | CC BY-SA 3.0 |