• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What's the deal with Players 13-16?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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 25
Joined
Sep 26, 2009
Messages
2,381
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,337
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 26
Joined
Mar 19, 2008
Messages
3,140
Calling Player() with value ( i < 0 or i > 15 ) immidiately crashed the game.
In game, Neutral players have numbers: 12, 13, 14, 15 instead of range 13-16 due to 0-based indexing.

Most things have been said already, however, I'm unsure which player controls rescue-able units - it's probably Neutral Extra.
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
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,201
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