How to make a unit walk in circles (from point 1 to 2, to 3, to 4 and so on) most efficiently?

X-maul

AKA: Demtrod
Reaction score
201
I need to have 4 units (starting from different locations, move in circles like this;
EjTzB8K.png

The units are supposed to move from point 1, to 2 and from 2 to 3, and so on. And then end at point 1 again where it starts over.
I got a unit starting at 1, 3, 5 and 7, and they are ofcourse meant to move to next point in line.

Currently I got a trigger that will trigger when a unit enters a region, and send it on to the next region, but that fires like 10 times a second, which I am worried might cause some lag.
Here's the trigger for reference;
Code:
Inner Moving 1
    Events
        Unit - Any Unit Enters within 2.0 of Point 001
    Local Variables
    Conditions
        (Owner of (Triggering unit)) == 15
    Actions
        Unit - Order (Triggering unit) to ( Move targeting Point 002) (After Existing Orders)
Is there a more efficient way of doing this? Maybe with actors or another trigger method?
 

hopy

Active Member
Reaction score
64
Well, adding all the move commands to a queue when entering point 1 would devide the number of triggering triggers by 8 I guess.
Code:
Untitled Trigger 001
    Events
        Unit - Any Unit Enters within 2.0 of Point 001
    Local Variables
    Conditions
    Actions
        Unit - Order (Triggering unit) to ( Move targeting Point 002) (After Existing Orders)
        Unit - Order (Triggering unit) to ( Move targeting Point 003) (After Existing Orders)
        Unit - Order (Triggering unit) to ( Move targeting Point 004) (After Existing Orders)

You could maybe do this with patrole commands, but I'm not sure if it'll go in a circle, or go back and forth (as in going around the circle, and then going around the circle again backwards). If patrole commands are possible it would only require a single trigger fire, so worth a try.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I don't know why it would fire 10 times a second but I would suggest putting them in a point array and having all events in the same trigger, loop through and get which one you're close to and go to the next one in the array(if you're not at the end, in which case you start at 0 again).

Tell me if you'd like me to elaborate.
 

X-maul

AKA: Demtrod
Reaction score
201
I don't know why it would fire 10 times a second but I would suggest putting them in a point array and having all events in the same trigger, loop through and get which one you're close to and go to the next one in the array(if you're not at the end, in which case you start at 0 again).

Tell me if you'd like me to elaborate.
Oh, now I know what you meant last night, I did not understand what you refered to when you refered to this post -_-

Well the reason why it fires so many times, is that I got 8 units running around at the same time. So it will be fired at a fast pace.

Having 1 trigger which will fire 100 times instead of 10 trigger firing 10 times. It's more efiicient, that's for sure, but wouldnt that still cause lag issues?

If that's not what you mean, you might need to elaborate :)
 

Dave312

Censored for your safe viewing
Reaction score
269
I don't think Siretu's method will solve any lag issues. I would be using Hopy's method of queued orders. You would just need to create one region and then queue move orders for each location to move to.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Implementing my version wouldn't take long. I don't think it will have any noticable performance issues, so I think it could've been worth trying out.

I think patrol will work fine and it's probably the best solution. Using shift and patrol, you can get a unit to patrol in a circle, so it should be possible with triggers.
 

X-maul

AKA: Demtrod
Reaction score
201
Ok, well I used the patrol method, but for some reason, the unit only want to take up to 6 orders, and then just ignores the following orders - is there any way to increase the amount of oders a unit can queue up? I need a unit with 26 orders, so it's pretty limitting :S

This is the trigger actions, I'm running now;
Code:
        Unit - Order CurrentUnit to ( Move targeting Outer 8) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 1) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 2) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 3) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 4) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 5) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 6) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 7) (After Existing Orders)
        Unit - Order CurrentUnit to ( Patrol targeting Outer 8) (After Existing Orders)
If I remove this line;
Code:
        Unit - Order CurrentUnit to ( Patrol targeting Outer 7) (After Existing Orders)
It moves in circles, but I need it to move in the right paths:confused:

EDIT: Apearently, it's named the Waypoint List (that which contains the patrol orders). Any ideas, on how to increase the capacity of that?
 

Dave312

Censored for your safe viewing
Reaction score
269
The problem is actually just because you are using the patrol command. By queuing Patrol commands, you set a waypoint along the units patrol path. However a unit can't patrol to the same point twice. So your unit will start at 8, then patrol from points 1 to 7. But then it can't patrol back to 8 because the unit already has that point in its patrol.

I tried creating this with 9 points and the unit will patrol along all of them except for the last one (as describe above). As for it apparently working with 6 points, I wouldn't have a clue.

What you need to do is use the Move command. Create a region at your starting point, then for any unit that enters this region, give them queued Move Commands to move around the circle and back to the start position. When they approach this start position, they will enter the region again and the unit will be ordered to move around the circle again.
 

X-maul

AKA: Demtrod
Reaction score
201
I tested it in a normal map, and if I try to give a unit more than 7 patroll commands in a queue, it gave me an error Waypoint List is full.

But I guess, I'll just use the method where I only use 1 region for sending them off.
 

Dave312

Censored for your safe viewing
Reaction score
269
When I did my testing, I was using an older version of the editor (I didn't have the latest patch installed). After updating the editor, I ran the test again and as you say, the unit can only queue 7 patrol commands. So it must be something they changed in one of the recent patches (nothing mentioned in the patch notes though).

Fortunately this problem doesn't exist with move commands, so you should be able to get this working with a region for sending them off without any issues.
 

X-maul

AKA: Demtrod
Reaction score
201
I did get it to work, with just 1 region sending it along a path leading back to the start.

So problem is solved :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top