typedef struct _player_ Player;
This structure contains all informations about a player in game.
The player structure members:
This is the unique slot number. It is not possible that two players have the same slot number at the same time. The slot numbers are reused in the future. This means if a player is defeated, a new player can join using this slot. Currently PlayerMax (16) players are supported. This member is used to access bit fields. Slot PlayerNumNeutral (15) is reserved for the neutral units like gold-mines or critters.
Name of the player used for displays and network game. It is restricted to 15 characters plus final zero.
Type of the player. This field is setup from the level (PUD). We support currently PlayerNeutral, PlayerNobody, PlayerComputer, PlayerPerson, PlayerRescuePassive and PlayerRescueActive.
Name of the race to which the player belongs, used to select the user interface and the AI. We have 'orc', 'human', 'alliance' or 'mythical'. Should only be used during configuration and not during runtime.
Race number of the player. This field is setup from the level (PUD). This number is mapped with RaceWcNames to the symbolic name Player::RaceName.
AI number for computer (See PlayerAis). This field is setup from the level (PUD). Used to select the AI for the computer player.
Team of player. Selected during network game setup. All players of the same team are allied and enemy to all other teams.
A bit field which contains the enemies of this player. If Player::Enemy & (1<<Player::Player) != 0 its an enemy. Setup during startup using the Player::Team, can later be changed with diplomacy. Player::Enemy and Player::Allied are combined, if none bit is set, the player is neutral.
A bit field which contains the allies of this player. If Player::Allied & (1<<Player::Player) != 0 its an allied. Setup during startup using the Player:Team, can later be changed with diplomacy. Player::Enemy and Player::Allied are combined, if none bit is set, the player is neutral.
The tile map coordinates of the player start position. 0,0 is the upper left on the map. This members are setup from the level (PUD) and only important for the game start. Ignored if game starts with level settings. Used to place the initial workers if you play with 1 or 3 workers.
How many resources the player owns. Needed for building units and structures.
Income of the resources, when they are delivered at a store.
Keeps track of resources in time (used for calculating Player::Revenue, see below)
Production of resources per minute (or estimates) Used just as information (statistics) for the player...
Total count for each different unit type. Used by the AI and for dependencies checks. The addition of all counts should be Player::TotalNumUnits.
If the player is controlled by the computer and this flag is true, than the player is handled by the AI on this local computer.
AI structure pointer. Please look at PlayerAi for more informations.
A table of all (Player::TotalNumUnits) units of the player.
Total number of units (incl. buildings) in the Player::Units table.
Total number buildings, units that don't need food.
Number of food available/produced. Player can't train more Player::NumFoodUnits than this.
Number of food units allowed. Player can't train more Player::NumFoodUnits than this.
Number of buildings allowed. Player can't build more Player::NumBuildings than this.
Number of total units allowed. Player can't have more Player::NumFoodUnits+PlayerNumBuildings=PlayerTotalNumUnits this.
Last resource used for repair cycles. Was introduced to reduce the repair speed.
Total number of points. You can get points for killing units, destroying buildings ...
Total number of units made.
Total number of buildings made.
Total number of resources collected.
Total number of buildings destroyed.
Total number of kills.
Color of units of this player on the minimap. Index number into the global palette.
Unit colors of this player. Contains the hardware dependent pixel values for the player colors (palette index #208-#211). Setup from the global palette.
Contains which unit-types and upgrades are allowed for the player. Possible values are:
|handle AI on local computer |
|total units of unit-type |
|race of player (orc,human,...) |
|enemy bit field for this player |
|Unit colors for new units. |
|# food units allowed |
|How many unit killed. |
|team of player |
|# buildings (don't need food) |
|food available/produced |
|last values for revenue |
|# total unit number allowed |
|resources in store |
|player as number |
|# units (need food) |
|total # units for units' list |
|name of race |
|type of player (human,computer,...) |
|map tile start Y position |
|income of the resources |
|last resource for repair cycles |
|allied bit field for this player |
|shared vision bit field |
|map tile start X position |
|AI for computer. |
|units of this player |
|# buildings allowed |
|Points for killing ... |
|name of non computer |
|color of units on minimap |
|Ai structure pointer. |
|income rate of the resources |
|Allowed for player. |