Mod request: city state map quantity

PYITE

Prince
Joined
Dec 14, 2016
Messages
396
Looking for a mod that will allow me to choose how many city states are on the map. Haven't been able to find one. Don't know if this is possible with current tools.
 
it's not impossible, but not really easy to code in a clean way.

ATM the number of CS is hardcoded to be the number of selected major civilizations on the setup screens multiplied by 1.5

You can lower that number by editing the function to assign starting position and giving CS less starting positions than 1,5*civs

But to raise it while keeping a fixed number of civs, you need to find a way to force the setup screen to launch the game with more civs than requested by the player (so forced number of civs * 1.5 = number of wanted CS) then, still editing the assign starting position function, provide only starting positions to the real number of requested civilizations...
 
it's not impossible, but not really easy to code in a clean way.

ATM the number of CS is hardcoded to be the number of selected major civilizations on the setup screens multiplied by 1.5

You can lower that number by editing the function to assign starting position and giving CS less starting positions than 1,5*civs

But to raise it while keeping a fixed number of civs, you need to find a way to force the setup screen to launch the game with more civs than requested by the player (so forced number of civs * 1.5 = number of wanted CS) then, still editing the assign starting position function, provide only starting positions to the real number of requested civilizations...

Where do I find the function that assigns starting positions? I'm less than novice at modding, can you please give a brief walk through of how to make the change. If to involved to explain than don't worry about it. I'm assuming I just need to adjust the values of 1,5*civs in the code, but I don't where or how to find it.
 
But to raise it while keeping a fixed number of civs, you need to find a way to force the setup screen to launch the game with more civs than requested by the player (so forced number of civs * 1.5 = number of wanted CS) then, still editing the assign starting position function, provide only starting positions to the real number of requested civilizations...

Can this be done via a lua script? Does it need to be a multiplier, as in just setting "Put 10 civs on this map"?

I'm curious if this can be done now (hopefully the SDK will make it doable/easier), because I tend to play on my Larger Maps on Monstrous size, but generally only with 4-7 civs (I like to spread out), but I'd LOVE to have more city states romping around the map.
 
Where do I find the function that assigns starting positions? I'm less than novice at modding, can you please give a brief walk through of how to make the change. If to involved to explain than don't worry about it. I'm assuming I just need to adjust the values of 1,5*civs in the code, but I don't where or how to find it.

PYITE, I've adjusted the value of the 1.5 city states to major civs on a map ratio to 2:1 on my copy of Civ VI and can definitively say that it is hardcoded to be only 1.5 city states for every major civ in a map. I found that the change had no effect whatsoever on how many city states were spawned on a new map (for the record I always have 8 major civs including myself in a game which always produces a grand total of 12 city states on the map). This is clearly not going to be something that can be in any way changed easily without the release of the Civ VI Software Development Kit and other official mod tools by 2k/Firaxis to allow the hardcoded stuff to be accessible. Sorry if this isn't what you wanted to hear, I too want to increase the number of city states spawned on a map myself but its clearly just not possible currently.
 
Where do I find the function that assigns starting positions? I'm less than novice at modding, can you please give a brief walk through of how to make the change. If to involved to explain than don't worry about it. I'm assuming I just need to adjust the values of 1,5*civs in the code, but I don't where or how to find it.
it's not that easy.

the *1.5 is hardcoded, when you launch a game the slots for civilizations and CS are reserved this way, AFAIK there is no possibility to change that using a mods.

but if you really want it, we can hook/hack assign starting plots to use less slots that the game has opened.

let's take an example, you select 10 civs on the setup screen, the game will launch with 10 slots reserved for majors civs and 15 for CS.

we can't open more slots in assignstartingplot (well, maybe we can using the playerconfigurations functions, but I've not tried because I suppose they will fail those far in the game's initialization) but we can make sure less are used.

in my example above, you could for example only set 5 starting positions for the majors and still 15 for CS.

or keep 10 majors and only place 5 CS

Now the maximum number of "players" (majors + CS) is 62, which means the maximum slots we can reserve for CS using this hack is 37 (open 25 majors civs slots in setting, the game will reserve 25*1.5 = 37 slots for CS and 25+37 = 62)

So if you want to play with (for example) 5 major civs and 25 CS, you'll have to edit AssignStartingPlots.lua (search it in the game's installation folder) this way:

search for
Code:
    self.iNumMajorCivs = PlayerManager.GetAliveMajorsCount();
    self.iNumMinorCivs = PlayerManager.GetAliveMinorsCount();

and replace it with
Code:
    self.iNumMajorCivs = 5;
    self.iNumMinorCivs = 25;

save, then launch a game but don't forget to open 17 civilizations slots in the advanced setup screen

with the change above, only the 5 first civilizations of the 17 slots opened should be be in game, with 25 CS (17*1.5 = 25.5)

you may have to edit the map size to allow enough major civilizations slots for the higher number or if you want a high number of CS on a small map, and the game may fail to place all CS if the map is too small for the requested number.
 
Top Bottom