Quick Modding Questions Thread

While this is completely untested, it should do what you ask for. Well sort of. It has -25% production requirements. You could set it to return 80, which would be -20% requirements, which is the same as +25% production if you ignore the rounding errors.

Not really the same, but more or less. Reducing production cost itself = cheaper to hurry (Less gold, less population to sacrifice, less forests chopped), while increasing production pace has no effect on it.

It also gets escalated by other production modifiers.
For a 1000 cost, double production by marble, 100 normal rate:

Usual:
1000 / 200 = 5 turns

+25% production:
1000 / 225 = 5 turns

-20% cost
800 / 200 = 4 turns
 
i must say that Archid is software engineer which have more than 15 years of experience in IT (sorry if i miss or said some wrong info), that is man which really know what he does.
It's not like Archid is the only engineer in the world... or even in this thread
smiley-face-whistle-2.gif


i was asked this because i don't have vision how that all works, lots of units and buildings with lots of orders and their attributes (health, speed, supplies, type, building time and etc), and because i was think maybe they use threads as help or synchronization for all that entire actions.
Thread sync is not that kind of sync. You sync you want to do is to compare objects with each other inside a single thread, just like civ4 is doing it. In fact I think you just confuse yourself by using the word sync as it will go into keeping multiple hardware instances in sync, such as two threads or a network game. This mean if you google "c# sync" (or similar), you will likely end up with text totally unrelated to what you want to do.
 
Not really the same, but more or less. Reducing production cost itself = cheaper to hurry (Less gold, less population to sacrifice, less forests chopped), while increasing production pace has no effect on it.
Good point. I didn't think of that. Still seems to be the closest thing possible without dll modifications.

It also gets escalated by other production modifiers.
For a 1000 cost, double production by marble, 100 normal rate:

Usual:
1000 / 200 = 5 turns

+25% production:
1000 / 225 = 5 turns

-20% cost
800 / 200 = 4 turns
25% of 200 is 50, not 25. That would make +25% production:
1000 / 250 = 4 turns


EDIT: oh wait. Forgot I modded the modifier implementation. Vanilla adds them, not multiply as real math would indicate you should do. You are right. This is another way to not make the two changes interchangable.

You can find numbers where it will not end up with the same number of turns. This is what I referred to as rounding errors. Pure math would result in the same numbers, but the game makes the calculations in ints, which causes rounding errors. The game doesn't use floating points because... I'm not going to explain the technical reason here. You need ints here for keeping network games in sync.
 
The 2nd point isn't really about rounding errors. It is more about the addition vs multiplication of multiple multipliers as you realised.

Instead of 1000 cost, using 10000 will make it more obvious.

Usual: 50 turns
+25% modifier: 45 turns
-20% cost: 40 turns

In both cases (hurry cost & multiple multipliers) a -20% cost is more beneficial than +25% modifier.
 
It's not like Archid is the only engineer in the world... or even in this thread
smiley-face-whistle-2.gif

Oh sorry if i insult you. That is true, i know for Archid, but don't know for others who is who. For example Platy is from Singapore (if i can remember, maybe i miss) and i know and we know that he excellent know python, but how long he work in IT i don't know. Similar is for you, i know that you help me many times in my problems on forum, but i don't know that you are software engineer too, and i don't know how long you work in IT. Sorry if i insult someone. And thanks everyone for help again.

Thread sync is not that kind of sync. You sync you want to do is to compare objects with each other inside a single thread, just like civ4 is doing it. In fact I think you just confuse yourself by using the word sync as it will go into keeping multiple hardware instances in sync, such as two threads or a network game. This mean if you google "c# sync" (or similar), you will likely end up with text totally unrelated to what you want to do.

Yes.

Question:
Is there some solution for additional barbarians civilization in game, or too use Platy's solution ?
 
Question:
Is there some solution for additional barbarians civilization in game, or too use Platy's solution ?

It seems to me that Platy's solution is the only valid one.

If you're in doubt, try to check the dll code of FfH2. Or start a game, save it in WB and check the Barbarian Civs in the WBS file. They are probably just another Civ with perhaps some different coding in the dll.

One City = one Civ seems a nice idea but it is impracticable as you would soon reach the limit of Civs.

I quote EmbryoDead here:
Spoiler :
There's a hard limit of 62 players, not counting Barbarian player. If you put more in the DLL, the EXE crashes.

If you're just playing on random maps, that's it. However, there's another limit of 52 leaders (not players) in a WBSave (i.e. a pre-made map/scenario). Putting more than 52 leaders in a WBSave crashes the civ/leader selection screen, which is also hard-coded in the EXE. There's a workaround, however - assign the same, dummy leader to every player in WBSave, so that the selection screen doesn't crash; once the game starts, re-assign proper leaders with Python.

It is possible to add new players, split kingdoms etc. re-using player slots - Civ4 has this functionality already, i.e. for creating colonial vassals.

The problem of a minor Civ taking over cities is that they might end up with a big Empire scattered all over the world and their actions will be crippled by a weak economy.
 
