Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: A Good Way to Make Units "Roam"?
A Good Way to Make Units "Roam"?
May 27 2009, 5:05 pm
By: konflikt  

May 27 2009, 5:05 pm konflikt Post #1



I'm trying to get civilians to roam around pretty much exactly like critters do. Walk in a certain direction, stop for a little bit, then walk in another direction. Something that looks like they are naturally just milling around. Using the Junkyard Dog script doesn't do this, it makes units constantly running to what seems like a certain point on the map. Is there any good way of doing this? I don't want the Civilians to move TOO far from where they are originally placed.

Thanks

Post has been edited 1 time(s), last time on May 27 2009, 5:31 pm by konflikt.



None.

May 27 2009, 5:34 pm JaFF Post #2



If I remember correctly, you can run Junkyard Dog once in a while, this will make them change their destination every time you run the script.



None.

May 27 2009, 5:40 pm Pigy_G Post #3



You could cycle through on the civs with 1 location and give then mobile grid a order in a randomized direction :O



None.

May 27 2009, 6:40 pm JaFF Post #4



Quote from Pigy_G
You could cycle through on the civs with 1 location and give then mobile grid a order in a randomized direction :O
Then you'd have to detect walls and other obstacles with the same grid, which is not worth it. Also, mobile grids make air units a nay.



None.

May 27 2009, 7:07 pm konflikt Post #5



Yeah a mobile grid would be WAYY to much for what I want. And JaFF your idea doesn't really work how i want it. :\

Any other ideas?



None.

May 27 2009, 7:09 pm Pigy_G Post #6



Quote
Then you'd have to detect walls and other obstacles with the same grid, which is not worth it. Also, mobile grids make air units a nay.

You could always detect walls and use a ground grid, or else make sure the civs start far enough from the walls and you mobile grid them back before they can get to them.



None.

May 27 2009, 7:09 pm JaFF Post #7



Quote from konflikt
And JaFF your idea doesn't really work how i want it. :\
And how does it work? How often did you try running the script?
Quote
You could always detect walls and use a ground grid, or else make sure the civs start far enough from the walls and you mobile grid them back before they can get to them.
I hope by a 'ground' grid you mean a static grid, which is OK as long as the area whith the civilians isn't too big and you don't end up using too many grid units.



None.

May 27 2009, 7:16 pm scwizard Post #8



Just run Junkyard Dog every so often. It may not be quite as organic as critters, but it works well enough.

EDIT: Wow, people are making this WAY more complicated than it needs to be...

Attachments:
junkyarddog.scm
Hits: 4 Size: 38.51kb



None.

May 27 2009, 7:20 pm Pigy_G Post #9



Quote
I hope by a 'ground' grid you mean a static grid, which is OK as long as the area whith the civilians isn't too big and you don't end up using too many grid units.

Burrowed ground units work fine bro.



None.

May 27 2009, 7:35 pm konflikt Post #10



The Junkyard Dog every so often isn't as natural looking as I'd want, but I guess it will do. Thanks JaFF and scwizard.



None.

May 27 2009, 7:55 pm JaFF Post #11



Quote from Pigy_G
Burrowed ground units work fine bro.
No need to repeat what I said.



None.

May 27 2009, 8:00 pm lil-Inferno Post #12

Just here for the pie

I've done grids using Ultralisks and they work fine; you just need to move them from one location to the next and it makes the grid more random (which is the effect I wanted to achieve).




May 27 2009, 8:17 pm Vrael Post #13



Or you could do something simpler tha a mobile grid, but not quite as easy as junkyard dogging it. Do something like put 4 locations in the corner of the map, then cycle through every civilian every once in a while with a small location, randomly ordering it to stop (by ordering it to its own location) or order it to 1 of the 4 corner locations. Might work.



None.

May 27 2009, 9:07 pm Pigy_G Post #14



Quote
No need to repeat what I said.

You'll notice I didn't. You can mobile grid with burrowed units.



None.

May 27 2009, 9:43 pm Falkoner Post #15



Quote
You could cycle through on the civs with 1 location and give then mobile grid a order in a randomized direction :O

The civilians would deselect if you click them, looks extremely unprofessional, also it creates enormous lag, and the main problem with the idea is that you can simply keep using the AI Script to fix this problem.



None.

May 27 2009, 10:02 pm Pigy_G Post #16



Yeah but he said he didnt want scripts :O



None.

May 27 2009, 10:35 pm JaFF Post #17



Quote from Pigy_G
Quote
No need to repeat what I said.

You'll notice I didn't. You can mobile grid with burrowed units.
A mobile grid involves only air units; nobody ever suggested making mobile grids with burrowed units. A static grid is a grid involving burrowed units, which is what I thought you suggested, thus I confirmed that it would work fine under certain conditions.



None.

May 27 2009, 10:51 pm konflikt Post #18



Quote from Vrael
Or you could do something simpler tha a mobile grid, but not quite as easy as junkyard dogging it. Do something like put 4 locations in the corner of the map, then cycle through every civilian every once in a while with a small location, randomly ordering it to stop (by ordering it to its own location) or order it to 1 of the 4 corner locations. Might work.

I had thought about doing that stop idea, but then I realized that wouldn't it always make the Civilian that is the farthest down and to the left stop?



None.

May 27 2009, 11:00 pm Vrael Post #19



You would have to randomize the outcome for each civilian. The whole system would look something like this:

Give all Civilian owned by P1 to P2

Randomize Switches 1,2,...,X (however many you need to randomize for the number of outcomes you have, 3 locations and a "stop" command would need 2 switches because it's 4 outcomes)

Center Location "Civ Loc" on Civilian owned by P2 at Area

Conditions:
P2 brings at least 1 civ to Civ Loc
Switch 1 is set
Switch 2 is set
Actions:
Give 1 Civ at Civ Loc to P1
Order Civ owned by P1 at Civ Loc to Location 1

Conditions:
P2 brings at least 1 civ to Civ Loc
Switch 1 is cleared <-----------------------------------for 4 outcomes you will require 4 triggers to account for all possibilities of set/cleared
Switch 2 is set
Actions:
Give 1 civ owned by p2 at Civ Loc to P1
Order Civ at Civ Loc to Location 1

With this setup it will only act on 1 civilian per trigger cycle. If you copy the 4 "outcome" triggers X amount of times, it will act on X civilians per trigger cycle.

This method will circumvent always acting on the same civilian, because this setup will cycle through each civilian since it gives them all to another player at the beginning, then gives them back to the other player one at a time with new orders.

Edit: fixed some conditions



None.

May 28 2009, 12:08 am konflikt Post #20



That would work. Thanks Vrael!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:08 pm]
Oh_Man -- example of wat u mean?
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5: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/
Please log in to shout.


Members Online: 3harperc672wa9, Ultraviolet, 2claudiac812rh0