Yes, it's fairly easy:Is there any way using Python to make a civilization win the game if they reach a certain population?
gc = CyGlobalContext()
if gc.getPlayer(<id>).getTotalPopulation() >= <required population>:
gc.getGame().setWinner(<id>, <victory type>)
def getNumCustomMapOptions():
# ...
def getCustomMapOptionName(args):
# ...
def getNumCustomMapOptionValues(args):
# ...
def getCustomMapOptionDescAt(args):
# ...
def getCustomMapOptionDefault(args):
# ...
Seems like you need to "hack" the exe rather than the DLL. The menu in question is inside the exe and I couldn't find any indication that the exe will ask python or the dll for graphics.If the Python API does not allow it I am also willing to "hack" this on the DLL level, but right now I do not know where to start.
Messing with the exe is usually where I draw the line, so I guess I will have to go without that feature. Thanks for looking into it!Seems like you need to "hack" the exe rather than the DLL. The menu in question is inside the exe and I couldn't find any indication that the exe will ask python or the dll for graphics.
There is no xml limit as such. The limit is that it's a 32 bit application.Do we have an - probably not clearly defined - upper limit for how many and large xml files, that can be processed on a somewhat old-fashioned Windows 7 64-bit machine with 8GB of memory?
That's the memory limit you have to deal with. Sure you can use less memory on xml files, but if you like, you can also use less memory on say CvPlot and that way reduce the overall memory usage. Reducing memory usage is generally a good thing, but it's the sum of many changes so it's non-trivial to achieve.I have added the 4GB-patch 1½year ago - it seems to work as intended.
That's presumably not an xml issue, but more like a C++/python issue. If say there is a function, which loops all techs to figure out some value, then adding more techs to xml will make that loop take longer. If you add a cache to CvPlayer with the value, then the game performance will be mostly unaffected by the number of xml entries, but then you have to code the whole code around the cache, including figuring out when to update it to ensure it's not out of date.Problem is, that I "feel" the game in certain situations is slower and maybe a bit more wobbly than it always have been.
about this one, you meant more cache items are slowing the speed? or indiffrent?If you add a cache to CvPlayer with the value
While I agree with this statement, I will say that I can't take credit for all good code in WTP. We are currently 4 skilled programmers working on the mod. If I am to point out something, which can easily be copied to BTS, then I will take this part, which is written by @devolutioni guess "we the people" contain tons of speed changes cause i know @Nightinggale did some amazing code work there.
float CvGlobals::getDefineFLOAT( const char * szName ) const
{
// the exe calls this functions fairly often, usually related to camera settings
// since reading this uncached is slow, use static floats to store the values between calls
// this way values are only read uncached once and responding to the exe over and over will take less CPU time
if (0 == strcmp(szName, "MINIMAP_PARABOLA_Y_INTERCEPT_PERCENT"))
{
static const float val = getDefineFLOATUncached("MINIMAP_PARABOLA_Y_INTERCEPT_PERCENT");
return val;
}
else if (0 == strcmp(szName, "SADDLE_PARABOLA_MIN_Y_PERCENT"))
{
static const float val = getDefineFLOATUncached("SADDLE_PARABOLA_MIN_Y_PERCENT");
return val;
}
else if (0 == strcmp(szName, "SADDLE_PARABOLA_MIN_X_PERCENT"))
{
static const float val = getDefineFLOATUncached("SADDLE_PARABOLA_MIN_X_PERCENT");
return val;
}
else if (0 == strcmp(szName, "SADDLE_PARABOLA_Y_INTERCEPT_PERCENT"))
{
static const float val = getDefineFLOATUncached("SADDLE_PARABOLA_Y_INTERCEPT_PERCENT");
return val;
}
else if (0 == strcmp(szName, "MINIMAP_PARABOLA_MIN_X_PERCENT"))
{
static const float val = getDefineFLOATUncached("MINIMAP_PARABOLA_MIN_X_PERCENT");
return val;
}
else if (0 == strcmp(szName, "MINIMAP_PARABOLA_MIN_Y_PERCENT"))
{
static const float val = getDefineFLOATUncached("MINIMAP_PARABOLA_MIN_Y_PERCENT");
return val;
}
else
{
return getDefineFLOATUncached(szName);
}
}
// vanilla getDefineFLOAT. Used when wanting to ignore the cache, like when setting the cache
float CvGlobals::getDefineFLOATUncached(const char * szName) const
{
float fReturn = 0;
GC.getDefinesVarSystem()->GetValue(szName, fReturn);
return fReturn;
}
No, what I wrote is this:about this one, you meant more cache items are slowing the speed? or indiffrent?
If we say loop all traits and add an int from each owned one to get a combined value, then we need to loop each time, hence making the game slower by adding more traits. If this is done once and then cached, reading the cache will be faster than looping, hence in that case "game performance will be mostly unaffected by the number of xml entries". That statement is only true if the cache is in place.If you add a cache to CvPlayer with the value, then the game performance will be mostly unaffected by the number of xml entries, but then you have to code the whole code around the cache, including figuring out when to update it to ensure it's not out of date.
When BTS was released this was done along with a patch to change the game balance which was required to accommodate the new things added as well as just generally "fix" game balance in aspects where the developers thought it needed doing.I noticed that in the vanilla version the planes have the same interception, but in BTS the interception of the planes is different
Vanilia
fighter - 50% Jet fighter - 70%
BTS:
fighter- 100% Jet fighter -100%
explain how it is
It's used by the AI when evaluating other players. iPower is added up from everything the player owns and if an AI player has much more power than another player, it will be more willing to attack. On other other hand if it is low on power, it is more likely to accept diplomatic demands.I'm sorry, can someone explain to me how the <iAsset> and <iPower> tags works? (BTW tags are in CIV4UnitInfos.xml)(is this important in the operation of AI)
Could it be that you are using a mod, which doesn't fix the bug where the diplomacy screen will not offer peace unless you are not at war?how to cause no one to make peace with each other