basically for SC2BW i've been trying to force 8 direction movement since i started the project almost a year ago
never had anything close to success until i started reading up on A*
im not a galaxy scripter so i've been doing it in GUI with reasonable success.
i was able to create relative nodes and find a path pretty accurately with about a 20ms runtime.
i consider my trigger to be super inefficient however and extremely dodgy. i intended to rework it once i got the mechanics down and a much better understanding of how it works.
anyway. having trouble getting it to use the diagonals. it finds a path but only using 4 directions.
im having a hard time wrapping my head around the recalculating part. this is mainly what im asking for help with.
im probably not recording my nodes properly either which i think is why im having so much trouble.
so anyway.
anyone have experience working with A* algorithms and can help me implement it properly?
He wants to use the A* pathing methods to restrict a unit to 8 directions. Units in sc2 can move in a full 360 degree range. Units from sc1 can only move in 8 directions ( compass points N,S,E,W,NE,SE,SW,NW). He wants to recreate that 8-direction restriction.
I have no idea how to do this though O.o I don't think its even possible, to be honest. But I'm not a data pro so....Take this as a free bump.
Also benmenftw, there is an edit button that you can use to add to your original post, instead of posting a second time. No big deal or anything but...yeah.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
it's definitely possible
my screenshot is proof i got it to work with 4 directions
it grabs a units position and target order position and finds a path, placing waypoints for the unit.
i just can't get diagonal to work as im pretty sure im not implementing it properly.
im in the middle of redesigning the trigger from scratch for the like 5th time hopefully doing it somewhat correctly this time.
then i will probably post it here if im not too embarresed with how badly implemented it is
Cool I am curious to see the result as I don't know how to implement this either, and sorry for asking an apparently off topic question.
lol.
But wow, I didn't think you could even do that O.o Nice job, maverck! I've got no experience with A* in the galaxy editor though, so I probably can't help you there. Attaching the map (you can remove everything except for the trigger to prevent theft) might help somebody figure this out.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
But wow, I didn't think you could even do that O.o Nice job, maverck! I've got no experience with A* in the galaxy editor though, so I probably can't help you there. Attaching the map (you can remove everything except for the trigger to prevent theft) might help somebody figure this out.
Why is that so funny? Is it because I posted two replies again? If that is the reason, it is because that time I was replying to two different people's comments. If not, I'm sorry for the misunderstanding.
This might be really off the wall solution, but you could create a buff/behavior, that creates some pathing blockers around the unit. That way the unit could literally not move in anything but 8 directions.
Would be a data editor only way of doing 8 directional movement.
i've tried something like that. but you can't make blockers small enough and they have to be too far from the unit (and will interfere with other units pathing)
No it is just my way of replying to multiple comments, I didn't want to make anyone upset or get off topic but I was curious as to why he was so baffled about it. I'm sorry if that offends or annoys you.
@maverck Have you tried asking this on the Galaxy Scripting section? Maybe someone there can come up with a solution, and you can get some more experience with Galaxy in the process possibly.
No it is just my way of replying to multiple comments, I didn't want to make anyone upset or get off topic but I was curious as to why he was so baffled about it. I'm sorry if that offends or annoys you.
@maverck Have you tried asking this on the Galaxy Scripting section? Maybe someone there can come up with a solution, and you can get some more experience with Galaxy in the process possibly.
@maverck Oh sorry I just saw your thread on that section.
Well, they don't have to interfere with other units. Just give them a collision that only that unit has.
Just go to Movement - Collide and Add something like Unused (Land 08) or something.
Then for your blockers, add the same collision, bam, everything else walks though them, your unit can't so it will "attempt" to go around the blockers, which will follow it, which leads it to 8 directional movement.
Edit: An alternative solution, instead of having the blockers follow the unit, would be to space the entire playable map area with micro sized blockers. Leading the map to function like a grid for any units with the proper collision enabled. lol
Well, you didn't really explain what you were looking for when you first asked. You had a picture of a single unit that you wanted to move in 8 directions. So I gave you a way without using Scripting/A* or long triggers to get that unit to move how you wanted it too.
If you want everything to move in 8 directions, then I doubt my idea will work for that.
I've actually got quite a bit of experience with A* algorithms and could definitely help you out.
No diagonal movement sounds like a very minor problem, if everything else is working correctly. You're probably correct in saying that it's an issue with the nodes, but it's hard to help you without knowing more about the implementation.
From experience, the very best thing you could to help yourself is to visually represent the algorithm's on the screen. So place some sort of marker at each node (with the editor it's probably easiest to just use a unit like a marine) and then while your A* is running have it update the color of each marker to it's current state, ie: white = unexplored, green = open, red = closed, blue = current node. Finally have the algorithm pause and wait for a mouse click after each step so that you can see what's going on. This will let you see what's wrong with your algorithm. For your current problem, watch it to make sure that diagonal nodes and not just orthogonal ones are being added to the open list.
I'd love to be able to help more, but I'd need to know more about your actual implementation. If you don't mind I've actually got a few questions about what your trying to do. You mentioned that it had a runtime of about 20ms, is that just for short distances like in your screenshot? or is that the time it takes to say, calculate the path from one side to the other of BGH? Secondly, how do you plan to handle group movement? and how to you plan to cope with other units which dynamically move around the map and may end up, for instance, blocking your path after it's been calculated?
Cheers
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
basically for SC2BW i've been trying to force 8 direction movement since i started the project almost a year ago
never had anything close to success until i started reading up on A*
im not a galaxy scripter so i've been doing it in GUI with reasonable success.
i was able to create relative nodes and find a path pretty accurately with about a 20ms runtime.
i consider my trigger to be super inefficient however and extremely dodgy. i intended to rework it once i got the mechanics down and a much better understanding of how it works.
anyway. having trouble getting it to use the diagonals. it finds a path but only using 4 directions.
im having a hard time wrapping my head around the recalculating part. this is mainly what im asking for help with.
im probably not recording my nodes properly either which i think is why im having so much trouble.
so anyway.
anyone have experience working with A* algorithms and can help me implement it properly?
no-one?
@maverck: Go
Wait are you saying you just want to script the unit to follow the path portrayed in the image above?
@benmenftw: Go
Or are you saying you want to do it but you want to make the pathing using that particular method?
@benmenftw: Go
He wants to use the A* pathing methods to restrict a unit to 8 directions. Units in sc2 can move in a full 360 degree range. Units from sc1 can only move in 8 directions ( compass points N,S,E,W,NE,SE,SW,NW). He wants to recreate that 8-direction restriction.
I have no idea how to do this though O.o I don't think its even possible, to be honest. But I'm not a data pro so....Take this as a free bump.
Also benmenftw, there is an edit button that you can use to add to your original post, instead of posting a second time. No big deal or anything but...yeah.
@zeldarules28:
it's definitely possible
my screenshot is proof i got it to work with 4 directions
it grabs a units position and target order position and finds a path, placing waypoints for the unit.
i just can't get diagonal to work as im pretty sure im not implementing it properly.
im in the middle of redesigning the trigger from scratch for the like 5th time hopefully doing it somewhat correctly this time.
then i will probably post it here if im not too embarresed with how badly implemented it is
hopefully people can help then :)
@zeldarules28: Go
I know, I usually use the edit option but that time I just did that way.
@maverck: Go
Cool I am curious to see the result as I don't know how to implement this either, and sorry for asking an apparently off topic question.
lol.
But wow, I didn't think you could even do that O.o Nice job, maverck! I've got no experience with A* in the galaxy editor though, so I probably can't help you there. Attaching the map (you can remove everything except for the trigger to prevent theft) might help somebody figure this out.
Why is that so funny? Is it because I posted two replies again? If that is the reason, it is because that time I was replying to two different people's comments. If not, I'm sorry for the misunderstanding.
@zeldarules28: Go
Wow...
@benmenftw: Go
I can replay to two different comments. see?
This might be really off the wall solution, but you could create a buff/behavior, that creates some pathing blockers around the unit. That way the unit could literally not move in anything but 8 directions.
Would be a data editor only way of doing 8 directional movement.
@AstralCV:
i've tried something like that. but you can't make blockers small enough and they have to be too far from the unit (and will interfere with other units pathing)
@grenegg: Go
No it is just my way of replying to multiple comments, I didn't want to make anyone upset or get off topic but I was curious as to why he was so baffled about it. I'm sorry if that offends or annoys you.
@maverck Have you tried asking this on the Galaxy Scripting section? Maybe someone there can come up with a solution, and you can get some more experience with Galaxy in the process possibly.
@benmenftw: Go
Oh sorry I
@maverck Oh sorry I just saw your thread on that section.
@maverck: Go
Well, they don't have to interfere with other units. Just give them a collision that only that unit has.
Just go to Movement - Collide and Add something like Unused (Land 08) or something.
Then for your blockers, add the same collision, bam, everything else walks though them, your unit can't so it will "attempt" to go around the blockers, which will follow it, which leads it to 8 directional movement.
Edit: An alternative solution, instead of having the blockers follow the unit, would be to space the entire playable map area with micro sized blockers. Leading the map to function like a grid for any units with the proper collision enabled. lol
@AstralCV:
?
but units of the same type will collide
also there are not enough different collision types for all the unit types
@maverck: Go
Make sure dragoons suck at moving.
@maverck: Go
Well, you didn't really explain what you were looking for when you first asked. You had a picture of a single unit that you wanted to move in 8 directions. So I gave you a way without using Scripting/A* or long triggers to get that unit to move how you wanted it too.
If you want everything to move in 8 directions, then I doubt my idea will work for that.
I've actually got quite a bit of experience with A* algorithms and could definitely help you out.
No diagonal movement sounds like a very minor problem, if everything else is working correctly. You're probably correct in saying that it's an issue with the nodes, but it's hard to help you without knowing more about the implementation.
From experience, the very best thing you could to help yourself is to visually represent the algorithm's on the screen. So place some sort of marker at each node (with the editor it's probably easiest to just use a unit like a marine) and then while your A* is running have it update the color of each marker to it's current state, ie: white = unexplored, green = open, red = closed, blue = current node. Finally have the algorithm pause and wait for a mouse click after each step so that you can see what's going on. This will let you see what's wrong with your algorithm. For your current problem, watch it to make sure that diagonal nodes and not just orthogonal ones are being added to the open list.
I'd love to be able to help more, but I'd need to know more about your actual implementation. If you don't mind I've actually got a few questions about what your trying to do. You mentioned that it had a runtime of about 20ms, is that just for short distances like in your screenshot? or is that the time it takes to say, calculate the path from one side to the other of BGH? Secondly, how do you plan to handle group movement? and how to you plan to cope with other units which dynamically move around the map and may end up, for instance, blocking your path after it's been calculated?
Cheers