please make more teams possible (16 players or more)
Moderator: Moderators
- Dr.InfernO
- Posts: 223
- Joined: 18 Nov 2005, 13:55
- clericvash
- Posts: 1394
- Joined: 05 Oct 2004, 01:05
It's about 5 Meg extra to increase MAX_TEAMS from 16 to 255 when 5000 units are in game (4 bytes per team per unit plus a bit of constant overhead for storing Player & Team info for 255 teams/players).
Still I don't think it's smart to increase it that much as it will basically be unused memory most of the time and it will just cause more page faults, cache misses, and other complex slow things.
Still I don't think it's smart to increase it that much as it will basically be unused memory most of the time and it will just cause more page faults, cache misses, and other complex slow things.

Because that would mean extra overhead in terms of:
* speed (an extra pointer-dereference whenever LOS is used, which is basically everywhere) &
* memory usage (more then three extra pointers per unit, 3 for the std::vector plus some pointers internal to the memory allocator. The overhead would be as big or bigger then the array size in many cases, in which case fixed size arrays are the right solution IMHO),
Plus the current way just was easier to code
And additionally, it compiles faster
* speed (an extra pointer-dereference whenever LOS is used, which is basically everywhere) &
* memory usage (more then three extra pointers per unit, 3 for the std::vector plus some pointers internal to the memory allocator. The overhead would be as big or bigger then the array size in many cases, in which case fixed size arrays are the right solution IMHO),
Plus the current way just was easier to code

And additionally, it compiles faster
