Author Topic: spawn aliens randomly for a given rank ?  (Read 14936 times)

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #15 on: January 25, 2017, 04:33:37 pm »
Quote
[21:39] Solarius Scorch: Plus, I'm not sure why I would want a random rank, but only with the same dudes. Can't think of a scenario...

I can think of a scenario. To create more different deployments from the same race. I guess I have to explain that a bit...

A weakness of xcom mission generation is that deployments are too predictable. For the first UFO of a mission the race is a surprise, but for all following UFOs, if you know what UFO it is, you know more or less exactly what you will face.
With random option 2, you can mix it up a bit. You can do things like adding the odd tough enemy. Say a 10% chance on a sectoid crew that a sectoid soldier will be a muton instead. If surprise is the intention, option 2 works only well with low probabilities. But if you have like a 50% chance, the deployments become predictable again.

Option 1 can be used to create more surprises for the player. Like mixed crews.
Simplyfied example: Two ranks, each rank has all races in them with equal probability (sectoid, floater, snakemen, muton, ethereal), deploy 10 aliens per rank for a total of 20. With option 2 the deployment will give you 4 members of each race on average. With option 1, you would only see two races. So option 1 would generate very unpredictable deployments, while option 2 would create deployments that are more pedictable.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #16 on: January 25, 2017, 06:43:08 pm »
I can think of a scenario. To create more different deployments from the same race. I guess I have to explain that a bit...

A weakness of xcom mission generation is that deployments are too predictable. For the first UFO of a mission the race is a surprise, but for all following UFOs, if you know what UFO it is, you know more or less exactly what you will face.

You can do this already with alternative alienDeployments for UFOs although it requires slightly more work. You'll need to define several variants for each UFO (STR_MEDIUM_SCOUT_1, STR_MEDIUM_SCOUT_2, etc.), then create variants of alienMissions using those alternative UFOs, and finally setting up the alienDeployments with your choice of ranks. If you create just 3 variants for each UFO then the player will always be uncertain of which one he'll be facing.

Quote
With random option 2, you can mix it up a bit. You can do things like adding the odd tough enemy. Say a 10% chance on a sectoid crew that a sectoid soldier will be a muton instead. If surprise is the intention, option 2 works only well with low probabilities. But if you have like a 50% chance, the deployments become predictable again.

The issue here is that you risk facing tougher enemies like Mutons right from the 1st month. Which is perfectly acceptable if that is your goal, but if you're sticking to the original race progression then this solution won't work.

Quote
Option 1 can be used to create more surprises for the player. Like mixed crews.
Simplyfied example: Two ranks, each rank has all races in them with equal probability (sectoid, floater, snakemen, muton, ethereal), deploy 10 aliens per rank for a total of 20. With option 2 the deployment will give you 4 members of each race on average. With option 1, you would only see two races. So option 1 would generate very unpredictable deployments, while option 2 would create deployments that are more pedictable.

Mixed crews are nice to have but you should consider also that players will be expecting to face crews of a single race, like vanilla. On the earlier versions of my Area 51 mod I had almost 200 alienRaces defined, where you'd have the vanilla Sectoid, but then all sorts of mixtures, like Sectoids/Floaters, Sectoids and Sectopods or Chryssalids instead of Cyberdiscs, etc. But the feedback I got from players was that the mixed crews were OK but they were missing the single race crews, which were still possible to appear but at a much lower probability.

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #17 on: December 19, 2018, 06:53:29 am »
A question: Which alienRank should i use in alenDeployement section to spawn these random race members?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #18 on: December 19, 2018, 04:45:11 pm »
A question: Which alienRank should i use in alenDeployement section to spawn these random race members?

Are trying to use the "membersRandom" option with the vanilla game?

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #19 on: December 19, 2018, 05:14:05 pm »
No, just can not understand a syntax.
membersRandom defines units in race description. Then we must place these units on map. In alienDeployements section. How?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #20 on: December 19, 2018, 05:29:11 pm »
No, just can not understand a syntax.
membersRandom defines units in race description. Then we must place these units on map. In alienDeployements section. How?

You can't use alienDeployments to place units in a map, you'll need to edit the map blocks and add spawn nodes

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #21 on: December 20, 2018, 02:14:54 am »
Routes define WHERE to place units. And alienDeployement define WHO will be placed.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #22 on: December 20, 2018, 05:45:20 am »
Example:

