Jump to content

Random Placement of Units or Waypoints?


TilvaItar

Recommended Posts

Yes.

 

You can spawn say a Tk Pl in:

 

Location "A" 20% of the time.

Location "B" 40% of the time.

Location "C" 30% of the time.

Location "D" 10% of the time.

 

Or you could have say 20 locations each with a 5% chance, etc.

 

Or just have the unit spawn in one location and a myriad of "jump to end if ..." (each with a probability) commands.

 

Edited by Gibsonm
Link to comment
Share on other sites

  • Members

However, the waypoints where the unit will spawn cannot be entirely random (exception below), just a random pick among (up to 20) defined locations (well, it's possible to concatenate multiple jump routes so technically you could create a very large number of possible locations, but it would be very, very, very impractical.

 

That being said, you can define two (or more) regions and a unit, and then right-click one of the regions and make it a "spawn zone" where you then pick the prototype unit that you want to spawn, and define one or more possible drain zones. This will then make one or more copies of the prototype units appear in a completely random spot inside the region that you designated as a spawn zone (could be a square covering the whole mapped area of your scenario), and then it will travel the shortest route from its random spawn location ot a random location inside the (or one of the) drain zone(s). Once it arrives at its desination it will spawn again and repeate the process, until it (and all its multiples) has/have been destroyed or immobilized.

The intended use are civilian cars and pedestrians walking random paths in your scenario with possible patterns of life behavior. But in principle it can also be used for combatants, be they hostile or friendly. A few caveats will apply; loaded passengers in the prototype unit will be treated as separate entities and thus spawn idependently, so you may see dismounted squads walking by foot, and their personnel carriers driving around empty.

Link to comment
Share on other sites

8 minutes ago, TilvaItar said:

Thanks for your tips. I went with the "embark if" option and the third last radio button there (random number).

 

Without knowing exactly what you did, using "embark if ..." means the unit will always start from the same location, but will take different routes to somewhere else.

 

That doesn't quite achieve what you asked for (at least in terms of the post topic) in terms of "placing units randomly", in that the unit will be placed in the same location but will then move to random locations.

 

As long as it achieves the outcome you wanted.

 

Edited by Gibsonm
Link to comment
Share on other sites

  • Members

You need to add a "Jump, if" ("Springe, falls") condition to the routes. That way, when they spawn, they will spawn at the waypoint at the end of the jump route (if the jump condition is fulfilled). If the spawn and jump conditions are purely based on random variables, the units will have spawned already during the Planning Phase. Otherwise they will spawn during the mission, depending on the conditions.

Link to comment
Share on other sites

  • 2 weeks later...
  • Members

I don't have one ready yet. But the concept is not very difficult to describe. Create two regions, the future "source" and the "drain". Create one unit. Right-click the source region, go to Options, Spawn Zone, Set Prototype. Pick the unit you created. Define how many copies of it should be assigned to this spawn zone (say, 5). Set the spawn rate (say, one per 30 seconds). You can chose to have the unit's copies to spawn at exactly every 30 seconds, or in a more randomized fashion (but still, on average, every 30 seconds). Define the Drain zone (the other region). Define the spawn condition. If you leave it empty, it will start spawning 30 seconds after mission start, and will end with the end of the mission.

Copies of the prototype units will then appear every 30 seconds, until the pool of copies has been depleted. The units will appear in a random location inside the spawn zone. They will then autonomously travel to a random spot inside the drain zone, and once that they have reached it, disappear/return to the clone pool.

 

That's largely it.

 

Points of consideration:

  1. Copies of the unit that die while in transit to the drain location will be (permanently) removed from the actor pool. Kill them all, and they will stop coming.
  2. When all copies have been spawned, no more will come until the first unit has reached its drain point, and be returned to the actor pool.
  3. A region can be both source and drain. In that case units will appear in a random spot and move to a random spot intin the same region.
  4. You can set units to travel off-road, in which case they will take the shortest route. Or you set them to travel on roads, in which case they will use the fastest route on roads that involves minimal amount of off-road travel
  5. If your prototype is a vehicle carrying troops (including unarmed grannies), troops and vehicles are considered separate prototype units, and spawn independently
  6. Spawn and drain points within the region are randomly selected, with a uniform distribution.
  7. If you make the regions very small, the spawn/drain location becomes very predictable (obviously).
  8. If you have exactly one drain zone for your spawn region, both are small, you have many copies of your prototype, and the spawn rate is high, the result will look like a trail of ants. The opposite end of the spectrum are rare, random interlopers that may appear when you don't expect them.
  9. Time-based switches of spawn zones allow you to create patterns of life, such as rush hour in the morning with cars from multiple suburb and peripheral village zones all driving towards the big city. In the evening the city could produce lots and lots of cars streaming to the suburbs.
Link to comment
Share on other sites

So once the spawned units reach a location, they disappear.  Is there a way to make them stay at such locations besides death? 

 

Or do I have to do this the hard, long, drawn out process by giving each unit the "Embark if" and and "Jump to end if" routine?  This isn't so bad at platoon and company level engagements.  But at battalion/regiment...😒

Link to comment
Share on other sites

  • Members
9 minutes ago, RedWardancer said:

So once the spawned units reach a location, they disappear.  Is there a way to make them stay at such locations besides death? 

No.

The intended purpose of the function is to create traffic from civilian pedestrians and cars. It also works for military units, but it's hard to imagine an application case that could be considered tactically sound and realistic.

 

9 minutes ago, RedWardancer said:

Or do I have to do this the hard, long, drawn out process by giving each unit the "Embark if" and and "Jump to end if" routine?

I'm afraid so.

 

But! 

You can copy such a route chain, once defined, and then paste it to the rest of your regiment:

 

 

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...