Increasing AI opponents past 22?

yes, it's on steam.
 
thanks dude:) one more question and sorry for troubling, any idea when it will be possible to the amount of civs to be increased and not just be restricted to the YNAEMP Maps?
 
thanks dude:) one more question and sorry for troubling, any idea when it will be possible to the amount of civs to be increased and not just be restricted to the YNAEMP Maps?

I've been playing with MAX_MAJOR_CIVS today, and it is a big steaming pile of ****

Let's say you increase it from 22 to 34 and fix the CvStartPositioner code (way back in the first few posts). Start a game with 30 civs and 24 City States and it will crash. Why? Because the code that sets up the City States (which as it's not in the game core DLL must be in one of the other DLLs or the EXE) is still using 22 for the major civs limit so it places the City States into slots 22 to 45. Now when the game core DLL comes to read those values it starts at 34, gets all the way to 45 OK, then tries to read slot 46 (which should be CS 13) and promptly crashes due to a null pointer.

So far I've found three places in the game core DLL where this is a problem - they are all fixable - but there may be more (or similar) buried in the more obscure (and hence less often executed) code - all just waiting to cause CTDs in the middle of a game.

Even if you fix those three places in the C++, you still can't start a game from a map script as the Lua has assumptions too. The same region sub-dividing code from CvStartPositioner is in the Lua map generators, so any map that only has one main area (pangea, and I suspect ones like east/west, amazon, etc) will fail to execute and you will die on turn 0. Pick something like Continents and although the game will start, you will find it very hard as the resource allocation routines fail for more than 24 major civs - Firaxis actually commented this! - so you will have no luxuries or strategics on the map; nor City States as they depend on the resource placement so their initial settlers never get placed.

There are also a large number of tests within the map scripts that check for no more than 22 civs in a region - so even if the central dividing code is fixed you still have to edit almost every main map script file to change all the 22's to GameDefines.MAX_MAJOR_CIVS - you've just got to wonder about the professionalism of using all these hard-coded values!

All probably fixable, but the map generation Lua is all such a pile of poorly coded c*** I'm rapidly losing the will to live just by looking at it.
 
Progress over lunch, rewrote the region splitting code to work all the way up to 80 majors (and probably beyond, but that's the absolute in-game limit)

Pangea now starts with more than 22 majors (30 in the example below) - still no lux/strategic resources or city states, but hey it's not bad for an hour!

attachment.php


EDIT: I now have City States being placed :) but still no resources :(
 
I spy with my little eye ...

... City States
... Luxuries
... Strategics
... Natural Wonders
... Goody Huts
... Ice!

EDIT: Destruction testing! 34 majors + 29 minors (my GPU does not smell good at the moment, so I'm going to take a break!)

attachment.php
 
EDIT: zipped dll has been removed as it is no longer compatible with the latest version 1.0.3.142

Should work for any .civ5map file and most map scripts.

Does NOT work with the following map scripts
- Great_Plains.lua (redefines AssignLuxuryRoles() method)
- Great_Plains_XP.lua (redefines AssignLuxuryRoles() method)
- Amazon.lua (redefines AssignLuxuryRoles() method)
- Amazon_XP.lua (redefines AssignLuxuryRoles() method)
- Frontier.lua (checks for 22 civs)
- Hemispheres.lua (checks for 22 civs)
- Skirmish.lua (checks for 22 civs)
- West_vs_East.lua (checks for 22 civs)
also doesn't work if you enable the in-game tutorial system (as tutorial 5 assumes that the first City State is in slot 22)

Really DON'T recommend using 34 civs with 29 city states unless you have a top end spec'ed desktop and high quality graphics card. If you fry your GPU using this DLL that's your problem not mine!

If you download my "DLL - Various Mod Components", "Maps - Improved CS Luxuries" and "Maps - Improved Small Landmasses" mods you can unzip the three files attached over the ones in those mods and not need to backup the core game copies.

The DLL will not work with any map script unless you also installed the corrected/attached AssignStartingPlots.lua file - you therefore cannot use any other mod that also includes a changed version of that file.
The changes to AdvancedSetup.lua are optional, they just stop you setting City States to a value greater than 29 (doing so will crash the game)

Missing leader head screens (they will be all grey) indicate that your PC has run out of memory and are not a DLL issue.

If you get weird starting locations (no resources, no obvious City States, no goody huts, no ice floes, etc) or "instant death", please attach your lua.log file - especially the first few hundred lines that start "[timestamp] Map Script:"

If you get past turn 10 without errors, any subsequent errors are probably memory/heat related and not a direct problem with the game setup changes within these files.

Enjoy!
 
Awesome dude:D One more thing I know its a bit much, but can the major civ amount go higher?:P To about 45? with minor civs at about 29 (Mentioned previous post that it cn go up to higher so will be awesome) want to try and push it to it limit and see how far it can go, daunting coz i love my graphics card but why not lol:D

This is a noob question kind of I never messed around with the DLL, where would I be able to adjust it? and how?

Anyway Thanks though for the effort:D
 
can the major civ amount go higher?
In theory to 62 (64 less one City State less the Barbie player)

I never messed around with the DLL, where would I be able to adjust it? and how?

It's in CvDLLUtilDefines.h (but you can't just change the value without fixing the bugs in CvPreGame.cpp as well) then you'd need to recompile the DLL

Probably best to stick with 34 civs for the time being - more than enough to cook your GPU ;)
 
If you get weird starting locations (no resources, no obvious City States, no goody huts, no ice floes, etc) or "instant death", please attach your lua.log file - especially the first few hundred lines that start "[timestamp] Map Script:"

If you get past turn 10 without errors, any subsequent errors are probably memory/heat related and not a direct problem with the game setup changes within these files.
What if I don't even get past turn 10 and the game crashes? Even with just 22 civilisations (and no city states), it crashes like a drunk narcoleptic driver. Different maps, minimum screen resolution, nothing seems to help it.

Ideas?

Edit: By the way, it's first time I change anything - I don't even use mods.
 
CvGameCoreSource\CvGameCoreDLLUtil\include\CvDLLUtilsDefines.h


is this in the steamapps\common\Civ5 directory? Because if so, it's not there for me. I have CvLocalizationWin32Final Release, CvGameDatabaseWin32Final Realease, and CvGameCoreDLLFinal Release, then a bunch of other files but not the one you said. :confused:
 
is this in the steamapps\common\Civ5 directory?

No, as per the other thread I pointed you to, it's part of the DLL source code, so is in the SDK (C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V SDK)
 
Back
Top Bottom