Author Topic: How to make patrolling routes for aliens?  (Read 4742 times)

Offline Amoebka

  • Colonel
  • ****
  • Posts: 120
    • View Profile
How to make patrolling routes for aliens?
« on: October 10, 2017, 09:01:59 pm »
Greetings, fellow operatives.  :D
I'm working on my first mod for OXC, and it's going to be just a bunch of new UFOs for now (baby steps, all the way). I've figured out editing maps themselves (mapview) and editing MCDs (MCDedit), but setting the routes efficiently still escapes me. Just connecting all the main passages and setting spawns randomly results in 20 aliens clumping up in chokepoints, so a better approach is needed. There are some parameters of nodes that supposedly allow for it, but I can't figure it out by myself. Hopefully some kind soul could help me here.
1) What is the difference between setting the node type as "small" and/or setting all its links to "small"? If there are no terror units in the alien deployment for the map, can I just leave them both at "any", or will it potentially cause errors?
2) What does the priority flag do? Is one the highest priority, or is it ten? If a node has the lowest priority, does that mean the aliens will never use it? I really need some aliens to stay in their rooms / on their floors, can I achieve it by setting the lift nodes to one (or ten?)
3) What will happen if I leave some patrol routes disconnected from the rest? Errors? There is a disconnected circle of nodes on the roof of the vanilla Harvester, but no spawns there, does it serve any purpose at all?
4) What are the spawn priorities? Are they weights for randomized spawns (when there are more spawn nodes than aliens) or will the game fill them in strict order from highest to lowest? Is one the highest or is it ten again?
5) Is it possible to have "groups" of spawns? Lets say I have 2 rooms, each room should have exactly 1 soldier, but there are 4 possible spawn positions in each. Is it possible? If yes, how?
6) How precise should the node graph be in general? If a straight link between two nodes intersects a solid object, will the patrolling alien walk around it, or will it get stuck?
I know this is a lot of questions, but if I could get at least some answers, it will be amazing. Thanks in advance.  :D

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: How to make patrolling routes for aliens?
« Reply #1 on: October 10, 2017, 09:53:43 pm »
Greetings, fellow operatives.  :D

Hello there :)

Quote
Just connecting all the main passages and setting spawns randomly results in 20 aliens clumping up in chokepoints, so a better approach is needed.

First issue here regards map design - what type of terrain it is and how easy the patrolling units can move inside and between map blocks. Is is open like UFO maps? Is it closed like alien/XCom bases?

Then there's the issue of map size vs number of aliens being spawned. As a rule of thumb to avoid overcrowding, I use 1 alien per 10x10 mapblock as a maximum value - a vanilla 50x50 map would have a maximum of 25 alien units, and the proportions followed in the in most original maps usually would have a lower ratio of aliens per map area.

(Suggestion: post pics of your maps either in MapView or ingame - easier to help)

Quote
1) What is the difference between setting the node type as "small" and/or setting all its links to "small"? If there are no terror units in the alien deployment for the map, can I just leave them both at "any", or will it potentially cause errors?

Small/large/flying/flyinglarge refer to the size/type of units (small = Sectoid, large = Reaper, flying = Floater, flyinglarge = Cyberdisc, etc.). Setting a node as small will determine that only small units can spawn there (1x1) and setting links as small will determine the units that can use that link when patrolling. The main errors that can happen with using 'any' everywhere are large units (2x2) spawning inside rooms without being able to leave them, or units spawning partially outside buildings.

Quote
2) What does the priority flag do? Is one the highest priority, or is it ten? If a node has the lowest priority, does that mean the aliens will never use it? I really need some aliens to stay in their rooms / on their floors, can I achieve it by setting the lift nodes to one (or ten?)

10 is highest. The lower the number is, the lesser the chance that the alien will choose that node as a destination when patrolling. To keep certain aliens in certain areas you'll need to combine how they spawn (rank and priority of node) as well as the links.

Quote
3) What will happen if I leave some patrol routes disconnected from the rest? Errors? There is a disconnected circle of nodes on the roof of the vanilla Harvester, but no spawns there, does it serve any purpose at all?

The game may still use them in case there aren't enough spawning nodes available for all the alien/civilians units. Which can lead to units spawning in odd locations. Or clusters of aliens spawning around a node.

Quote
4) What are the spawn priorities? Are they weights for randomized spawns (when there are more spawn nodes than aliens) or will the game fill them in strict order from highest to lowest? Is one the highest or is it ten again?

Weights for randomized spawns, but the rank/type restrictions will be applied first. 10 is highest

Quote
5) Is it possible to have "groups" of spawns? Lets say I have 2 rooms, each room should have exactly 1 soldier, but there are 4 possible spawn positions in each. Is it possible? If yes, how?

If you have 4 possible spawn positions then it will be possible for 4 soldiers to spawn in that room

Quote
6) How precise should the node graph be in general? If a straight link between two nodes intersects a solid object, will the patrolling alien walk around it, or will it get stuck?

The alien will walk around it - AI is clever enough ;)
« Last Edit: October 10, 2017, 09:57:52 pm by Hobbes »

Offline Amoebka

  • Colonel
  • ****
  • Posts: 120
    • View Profile
Re: How to make patrolling routes for aliens?
« Reply #2 on: October 11, 2017, 06:48:59 am »
Thanks for the explanation, Hobbes!

For the stuff I didn't specify in my first post:

what type of terrain it is and how easy the patrolling units can move inside and between map blocks. Is is open like UFO maps? Is it closed like alien/XCom bases?

It's a UFO map chunk, so only technically a terrain. It consists of lots of rooms, 1 tile doors and lifts and 2 or 3 tile wide corridors, as a result.

(Suggestion: post pics of your maps either in MapView or ingame - easier to help)

Not sure how to add images to a post, so I'll attach one map as image files. The aliens tend to clump in the center of the 2nd (1st floor if you count the ground one? Is that a thing in english?) floor, near the grav lift, despite their spawns being randomly distributed all around the vessel.