Code: [Select]
    membersRandom:
      - [STR_SECTOID_COMMANDER]
      - [STR_SECTOID_LEADER]
      - [STR_SECTOID_ENGINEER,STR_FLOATER_ENGINEER]
      - [STR_SECTOID_MEDIC,STR_FLOATER_MEDIC]
      - [STR_SECTOID_NAVIGATOR,STR_FLOATER_NAVIGATOR]
      - [STR_SECTOID_SOLDIER,STR_FLOATER_SOLDIER]
      - [STR_CYBERDISC_TERRORIST,STR_REAPER_TERRORIST]
      - [STR_CYBERDISC_TERRORIST,STR_REAPER_TERRORIST]

Can I add the same unit multiple times to the list, in order to make that unit more likely to spawn?

Example:
Code: [Select]
    membersRandom:
      - [STR_SECTOID_COMMANDER,STR_SECTOID_COMMANDER,STR_SECTOID_COMMANDER,STR_ETHEREAL_COMMANDER,STR_FLOATER_COMMANDER]

edit: never mind, I answered my own question with a simple test. Yes it does work that way, unless I encountered very strange odds.
« Last Edit: December 20, 2018, 06:08:31 am by The Reaver of Darkness »

Offline Nord

  • Commander
  • *****
  • Posts: 1747
  • The Gate is open.
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #23 on: December 20, 2018, 07:46:32 am »
Ah, got it. One must write a set of random members for all ranks. Was'nt clear from initial description. Thanks.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9104
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #24 on: December 21, 2018, 01:53:18 pm »
Routes define WHERE to place units. And alienDeployement define WHO will be placed.

No... as far as I know, routes (or better said nodes) define WHERE and WHO to spawn... alienDeployment says HOW MANY.

WHERE being a tile/position
WHO being an alien rank
HOW MANY being a range between min and max
« Last Edit: December 21, 2018, 01:56:07 pm by Meridian »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: spawn aliens randomly for a given rank ?
« Reply #25 on: December 26, 2018, 06:31:33 am »
Yes, the spawn nodes on the map have rank values. As I understand it, a given rank alien can spawn on their own rank or lower. So if you make three commander spawn points and the map spawns one commander, it'll put it randomly on any of the three commander nodes. The commander can spawn on a navigator node if it needs to, but it'll prefer a commander node if one is available. The remaining two commander nodes will go unused. Let's say you have 2 medic nodes, 3 navigator nodes, and plenty of soldier nodes on your map. You change the craft data to spawn five medics: two go into medic nodes, three go into the navigator nodes, and all navigators are forced into soldier nodes. So when you walk into the cockpit, you find a bunch of physicians in there trying to fly the ship to the alien hospital. Probably why the thing crashed, amiright?

   The deployment ruleset determines the number of aliens that spawn, i.e. 2-5 d3: the 2-5 sets the base range. Easy difficulties (Beginner and Experienced) spawn the minimum, 2. Hard difficulty (Superhuman) spawns the maximum, 5. Medium difficulties (Veteran and Genius) spawn the amount that's halfway in between them. In this case it is 3.5, so it rounds down to 3. The d3 means that after the initial number is chosen, it rolls 0 to 3 more. So Easy spawns 2-5, Medium spawns 3-6, and Hard spawns 5-8.
   The rest of the deployment ruleset data determines the equipment sets that each rank will have at each tech level. By default there are three sets, corresponding to tech levels 0, 1, and 2. When the map spawns, the game goes to the alienItemLevels section of the ruleset and determines how advanced it is in the game, and scrolls down that many lines. The line chosen dictates the likelihood of each tech level spawning. So for example let's say our item level line reads [0, 0, 0, 0, 0, 0, 0, 1, 1, 2]. The game is spawning in a soldier, so it randomly selects a number from the line. We have a 70% chance of getting a 0, 20% chance we get 1, and 10% chance we get 2. Let's say the soldier's possible equipment sets are: 0) plasma pistol, 1) plasma rifle, 2) heavy plasma. We roll a 0 and this soldier is given that first equipment set, plasma pistol. So if the UFO has around ten or more soldiers, there's a good chance we'll see at least one heavy plasma on one. But other ranks may be different. An engineer might have equipment sets 0) plasma rifle, 1) heavy plasma, 2) heavy plasma, and then any engineers we see have a 70% chance of having a plasma rifle, 30% chance of having heavy plasma, and will never have a plasma pistol. So you can affect the weapon layout either by making it different between ranks, or by setting up your alienItemLevels.