Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Need Efficient Movement Technique
Need Efficient Movement Technique
Dec 17 2009, 2:41 am
By: Kimaru  

Dec 17 2009, 2:41 am Kimaru Post #1



Hi, I'm trying to have a unit move in the direction of the arrows in the image below. I don't want it to just move in the direction, I want it to be able to stop at any beacon that I so desire, and then start from there and continue its trek. My last resort idea is to put a location on every single beacon, but what I'm showing is only small sample of what I want to do. I figure maybe I could have burrowed lurkers on each beacon, but I have no idea how I could let the triggers know which way to take the unit...SEN, I need your help! Here is the specimen:





None.

Dec 17 2009, 2:47 am Dem0n Post #2

ᕕ( ᐛ )ᕗ

Have a burrowed unit on each beacon, each a different unit or owned by different players and one location. Place the location on the first beacon, then when the unit gets there, center the location on the unit that's burrowed under the second beacon, and move the unit to that location. When the unit gets there, move the location again, and then move the unit again. Do this for all the beacons.




Dec 17 2009, 2:57 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

well, you'll need to figure out an efficient way to have the orders circulate. Obviously you'll want to use burrowed units.

Start by figuring out the order of the waypoints. For example:

All lurkers are owned by player 9.
There is a lurker owned by player 9 at each beacon.
If you give 1 lurker to player 10, which lurker is that?
If you give 2 lurkers to player 10, which lurker is that?
Repeat until you have given ALL the lurkers, and their number. If the beacons are disabled anyway, then you may as well just use the beacons instead of doubling the number of units required.

Now that you have the numbers of each, order them in the way you want them to be, starting at any point. Center a location on the starting point, then center a second location on the next point. You'll probably have to give all the units back to player 9 before you can go onto the next segment, but you can fiddle with the most efficient way to do it after you have the idea down. If a player brings a unit to the first location, order it to move to the second location. Now, center the first location on the second, and the second location on the next point. Rinse and repeat.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 17 2009, 3:09 am Kimaru Post #4



Quote from name:Dem0nS1ayer
Have a burrowed unit on each beacon, each a different unit or owned by different players and one location. Place the location on the first beacon, then when the unit gets there, center the location on the unit that's burrowed under the second beacon, and move the unit to that location. When the unit gets there, move the location again, and then move the unit again. Do this for all the beacons.

This was the method I had in mind, but my pathing can be really jagged and crooked, so if I just center the location on a new lurker, it'll most likely center it on some distant lurker on another beacon...

@ rockz: I'm not sure I really understand your method. When you say "If you give 1 lurker, which lurker is it? If you give 2, which lurker is it?" Could you define that a bit more for me?



None.

Dec 17 2009, 3:41 am DavidJCobb Post #5



Here's what rockz means...

Say you place three Lurkers for P2, labeled A, B, and C (in the order you placed them).

Center location on Lurker for P2 // "oldest" P2 Lurker: A
Give P2 Lurker at location to P3 // gives A to P3
Center location on Lurker for P2 // "oldest" P2 Lurker: B
Give P2 Lurker at location to P3 // gives B to P3
Center location on Lurker for P2 // "oldest" P2 Lurker: C
Give P2 Lurker at location to P3 // gives C to P3 -- end of loop

Run those trigger actions, and you'll move the location over those Lurkers in order: to A, then to B, then to C.