i don't know that you are software engineer too
Technically speaking, I'm not a software engineer. I'm an electrical engineer with focus on digital electronics. However I decided to take quite a number of handpicked classes with the CS students. Handpicked means classes useful for embedded software. This mean C/C++, understanding compilers and theory for code optimization. Luckily this "software engineer subset" matches DLL modding perfectly. Making good use of hardware knowledge is a bit more difficult while modding, but understanding the CPU does come in handy when trying to design/code efficient code. Engineers are also trained in the art of gathering new knowledge for new tasks, which is also quite handy. For instance I had never seen python before modding, but I never considered that a problem.

Sorry if i insult someone.
You did something far worse than forgetting what I told you. You were ignorant of something, I didn't tell you. You of all people should really have done better than that :p:lol:

I intentionally didn't talk about this when I first showed up. Not knowing the modding community, I had no idea what would happen if I just showed up announcing "Hi. I'm an engineer. I fixed my first network desync in a game even before civ4 was released". I feared being labeled a smartass and being frozen out, if not downright kicked out since I have encountered more than one world champion, who is the smartest programmer on the planet. The problem with such people is everybody else tend to be too stupid to touch the code and it never ends well if somebody says something, which offends them. I haven't seen signs of anybody like that here, but I'm still not sure it would be the right introduction.

Now I figured I might as well tell it since the topic of engineers came up. It's not like it will change a whole lot now. The only thing, which can happen would be people wanting me to help with dll problems and that's not really different from how it was yesterday.
 
Is it possible to get cities to be renamed through python?

Like this: Indraprastha->Delhi (1200 AD)->Shahjahanabad (1600 AD)

Or perhaps through cpnquest by another civ, let's say if Indraprastha is conquered by the Mughal Empire, it is renamed Shahjahanabad.
 
PHP:
.def("getName", &CyCity::getName, "string () - city name")
.def("getNameForm", &CyCity::getNameForm, "string () - city name")
.def("getNameKey", &CyCity::getNameKey, "string () - city name")
.def("setName", &CyCity::setName, "void (TCHAR szNewValue, bool bFound) - sets the name to szNewValue")
Python exposed city member functions regarding the name. This mean the python code should be something like
PHP:
pCity.setName("NewName", False)
The question is where to write this line. A good candidate would be a callback for conquering a city, but I can't find anything, which could be used like that.
 
I don't work in IT and neither am I an engineer.
Though I do have an engineering degree, and took simple c/c++ course during uni days.

I am never trained in python, so similar to Night, it is the first time playing with it when I start modding.
 
@Nightinggale
Well, I don't know anything about python so I can't help devising a code. I really hope we can find something because I wouldn't like seeing the Mughals have "Indraprastha" as capital and having a lot of ancient cities instead of their more modern names.

Also:Can someone help me with my "religious problem", because I'd really like to continue work on my mod, but I can't because of that problem.
 
Can someone help me with my "religious problem", because I'd really like to continue work on my mod, but I can't because of that problem.
You should switch to Christianity. There is nothing in the bible to ban modding. Maybe the order not to work on Sundays, but that's about it.

If you talk about the founding of religions at the wrong date, then I have no idea. I think I will write a step by step guide on how to set up git. If I do that, then I can just fetch the mod from git and look for myself how it goes wrong. Half of the "this doesn't work" posts fail to provide the information needed to fix the problem, partly because the problem is caused by a (for the poster) unknown error.
 
You should switch to Christianity. There is nothing in the bible to ban modding. Maybe the order not to work on Sundays, but that's about it.
Haha
If you talk about the founding of religions at the wrong date, then I have no idea. I think I will write a step by step guide on how to set up git. If I do that, then I can just fetch the mod from git and look for myself how it goes wrong. Half of the "this doesn't work" posts fail to provide the information needed to fix the problem, partly because the problem is caused by a (for the poster) unknown error.
Git? So the whole mod should be upload there?
 
Python exposed city member functions regarding the name. This mean the python code should be something like
PHP:
pCity.setName("NewName", False)
The question is where to write this line. A good candidate would be a callback for conquering a city, but I can't find anything, which could be used like that.

I dont have the code in front of me but there is a python function called onCityAcquiredandKept (or something along those lines). That is where you would change the city name.
 
Great, so could someone create such a code for me?
Also:Could someone recompile this DLL so that it allows 77 civs?
 
How do I replace the background for an existing leaderhead?
 
Change the dds file in the LH art folder with a program that can edit it, the file goes something like "LEADERNAME_BG.dds" or something like that.
 
Quick question:
Can someone explain me this line of code, i really try to understand, but i can't see how and from were get value.
Code:
if (GC.getGameINLINE().getSorenRandNum(GC.getDefineINT("SURVIVES_SINKING_PROBABILITY"), "Unit Survives Drowning") == 0 )

From Python API:
INT getDefineINT (STRING szName)
description: int ( string szName )

INT getSorenRandNum (INT iNum, STRING pszLog)

Which value will return GC.getDefineINT("SURVIVES_SINKING_PROBABILITY") ?
 
Back
Top Bottom