Random Movement
Jan 27 2011, 4:39 am
By: DrZygote214  

Jan 27 2011, 4:39 am DrZygote214 Post #1



Basically, I want a bunch of comp units to walk around randomly. But it can't be jittery. They have to like randomly choose a destination (preferably far from where they are), then walk there, then repeat.

Is this done with a script? See, there has to be a lot of them. It has to be crowded.

Related question: What's the location limit again? 100 or 200?



None.

Jan 27 2011, 4:48 am poison_us Post #2

Back* from the grave

Location limit: 256.

As for your question, I know a couple of methods off the top of my head:
One method is to make a trigger to randomize a destination, and alternate between ordering units to the destination.

Another is to utilize the random junkyard dog script. Usually it refreshes every so often, so this is kind of not what you want.





Jan 27 2011, 6:00 am Roy Post #3

An artist's depiction of an Extended Unit Death

Quote from DrZygote214
Related question: What's the location limit again? 100 or 200?
64 for vanilla, 256 for BW. Remember that Location 64 is the 'Anywhere' location, though.

Quote from poison_us
Another is to utilize the random junkyard dog script. Usually it refreshes every so often, so this is kind of not what you want.
On the contrary, this is likely exactly what he wants. The units walk to the destination, and then choose another destination and walk there. Using "Preserve Trigger" would cause the jittery effect, which he does not want.

Use the junk yard script.

If for some reason you wouldn't want to use that script, you should use a static grid system to move one location to different areas of the map. You can use a random switch system to determine how many units to give (which would determine where the location is centered). A drawback would be that you couldn't find specific units that have reached their destination, so some units could be ordered while still walking while others reach the destination quickly and stop walking. If you're interested in this system but don't understand how to implement the static grid system, just ask.




Jan 27 2011, 2:39 pm FoxWolf1 Post #4



Quote from Roy
Quote from DrZygote214
Related question: What's the location limit again? 100 or 200?
64 for vanilla, 256 for BW. Remember that Location 64 is the 'Anywhere' location, though.

It's only limited to 64 for Vanilla if you're using a version before 1.04. Otherwise, the limit is the same as for the expansion.



None.

Jan 27 2011, 7:06 pm DrZygote214 Post #5



Quote from Roy
On the contrary, this is likely exactly what he wants. The units walk to the destination, and then choose another destination and walk there. Using "Preserve Trigger" would cause the jittery effect, which he does not want.

Use the junk yard script.

Ok I'll test that, but how does the script work exactly? Does it really choose a truly random spot each time and for each separate unit? And then when a unit reaches its destination, does it instantly select a new destination? Also, does it do this for every single unit owned by the player that ran the script?



None.

Jan 27 2011, 7:47 pm Oh_Man Post #6

Find Me On Discord (Brood War UMS Community & Staredit Network)

Dude why don't you run the script and see for yourself?


The only problem I have with Junk Yard Dog is that it is not very good AI if you want a challenge. They can easily be kited, and sometimes they just randomly stop attacking you and run off. So to fix that problem I recommend adding a separate trigger that orders them to attack move to your heroes location (if the player controls a single unit that is). That way you get challenging AI that spreads out evenly around the terrain.




Jan 27 2011, 8:11 pm NudeRaider Post #7

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

Yes, it does all that.
However the script is run at a location and affects all units of the player in that location. It won't work when you run the location-less variant.




Jan 28 2011, 1:19 am DrZygote214 Post #8



Quote from name:private_parts
Dude why don't you run the script and see for yourself?

I did, but i still wanted to know exactly how it works. This is a place to ask questions, no?
Also, what did you mean by "They can easily be kited"?

I'm not using it for an attacking AI. I'm making a map where you have to "blend in with the crowd."

Quote from NudeRaider
However the script is run at a location and affects all units of the player in that location.

Does that mean that all the units will only wander around inside the location, or all around the map? (yes, I will test it too, I just want to know).



None.

Jan 28 2011, 8:54 am rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

JYD is like critters but without the stop.

I believe "kiting" means moving really fast when two units come together at the right angle, making them shoot up or down the map at a ridiculous speed.

I believe they will also wander all over the map.

You can create a semi random location based area by preplacing a bunch of burrowed zerg units, recycling a location above the zerg units, and ordering from one location to another.

Post has been edited 3 time(s), last time on Jan 28 2011, 3:36 pm by rockz.



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

Jan 28 2011, 12:36 pm poison_us Post #10

Back* from the grave

"Kiting" basically means to attack, move, attack, move, etc. all while remaining outside of the enemy's range. It's so you do damage without compromising yourself. With the JYD script, the units would return to JYD status after a short chase IIRC, then you can continue kiting.




Jan 28 2011, 2:15 pm NudeRaider Post #11

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 DrZygote214
Quote from NudeRaider
However the script is run at a location and affects all units of the player in that location.

Does that mean that all the units will only wander around inside the location, or all around the map? (yes, I will test it too, I just want to know).
All around the map

Kiting is a fancy word for "maintaining distance" (no matter where the kited unit goes, e.g. flees or charges). It's in analogy to kites which, when guided correctly, will always have roughly the same distance to you. Ranged units can use this technique to keep shooting a unit without endangering themselves.




Quote from DrZygote214
This is a place to ask questions, no?
Yes it is.
Just don't exaggerate it and keep the rules in mind:
Quote from Forum Rules
5. Run simple tests yourself. If it takes less than two minutes to make an example map and find your answer, do that instead of posting.

6. Avoid asking very basic questions. Staredit's help file (press F1 while using staredit), Blizzard's Staredit FAQ and some of the tutorials can help you to understand what is a location, what triggers are for or what an specific trigger action does. Do not waste our time by asking them.


Post has been edited 1 time(s), last time on Jan 28 2011, 2:21 pm by NudeRaider.




Jan 29 2011, 4:03 am Raitaki Post #12



Ok I'll test that, but how does the script work exactly? Does it really choose a truly random spot each time and for each separate unit? And then when a unit reaches its destination, does it instantly select a new destination? Also, does it do this for every single unit owned by the player that ran the script?[/quote]

Yes, yes, and no. The script only affects units in a location, but the units can and will run all over the map, not just the location you run the script in. The script also has these following properties:
1) JYD units will let enemy units come closer than normal before giving chase. While chasing with JYD on, broodlings only run half of the distance of every short sprint they make.
2) I don't know why, but in some maps, JYD units only start chasing you if you are attacking them or another unit close to them, and will stop immediately if you move or stop attacking as long as you're not in their (JYD) autoattack range. (which is about a little bit less than the length of a Supply Depot)
3) Running JYD every trigger cycle with hypertriggers on and no waits/wait blocks causes substantial lag to weaker computers. So even if you want to repeat JYD for a while, only run it again every time a JYD unit moves out of the area where they are supposed to be in and you move it back, or create a new unit.
4) Running JYD on a unit already JYD'ing causes it to change it destination immediately, hence the lag.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
[2024-5-10. : 8:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
[2024-5-09. : 11:31 pm]
Vrael -- :wob:
[2024-5-09. : 8:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
Please log in to shout.


Members Online: Roy