Proposals/Alien Team Selection

From UFO:AI
< Proposals
Revision as of 10:48, 13 August 2013 by H-hour (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

This proposal outlines an alternative mechanism for creating and equipping aliens in missions. It arose from a discussion between geever and H-Hour on 2 Apr 2012 but is not slated for immediate development.

As of 2.4, alien teams and equipment are generated by matching up team equipment sets (.ufo script) with alien teams spawning from within the code. Our proposal would generate equipment on a per-alien basis in order to prevent the occurrence of aliens who have only a grenade. This equipping mechanism could also be used for equipping PHALANX soldiers if desired.

Creating the Alien Team

As of 2.4, alien teams are spawned when the mission is entered. Instead, alien teams should be spawned when the UFO is added to the game. This will allow us to implement future technology which might be able to decipher information about the UFO's mission, how many and which type of aliens are on board, or other useful data while the UFO is in flight.

Alien teams should be constructed from a list of alien teams defined like this:

alienteam alien_assault
{
	/*
	 * Minimum and maximum alien interest in which 
	 * this team should be used 
	 */
	alieninterest 300 500

	/*
	 * Mission types this team should participate in
	 */
	missions {
		terror
		base
		intercept
		harvest
		rescue
	}
	
	/*
	 * Valid alien types
	 */
	aliens {
		taman
		ortnok
		bloodspider
	}
	
	/*
	 * Equipment to give aliens
	 * This would reference equipment definitions
	 * described below.
	 */
	equipment	assault
}

The list of alien teams could also be used in the Skirmish menu to define the enemies.

Equipment Selection

Equipment should be assigned to aliens for each alien. Instead of drawing from a pool of weapons for the whole team, as is done in 2.4, we would assign each alien a primary and secondary weapon from a list of approved weapons, and then extra equipment. If no items are defined for primary, secondary or equipment, those items are not equipped. Each equipment set is defined on its own (below) and then referenced in the alien team definition (above).

equipment alien_assault
{
	/*
	 * Primary weaponry defines a weapon and its accompanying
	 * ammo. If no ammo is needed, none should be defined.
	 * The internal system should try to match weapons to alien
	 * skill type.
	 */
	primary {
		plasrifle		plasrifle_ammo
		plasbaster		plasblaster_ammo
		needlergun		needlergun_ammo
	}
	
	/*
	 * Secondary weaponry is defined if desired
	 */
	secondary {
		pbeampistol		pbeampistol_ammo
		plasblade
		/*
		 * An empty parameter could be used multiple times to
		 * effect frequency that a secondary would not be equipped
		 */
		empty
	}
	
	/*
	 * Extra equipment is defined if desired, with 
	 * a minimum and maximum number to equip of 
	 * each item.
	 */
	equipment {
		plasmagrenade	0 4
	}
	
	/*
	 * Armor to equip. Use of empty here could be very useful,
	 * as well as ability to repeat items to increase frequency.
	 */
	armor {
		armour_medium_alien
		armour_medium_alien
		heavy_alien
		empty
	}

	/*
	 * With a require parameter we can define which categories 
	 * must not be empty. We can add "empty" to both primary and
	 * secondary sections but tell the equip code that one can be
	 * empty but not both.
	 */ 
	require primary or secondary;

	/*
	 * Can be more specific:
	 * 
	 * require primary and (secondary or equipment);
	 * 
	 * Means "unit must have primary weapon and either a secondary
	 * or equipment item"
	 */
}