View Single Post
Old 03-23-2005, 07:10 PM   #5 (permalink)
mastermind2003
Senior Member
 
Join Date: Feb 2003
Location: USA
Posts: 853
Send a message via AIM to mastermind2003 Send a message via MSN to mastermind2003
Default

The limit on upgrades is because they use a 128 bit integer for upgrades. They then simply have to logically or the bitmask of the upgrade with the current upgrade mask, and they have a very fast cheap way to add upgrades. It's a clever optimization, as an upgrade check requires a single logical and. It also means that there is a hard limit somewhere for the number of upgrades. 128 bits is a good choice, as it is a multiple of 32 bits, which is what most processors like to work in. It's a matter of fast code versus expandability. They picked a limit that would provide everything that they need, and used it.
mastermind2003 is offline   Reply With Quote