Now simply break that up: make one trigger that gives the Lurker once, centers the location, orders the unit to that location... That trigger basically acts like a loop, running until there are no P2 Lurkers left (as they'll all have been given to P3).



None.

Dec 17 2009, 4:01 am Kimaru Post #6



There's just one problem, I need the unit to follow the beacons which go in arbitrary directions. SC will select from top left to bottom right. I need a method to select the lurker that's "ahead" of the unit in the path.



None.

Dec 17 2009, 4:15 am stickynote Post #7



Yeah, so do as rockz says and figure out how many lurkers to give till the location will center on the lurker you want it to be centered on. It might take a while if you have a lot of lurkers, but it would work.



None.

Dec 17 2009, 4:15 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!


You label the virtual locations (marked by some unit) based on the order they would be given. It always goes leftmost to rightmost, then whichever's placement ID was last if it's got the same x coordinate.

In this case, I'd want to send those at beacon 1 to beacon 4. To do that, you center location 1 on a zerg beacon owned by (in this case) red. give 3 zerg beacons to player 10 (beacons 1, 2, 3), then center location 2 on the zerg beacon owned by red. Issue the order command.
4-7
Center location 1 on zerg beacon owned by red at location 2. Give 3 zerg beacons (4, 5, 6). Center location 2 on beacon 7. Issue order.
7-11
Center location 1 on zerg beacon owned by red at location 2. Give 4 zerg beacons (7, 8, 9, 10). Center location 2 on beacon 11. Issue order.
11-9 Now comes the tricky part.
Center location 1 on zerg beacon owned by red at location 2. Give all zerg beacons to red, then give 8 back to player 10. Center location 2 on beacon 9. Issue order.
Repeat as you go along. It takes some thought, and you can always give all the beacons back, then give the number you want so you don't have to think at all. The problem with that is that it might lag more (giving units lags I think), but it also means you don't have to worry about the order of the triggers.

We're all thinking the same method, I just told you how to avoid the problem of centering on some random lurker/beacon. Make sure you add a DC to control when to turn on/off the orders so that the units will stop, and it won't lag when it doesn't have to. You may want to put in a delay as well so it doesn't spam the order every 84 ms, but rather every half second or so.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 17 2009, 4:27 am Kimaru Post #9



Quote from rockz

You label the virtual locations (marked by some unit) based on the order they would be given. It always goes leftmost to rightmost, then whichever's placement ID was last if it's got the same x coordinate.

In this case, I'd want to send those at beacon 1 to beacon 4. To do that, you center location 1 on a zerg beacon owned by (in this case) red. give 3 zerg beacons to player 10 (beacons 1, 2, 3), then center location 2 on the zerg beacon owned by red. Issue the order command.
4-7
Center location 1 on zerg beacon owned by red at location 2. Give 3 zerg beacons (4, 5, 6). Center location 2 on beacon 7. Issue order.
7-11
Center location 1 on zerg beacon owned by red at location 2. Give 4 zerg beacons (7, 8, 9, 10). Center location 2 on beacon 11. Issue order.
11-9 Now comes the tricky part.
Center location 1 on zerg beacon owned by red at location 2. Give all zerg beacons to red, then give 8 back to player 10. Center location 2 on beacon 9. Issue order.
Repeat as you go along. It takes some thought, and you can always give all the beacons back, then give the number you want so you don't have to think at all. The problem with that is that it might lag more (giving units lags I think), but it also means you don't have to worry about the order of the triggers.

We're all thinking the same method, I just told you how to avoid the problem of centering on some random lurker/beacon. Make sure you add a DC to control when to turn on/off the orders so that the units will stop, and it won't lag when it doesn't have to. You may want to put in a delay as well so it doesn't spam the order every 84 ms, but rather every half second or so.

Ok, that's a perfect method, thanks. However (sorry), I believe we've been discussing how to get the unit to go around the track nonstop. There's gonna be a lot of stop and go in what I'm planning. A player will roll a random number and advance that many times. Then the player is gonna get to roll again and advance that many times. I'm gonna need a way to detect where the unit is so it can pick up the cycle there.



None.

Dec 17 2009, 4:42 am rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

Gotcha. Yes, my way was for nonstop, but the same method can be used (and it will look better). Make sure you add in the DC, and have it count down. For example, if the player rolls a 6, have the trigger detect the following:
Number of spaces left to move is greater than 1 (in a DC) AND a certain DC (sorry can't think of a good name) is set to 2.
Issue order once from all the beacons at the same time. This will advance the unit one space.
Subtract 1 from the number of spaces left to move and the certain DC (now 1 so the order won't run).
Once the unit has left the beacon (I suggest centering a location over the unit always, and when there is no beacon in the location, the unit has left the beacon) allow for the next round of triggers to run via a certain DC being set to 0.
When the certain DC is 0, and there is a beacon in the location centered over the unit, you're back on the next beacon and can set the certain DC to 2.
Everything loops from there.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 17 2009, 6:26 am Kimaru Post #11



What I had in mind was hard-coding into the map the number of lurkers present, and each one represents a beacon. When it's a player's turn, lurkers will be given to p10 one by one, while simultaneously 1 is being added to Cantina per lurker. When the player's unit is found, the count stops and all lurkers are returned. Depending on the # in Cantina, that's where the player is. Then I'd have to hard-code each beacon for every death of Cantina, but that shouldn't be a problem since it's only a couple actions. I'll test this out tomorrow, thanks for your help.



None.

Dec 17 2009, 6:49 am Kenoli Post #12



Quote
lurkers
Marking the location of a unit with a another unit seems pretty silly.



None.

Dec 17 2009, 7:36 am Kimaru Post #13



Quote from Kenoli
Quote
lurkers
Marking the location of a unit with a another unit seems pretty silly.
I can't give the beacons to another player. I need the beacons to always stay the same color.
Btw, can anyone think of a really bright green player color?

------------------

Ok, so I've done almost everything I need for the basic movement. The only problem is that the movement doesn't work quite properly! At the beginning of every turn, I perform a check (lurker count off) to count what spot you're at in order to send you to the correct beacon, but the marine keeps going down 2 beacons...I'm uploading the map. I inserted a Display Text to indicate that a lurker is being given for the count off. The message should be seen about 15 times, but I only see it once. Can someone help figure this out?

BTW: When you're playing it, do not be slot 3/4. Those players haven't been triggered yet. Be slot 1 or 2.
Also you need to hotkey the robotics facility. Making a reaver stops the "dice"

Attachments:
Beacon Walking.scx
Hits: 1 Size: 56.58kb

Post has been edited 3 time(s), last time on Dec 17 2009, 9:19 am by Kimaru.



None.

Dec 17 2009, 10:54 am payne Post #14

:payne:

You could place beacons at specific distances from each other and use one location permanently centered on the walking unit. That location would be 1x1 pixel and you detect when he is on a beacon. Then, you center a bigger location which would fit 2 beacons (including the one the walking unit is already on) in. You give the beacon at the 1x1 to some player and center that 1x1 on the other beacon owned at the big location. ;o
You could also try to mix things up with Zerg/Protoss/Terran beacon alternation and such...
Anyways, I just wanted to shoot something else than a method with burrowed units.

Gl ^^



None.

Dec 17 2009, 4:55 pm NudeRaider Post #15

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Kimaru
Quote from Kenoli
Quote
lurkers
Marking the location of a unit with a another unit seems pretty silly.
I can't give the beacons to another player. I need the beacons to always stay the same color.
Give to P9+ to retain the color on the unit, but not on the minimap. If that's not good enough just use lurkers.

Quote from Kimaru
Btw, can anyone think of a really bright green player color?
http://www.staredit.net/files/464/

Post has been edited 2 time(s), last time on Dec 17 2009, 9:51 pm by NudeRaider.




Dec 17 2009, 7:11 pm fritfrat Post #16



You know, you could do this only using a few triggers... for the following examples, Run cycle is just a unit I am using dc's with. A switch or anything could work too, but a dc is easier if you want to copy for multiple players. Multiple players will each need their own burrowed units and Movement locations. Also, preserve trigger on everything, use hypers, and trigger order matters.


If there are are 12 beacons, place 1 p9 lurkers under 2 to start, 12 under 3, 11 under 4, ... 3 under 12, and 2 under 1. Also, start with location "movement" over 2, and "movement2" over 1, where your unit is.

1) DC for how many movements left is at least 1, current player brings 1 unit to Movement2, dc of run cycle is 0: order move to Movement, set dc of Run cycle to 1, move location Movement 2 to lurker at Movement, subtract 1 from DC for how many movements left.

2) If cp suffers 1 death of run cycle, p9 brings at least 1 lurker to anywhere: center location Upgrade on lurker owned by p9.

3) If p9 brings atleast 1 lurker to Upgrade; create one lurker for p8 in an unused area, give to p9, move to Upgrade (don't just create ontop, it won't center properly), give all lurker owned by p9 at Upgrade to p10

