Jump to content

Help Randomizing Units


Vikingo

Recommended Posts

Hi all !

 

Was trying to add some random stuff to missions with no luck. Some of the missions I try to use as a base have password. So I ask to the missions Masters for a little help. Please someone can build a little mission template that can I use as a base and upload to dropbox or similar :$ With these characteristics:

 

 Some enemies units with 50%-50% chance to appear or not in mission

 Those units appears at random places of the map and start "patrolling" 

 

Just that ^_^ Hope you can help me with that mission for understand better the procedures. No need to explain I think I will understand just analyzing the units inside the mission editor (hope so hehe)

 

Thanks a lot!

 

ps I was reading the old posts with "random" inside and trying to figure out o.O

 

 

Link to comment
Share on other sites

Sorry can't build a mission where I currently am.

 

There are a few approaches to this.

 

A pretty simple approach is to create say three identical forces (now easier using the templates).

 

Locate these at say three different locations.

 

For each one of the units, right click on these and select "spawn if ..."

 

Then look at the bottom of the resulting window. There will be a line at the bottom where you put the chance of the unit spawning. I forget the exact verbiage but it will have "X1" on the line.

 

As you want a 50% chance of them being there you need to ensure the numbers don't exceed 50.

 

So in say the "top" location is maybe 0 to 20 (so 20% chance)

 

Middle maybe 21 to 30 (10% chance)

 

Bottom maybe 31 to 50 (20% again)

 

Therefore 51 to 100 = not appear.

 

You need to ensure the numbers are the same within a given group.

 

Of course you can change those numbers to reflect your personal test and you can further nest that with other conditions (so if the Enemy appears in the North reflect different numbers, if in the South different weights).

 

Then once they spawn you can have several routes from a common waypoint using a similar approach as above but using "embark if ...". Ideally change "X1" to "X2" other wise it wont be random - so if X1 is between 0 and 20 they will appear in the "top" and go on route 1 as both use X1 to make the decision and X1 is in the range of 0 to 20 in this run.

 

End result you may have a 20% chance of them spawning in a given location (say "top" above), then if they spawn there maybe a 20%, 40%, 30%, and 10% respective chance of them taking routes 1, 2, 3 or 4 coming from that spawn location.

 

Try to make the "embark if" sum to 100 or there is a chance they'll spawn and then not pick a route.

 

Does that help?

 

Edited by Gibsonm
Typos
Link to comment
Share on other sites

  • Members

Another option - the one that I prefer - is to first create your units. Those that are supposed to appear in random places, you create routes straight from the first unit to each of the desired spawn locations. Let's say you have four random locations, then you apply a "jump to end if..." condition with 0<X2<25 (where X2 is the random variable that you will always use for all these jump conditions to follow. On the next route you set the jump condition to 25<X2<50, then 50<X2<75, and finally 75<X2<100 on the last route.

 

That way this first unit is guaranteed to show up in one of those four locations, with a 25% chance each. By shifting the size of each "random bracket" you can make certain places more likely than others, of course.

 

Now copy the first route with the Jump condition to each of the other units that are supposed to appear in random places. The Jump condition will get copied over, so you don't have to apply it again. Then copy the second, third, and finally the fourth route with a Jump condition. You may want to arrange the exact end points of each "Jump route" to avoid crazy places like "in the water" or inside a building, but once you're done with it you can start placing routes normally for tactical behavior.

 

(Pure) random conditions will get evaluated and applied before the planning phase begins, by the way. So, units with a Spawn condition (see below) that are ONLY based on chance and no other condition will already be there in the planning phase, likewise Jump routes are being taken immediately (they work, however, only for routes originating from the unit and up to the first waypoint. Once a unit has reached its first waypoint it can no longer perform a teleportation.)

 

 

In a similar way you can then randomize with a Spawn if... condition which of the forces will actually appear. Be sure to pick a different random variable (e.g. X3) for every independent decision, but stick with that variable if you want the same chances applied to an entire group. Like, F-Company either appears, or not. Then all elements of F-COY should use the same spawn condition to avoid a chaotic situation where only parts of F-COY appear but others are missing (IOW, using the same random variable leads to coordinated random behavior).

Link to comment
Share on other sites

