Better AI with more than 18 civs?

It would be an interesting project to make a Civ4 DLL that allowed a variable number of players.

Medium Hard:
Have it read a file or configuration variable somewhere that says how many players there are. Change all of the fixed-sized arrays to variable-sized buffers based on that value.

Downside: Lots of grunt work, and your DLL no longer matches the standard source tree.

Harder solution: Find a place to shove some extra data, saying how many players there are, early in the file stream. Read that early on to set the number of players, then go from there.

Downside: Same grunt work. Loading a new file takes lots of special care, as you might change player count.

Of course, the really easy solution to this is to get a compiler, download the betterAI source, change the number of players constant, and compile it yourself. Considering that the really easy solution is beyond most people, the above difficulties should be taken with a grain of salt.
 
Of course, the really easy solution to this is to get a compiler, download the betterAI source, change the number of players constant, and compile it yourself. Considering that the really easy solution is beyond most people, the above difficulties should be taken with a grain of salt.

Yeah, I actually looked into doing it myself but when I went into the betterAI source the file that needs to be modified to allow more civs (i forget what it is) is not present. Would this mean that I just need to get that file from the Civ BTS SDK, modify the 1 line, add it to the source code and compile?

I've never modded outside of XML tweaks before, so I also don't have the tools needed to compile...

I think all that would need to be done is to go into (that certain file) and change the MAX_ALLOWED_PLAYERS (or whatever it is) to 40 or something, is that correct?

Any chance you feel like playing Better AI with more than 18 civs?
 
Quoting my response about this from another mod discussion:
It's hardcoded in the SDK. Look for this line in CvDefines.h and change it to whatever you wish (scroll to the right because there are a bunch of tabs):
Code:
#ifdef _USRDLL
#define MAX_CIV_PLAYERS												(18)
#else
It's a simple change, but will require a complete rebuild.

In terms of Better AI, if the source only includes modified files then start with the Official 3.17 as a base, copy the BetterAI modified source into that directory, change the define to however many players you want, and do a full build. (I've only ever compiled BetterAI from the SVN repository which does include all the files.)

If you've never compiled an SDK and want to learn how, the two main environments used are CodeBlocks see (tutorial from Kael) and Visual Studio (see tutorial from Chazcon and/or Refar's PDF)
 
Since I've gotten other requests about this and it literally only takes 15 minutes to compile, "test", and post, attached is a max 50-civ non-debug DLL of BetterAI v0.45A (Revision 403). The only testing I did was to make sure it loaded a previous unofficial patch 50-civ save I had laying around. Note that saves from 50-civ games and saves from 18-civ games are incompatible. Also note that the attachment will be removed at some point when I either need the space or the version becomes woefully outdated. ;)
 

Attachments

Dresden - (or anyone who knows.....)

What I'd like to do is create a mod that would autofill all 50 civs individually (no dupes) that would appear on a random map each time i started the game.

Possible?

Where/How?

Sarge:gp:
 
Well for one thing you'd need to define at least 50 civs; there are more than 50 leaders in the original game but only 34 actual civs. You'll probably also want to edit whatever map size you'll be using to default to 50 players; this might screw with some of the quest events but it's better than having to manually add them every time and the quests can be fixed in Python. Hopefully, the random civ picker is smart enough to not reuse civs unless it is forced to and so that will be enough. If not... you'll have to cross that bridge when you come to it. ;)
 
Back
Top Bottom