4) If p10 brings exactly 13 lurker to Upgrade; move location Movement on lurker owned by p10 at upgrade, remove 12 lurkers owned by p10 at Upgrade.

Now 2 and 3 will run a few times, and 4 will run once..

5) If p9 brings 0 lurkers to anywhere, dc of run cycle is 1; move location Upgrade out of the way, give all lurkers owned by p10 to p9, set dc of run cycle for cp to 0.


Ta da! I guess 5 is more than a few, but still very easy. I know I would just use tons of locations, though, because if you use units you are facing unit limit problems instead of location limit, even if you do use substitutes such as 1 hydra = 10 lurkers or something.



EDIT: to use tons of locations, you could use this model.. lets say p8 starts with all the beacons.
2) Always: center location 1x1 on moving unit.
1) DC for how many movements left is at least 1, p8 brings at least 1 beacon to 1x1:
order move (1->2, 2->3, 3->4, ... 12->1).
subtract 1 from DC for how many movements left,
give all p9 beacons to p8
give all beacons owned at 1x1 by p8 to p9.

As presented, it would need to be ensured that the location sizes for the beacons were bigger than the beacons, to make sure that the walker isn't outside of the "order move" area. Much easier than using burrowed units, though :)



EDIT2: Or, duh, easiest method yet by far. Use Mindarchn's trigger duplicator, and be sure to place the locations down in the order you want to use them. (You can change the order later in trigger duplicator, but this is easier).

