[SDK] MAX_PLAYERS reduction

The Great Apple

Big Cheese
Joined
Mar 24, 2002
Messages
3,361
Location
Oxford, England
For performance reasons I'm looking to reduce the MAX_PLAYERS definintion in CvDefines. Unfortunetly every time I attempt it I get a slightly mysterious crash in CvTeam::reset which I can't seem to figure out at all.

Has anybody attempted reducing this yet? Is there something I should know? Is it even possible?

EDIT: MAX_CIV_PLAYERS not MAX_PLAYERS
 
The Great Apple said:
For performance reasons I'm looking to reduce the MAX_PLAYERS definintion in CvDefines. Unfortunetly every time I attempt it I get a slightly mysterious crash in CvTeam::reset which I can't seem to figure out at all.

Has anybody attempted reducing this yet? Is there something I should know? Is it even possible?

You changed MAX_PLAYERS or MAX_CIV_PLAYERS?

If you lowered MAX_PLAYERS, then you're going to have problems because it's assumed that MAX_PLAYERS is always one more than MAX_CIV_PLAYERS (due to Barbarians). I think it would be better to change MAX_CIV_PLAYERS instead, and all the others (MAX_CIV_TEAMS, MAX_PLAYERS, MAX_TEAMS, BARBARIAN_PLAYER, and BARBARIAN_TEAM) will follow because they are based on that define.
 
Ok, I just tried it out. I'm getting a ton of functions in CvInitCore.cpp that are being called with the player argument above what I had set for MAX_CIV_PLAYERS (which was 10). That tells me somewhere internally they're using their own number. That's just getting to the game-screen.

Afterwards, I also am getting CvTeam::reset being called with a number larger than the number I've set. I put a breakpoint in and had it skip that entire function, which worked fine (even though the throughout it all the exe was calling getTeam() on values higher than it, which meant it could have been calling any of the CvTeam member functions after it got the reference, but it never did). Unfortunately, it was calling CvPlayer functions after recieving the bad data from the static getPlayer() function.

I don't think this one's possible, not in Vanilla anyway. :sad:
 
Back
Top Bottom