Green modder has a question

privategeneral

Chieftain
Joined
Aug 28, 2014
Messages
8
Hello everyone. I am wondering if anyone knows how I might be able to change the population format so that each citizen/population number will represent a static number of (say 1000 people). I am also wondering how to change it so that each turn will be one year (maybe from the year 0 or 1000 BC). The idea will be to create a mod where the development of time and citizens is linear. I know that I may have to tweak things like unhappiness, city appearance, and food production., but I think I have a handle on balancing those things. Help?
 
To Whoward69 or anyone that sees this,
You've never heard from me before, sorry if this is random.. I am hoping you can answer a question for me though. Do you know where I would be able to find (and hopefully change) the real population figure that corresponds to the amount of citizens in Civ V? This is for a mod that I am working on -I would like each citizen (the pop # of a given city) to represent 2000 people. Is this hard-coded? I have looked everywhere I could think of and can't find it! I would really appreciate any help.
Thanks,
-Some dude you don't know
 
Moderator Action: I've moved this post here from the place you posted it. Please do not hijack old threads to ask a question you've already asked in the main C&C forum. I appreciate it's frustrating when you can't find the answer to your question, but that isn't the solution. Anyone who looks in that thread will look here too.
Please read the forum rules: http://forums.civfanatics.com/showthread.php?t=422889
 
Right then, modding hat on now. I can't help you with the population thing but can certainly help with the timescales. It's the gamespeed.xml that determines this. Below is my replacement file for Anno Domini. It's as simple as this: Monthly Increment is how many months pass between turns; Turns per Increment is how many turns you want at that level of monthly increment. So if Monthly Increment is 12 and number of turns is 1000, you can go from 4000 BC to 3000 BC one month at a time.

Code:
<GameData>
	<GameSpeed_Turns>
		<Delete GameSpeedType="GAMESPEED_QUICK"/>
		<Delete GameSpeedType="GAMESPEED_STANDARD"/>
		<Delete GameSpeedType="GAMESPEED_EPIC"/>
		<Delete GameSpeedType="GAMESPEED_MARATHON"/>

		<!-- 4000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_QUICK</GameSpeedType>
			<MonthIncrement>720</MonthIncrement>
			<TurnsPerIncrement>35</TurnsPerIncrement>
		</Row>
		<!-- 1900 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_QUICK</GameSpeedType>
			<MonthIncrement>180</MonthIncrement>
			<TurnsPerIncrement>130</TurnsPerIncrement>
		</Row>
		<!--- 50 A.D. -->
		<Row>
			<GameSpeedType>GAMESPEED_QUICK</GameSpeedType>
			<MonthIncrement>72</MonthIncrement>
			<TurnsPerIncrement>170</TurnsPerIncrement>
		</Row>
		<!--- 1070 A.D. -->

		<!-- 4000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>480</MonthIncrement>
			<TurnsPerIncrement>50</TurnsPerIncrement>
		</Row>
		<!-- 2000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>120</MonthIncrement>
			<TurnsPerIncrement>185</TurnsPerIncrement>
		</Row>
		<!--- 0 A.D. -->
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>60</MonthIncrement>
			<TurnsPerIncrement>235</TurnsPerIncrement>
		</Row>
		<!--- 1000 A.D. -->

		<!-- 4000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_EPIC</GameSpeedType>
			<MonthIncrement>320</MonthIncrement>
			<TurnsPerIncrement>75</TurnsPerIncrement>
		</Row>
		<!-- 2000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_EPIC</GameSpeedType>
			<MonthIncrement>80</MonthIncrement>
			<TurnsPerIncrement>270</TurnsPerIncrement>
		</Row>
		<!--- 0 A.D. -->
		<Row>
			<GameSpeedType>GAMESPEED_EPIC</GameSpeedType>
			<MonthIncrement>40</MonthIncrement>
			<TurnsPerIncrement>405</TurnsPerIncrement>
		</Row>
		<!--- 1250 A.D. -->

		<!-- 4000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
			<MonthIncrement>160</MonthIncrement>
			<TurnsPerIncrement>150</TurnsPerIncrement>
		</Row>
		<!-- 2000 B.C. -->
		<Row>
			<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
			<MonthIncrement>40</MonthIncrement>
			<TurnsPerIncrement>540</TurnsPerIncrement>
		</Row>
		<!--- 0 A.D. -->
		<Row>
			<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
			<MonthIncrement>20</MonthIncrement>
			<TurnsPerIncrement>810</TurnsPerIncrement>
		</Row>
		<!--- 1000 A.D. -->
	</GameSpeed_Turns>
</GameData>

To define the start year you'll need this little bit of SQL to set the start year at 1000BC:

Code:
UPDATE Defines	 SET Value = -1000	WHERE Name = 'START_YEAR';

Hope that all helps!
 
The magic conversion from citizens to "real population" is hard coded in the DLL as citizens ^ 2.8 * 1000. However, it is only used in one place - the demographics screen - so changing it is simply a case of providing your own version of that core file, with a modified GetPopulationValue() function.

For example, change

Code:
function GetPopulationValue( iPlayer )
    return Players[iPlayer]:GetRealPopulation();
end

to

Code:
function GetPopulationValue( iPlayer )
    return Players[iPlayer]:GetTotalPopulation() * 1000;
end
 
Rob,
Thanks for that! Apologies for my faux pax regarding entries...
(not too savvy with this stuff)..
 
Thanks a lot for the response! I believe CvGameCoreDLLFinal Release.dll is the file I need to alter? Do you know an application that can do it? I have searched and had no luck! I really appreciate the help!
P.G.
 
nevermind whoward69
!! just saw your tutorial on dll... so I am going to try the steps outlined there and see if I can do it..
 
...I've been able to do a build! Changed the population (made each citizen 5000, and the growth linear(in an xml)).. Now I am going to work on the rest of the mod, lot of ideas. I want each turn to be a year (game would go from 500b.c. or something) I guess the next thing will be to make all growth and production (science, shields, culture) linear also, so that its balanced of course. Anybody have an idea where the military unit demographic equation is? I am assuming it is another dll..
 
I suspect this is not a difficult one but I have not been able to find it. Does anyone know how I can change the city size (in game graphics) to grow at different population numbers? e.g. go from a small city to a medium city at population 10 instead of 3... I figured out how to make a somewhat similar change in Civ IV but alas -Civ V does not seem to have the same tag in GlobalDefines...
A couple more:
-is there a limit to how many specialist slots can be applied to a given building? and
-can I amend resources so that they need to be worked to give their benefits (including tradability)? As it is now a luxury (for example) will show up in the trade screen even if you don't have a citizen working it!
I am hoping to make a mod that would include these changes..
 
Top Bottom