Current player brings at least one unit to location %x, current player has suffered at least 1 death of Movements Left, current player has suffered exactly %x deaths of Zerg Spire:
Order move to location %x+1, subtract 1 from Movements left, set zerg spire deaths to %x+1.

And then manually make the last-> first edit :)

Post has been edited 8 time(s), last time on Dec 17 2009, 7:54 pm by fritfrat.



None.

Dec 17 2009, 7:28 pm rockz Post #17

ᴄʜᴇᴇsᴇ ɪᴛ!

Yeah, since you have 254 locations to use, you might as well use them all.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 17 2009, 10:23 pm Kimaru Post #18



I've been using rockz's method, involving giving lurkers to p10 in an order from top left to bottom right to configure movement from my two desired beacons, however I perform a check at the beginning of the map to ascertain the player's position. Doing this is essential, as each beacon has its own destination. For some reason the check occurs once, then stops.



None.

Dec 18 2009, 12:32 am fritfrat Post #19



I at least win the efficiency award for doing the whole thing (if it's less than 60 beacons) in 5 triggers/3 locations, right? :)

I would like to encourage thinking about if the location limit is that limiting that you can't have a location on every beacon. I remember when I made Stratego I was planning out tons of methods with using burrowed units, but was eventually like, hmm.. 92 squares x 2 boards is only 184 locations, and I don't need more than 254-184=70 to do the rest of the map, so I just laid down the 184 locations and used trigger duplicator like crazy. It really did save a ton of time in the long run (even though I ended up using burrowed units on each square for other purposes in the map), and it's a useful program to learn how to use.

Or just using my 5 triggers/3 location method I listed, but it is true that it does not detect where it is, which you may need for other purposes in your map. You could always do that independently of the movement system, though.

Post has been edited 2 time(s), last time on Dec 18 2009, 12:39 am by fritfrat.



None.

Dec 18 2009, 12:39 am Kimaru Post #20



UPDATE: It works very well now! The movement is really coming along nicely...except that when you roll a scourge, you lose the robotics support bay and the new roller doesn't appear in the correct spot. Can anybody check the map out?

Word of caution: Hotkey robotics facility at start, make reaver to stop the "dice". Make shuttle to force get the support bay, don't make an observer.

Attachments:
bw1.scx
Hits: 1 Size: 59.83kb



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: DarkenedFantasies