WOW! :o Thanks a lot Gibsonm and Ssnake for all those great tips and detailed information. After reading Gibsonm help I was able to create a very humble mini random mission (I will upload it later to dropbox...)  Now after reading Ssnake mega tips I must go back to editor and add more stuff B| Now is 4:48 AM here but I will report back ASAP. I enjoy so much these long nights with SB!! (today is a national day-off here so... no work! only SB today) Thanks again for help me!! Have a great day there!

Link to comment
Share on other sites

What do you mean by a "spawn zone"? Neither Ssnake or I used that term.

 

What we both said was create the unit(s) then right click and select "spawn if ..." and having done that set the conditions for the spawn to happen.

 

I don't understand what you have done.

 

Unless maybe you are referring to the spawn and drain areas for background civilian traffic?

 

Edited by Gibsonm
Link to comment
Share on other sites

  • Members

Well, technically a source for pool units actually IS called a spawn zone. I wasn't entirely happy about this because it invites confusion with the "Spawn if..." function, but I couldn't come up with much better wording.

 

Anyway, a spawn zone will only work as a spawn zone if all its required parameters have been set. In which case it will get a checkmark. In particular, you can't have a spawn zone without choosing the prototype unit(s) and without a drain zone (which can be the same region, and/or (multiple) others).

Link to comment
Share on other sites

Well with the nice tips I finish a super humble and basic "mission" with some random elements B|

 

You can download it here (dropbox, didn't upload to the downloads section cos is to sssoo basic) https://db.tt/GGwnbJXz

 

You have one T-72b1 + BMP-2 for scout and clean the zone. Those units will "revive" if get destroyed after some seconds. Yes, 100% realistic hehe I want just to see how the randomization Gibsonm and Ssnake point me works while playing  ;)

 

One thing I found is that if I place for example a TOW Unit, that unit don't do well the first "teleport" to start location. One soldier "teleports" while the one with the TOW stays at "false start point" then starts to undeploy the TOW and starts to walk to destination zone (where the other soldier is) I tried battle ready or not and different options with no luck. If the AT weapon is a "heavy" one the teleport didn't work. So I delete it and just use infantry with "shoulder" weapons. Those teleport without problems... I think now in just place 4 TOW units and then give 25% with an "X#" to them so only one spawn at desired "random" position and that can be an option for the no teleport problem... 

 

Have fun and thanks for the support! To much to learn... but is really a pleasure ^_^

 

--------

Spoilers for understand better "the template" for the ones that want to use it:

 

Blue Force: 

T-72b1 + BMP-2 (revive option for testing)

 

Red Force:

Marder unit with 75% spawn possibility with 1 100% start point + 2 50% scout waypoints (with heavy AT soldiers inside that will deploy under fire)

M113 unit with 100% spawn possibility with 4 25% starting points (+ engage waypoints) (with heavy AT soldiers inside that will deploy under fire)

Leopard unit with 100% spawn possibility with 4 25% starting points (+ engage waypoints)

AT Unit with 100% spawn possibility and 4 25% starting points (2 defensive position + 2 engage waypoints)

 

F8 Overhead view Enabled

-------

 

Link to comment
Share on other sites

1 hour ago, Ssnake said:

Clearly an oversight on our part, that TOW thing.

 

Glad that maybe it will be "on the list" ^_^

 

And I abuse of my reply and ask this directly to the boss (I post it at other thread but maybe it was not readed)

 

Please can these missing switches "click sounds" also added to "the list"? (No rush of course!)

 

http://imgur.com/a/oAsyr

 

Muchas gracias!! :)

 

Returning to editor now, a new world opened to me with those X# B|

 

 

Link to comment
Share on other sites

  • Members

You can't. That's what they do. They get thrown out of the pool and into this virtual world, move to their destination point in the drain zone, then return back to the pool.

 

You can create a relatively large zone that is both source and drain. That way they will walk from one random point in this region to some other random point in this region, and then reappear somewhere else to repeat the process, until the Spawn condition is no longer fulfilled (or if the character pool is empty).

Link to comment
Share on other sites

Just think of it as summoning time limited creatures, this is a great contingency to have for those occasions when your summoned demon escapes and starts causing havoc in your summoning room. Not that I have experience with my demons escaping... nope. *whistles innocently*

Link to comment
Share on other sites

Spawn-Drain Zones are limited in terms of enemy behavior, as stated above, but I have found them to be good for depicting enemy attacks, counterattacks, or meeting engagement scenarios. You can really go nuts with the amount of units, and there can be lots of geographical randomization depending on how large your spawn/drain zones are built. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...