• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

What's the deal with Players 13-16?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

I tried searching for tutorials explaining what these players do.

I know players 0-11 are the canonical 12 players.

So is player 13 neutral hostile? Player 14 neutral passive?

Then what does that make 15 and 16??

And why can't we have players higher than 16? In Starcraft Brood War, it's possible to give units an owner flag from 0-255 (only though 0-12 are valid players). Doing so causes a memory overflow, but it does not necessarily crash the game. These are called Extended Players, e.g. see http://www.staredit.net/topic/13176/, and a lot of Starcraft advanced mapping is based around using the memory overflows to perform actions which aren't supported directly.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Neutral Hostile
Neutral Passive
Neutral Victim > I guess this is used for melee games as default, if a player leaves game its units given to this player
Neutral Extra > Its just a extra player just in case someone needs.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
My assumption, but it may be the same as with tilesets - maybe player's index is coded in 4 bits. 4 bits represent number ranging from 0 to 15, thus you get 16 slots. Maybe SCII increased it to 8 bits (thus 0 to 255) -> WCIII coding: 1 byte, SCII coding: 2 bytes.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
I am referring to Starcraft Broodwar (or Starcraft I).

So it will always crash if the argument passed to Player() is higher than 15?
 
The platform Battle.Net and the game War3 has hard-coded playable amount of multiplayer players, in this case it is 12 players. Those extra "players" are actual NPC, they are uncontrolled players for extra and given specific use.

Neutral Hostile - Controlling Creeps.
Neutral Passive - Controlling Critters.
Neutral Victim - Controlling Left Player. (Multiplayer)
Neutral Extra - Empty, This "player" can be used for another uses.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
Is the crash forced (e.g. Blizzard causes the thread to crash if Player() is passed one of those values)?

Is there anyway to set a unit's owner flag to value higher than 15 or lower than 0 without the game crashing?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
can I ask you something? Why dont you try, instead of asking? This is so easily testable. No the thread will not crash, the game will crash with error. This is because Blizzard didnt actually implement bounds checking for Player indexes, therefore when you do Player(16), you access memory that is out of bounds of your program, and the OS instantly shuts you off to protect other programs and the kernel in the memory from getting overwritten.

Its something like this in C:

C++:
int array[] = {0, 1, 2, 3}; //now, array is int[4]
printf("%d", array[4]);   //oops, out of bounds read
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
My assumption, but it may be the same as with tilesets - maybe player's index is coded in 4 bits. 4 bits represent number ranging from 0 to 15, thus you get 16 slots. Maybe SCII increased it to 8 bits (thus 0 to 255) -> WCIII coding: 1 byte, SCII coding: 2 bytes.
Unlikely since these are not word aligned. More likely is just an arbitrary mask was used (0x0f looks good, lets use that).

SC2 is a bit of a mystery. It does support more than 12 human players (I seen maps with 14!) but although defining maximum players as 64 or something absurdly huge, one cannot really use that many players (limit is applied somewhere else).

Reality is more than 12 players in this day and age is impossible anyway. In WC3 you are lucky to get more than 3 at the moment unless your map is one of the 3 odd popular ones. In SC2 people seldom wait for more than 5 players.
 
Status
Not open for further replies.
Top