Discussion in 'Civ4 - Mod Components' started by Red Key, Oct 25, 2011.
Enjoy it Red_Key your project plan is great. There's no hurry because Civ5 development is kinda dead and the people on Civ4 are the pure love modders still working on the last truly completed and matured version of civ. They all know how much work it is to be a modder.....
That said it is a joy to see the AI doing what you want it to! Totally agree that the AI is really difficult to unravel. The AI code can be comprehended, but it's so interconnected that it get's hard to trace cause from effect and remember all the interrelationships. What I used to do was to make a flowchart of what is going on in the AI just in the area concerned. But if you are managing to extract any useful behaviour out of the AI that is a really good effort.
The beauty of what you are doing is building a concise single themed mod component which is holistic because it includes the AI code (even if it is not perfect it still contains all the ideas in one mod component). In some respects I wish that we modders used this approach for Civ5 if the code were ever released for it.
Awesome, Can't wait to try this out! I have an idea that I have been toying around on paper with but can't seem to figure out how to go about getting it to work.
I would like to see a fort or even a new pre-built structure beable to produce units and build military type buildings. Such as a barracks, air defense, Air field, etc. And only allowing Cities to build non military units.
And going away from easy here, have a new civilian unit type that is created in a city and is added into a fort / base / air-field / naval port to work tiles to create production, coin, etc. to produce the units and fort/base structures.
Anyway... can't wait to get this in my game and MOD! Thanks for this!!!
Also, can you create a DLL file that is compatible with the bull mod the BaT mod, if yours isn't already. I pretty sure I use the Bull DLL in my mod, there may be some other of sdk files that would need merged also... I will take a look this coming week. Again thanks for this great mod already.
Just want to make a quick point that I think Super Forts is best off left as a clean build which makes changes relative to the base vanilla code. Just my own 2 cents worth.
Sorry Spanky, but if you need this mod to work with another mod such as Bull, you will have to do the merging yourself. All of the SDK files I have changed are provided with my mod, and the reason I provided them was so others could merge this mod with whatever they wanted.
Making forts or other structures produce units is an interesting idea. I'm not going to try doing it though. You're welcome to implement it on top of Super Forts in your own mod if you want. Good luck!
P.S. Just a little more testing and a new <bBombardable> XML tag I decided to add in, and version 1.00 will be done. The way I extended fort borders seems to be working well so far, but I want to test it under some more conditions. Should be done in the next 2-3 days because I can't get to it today.
Yea, I merged it all the files except the DLL which is the bigger problem for me, no worries. I have noticed when razing cities that you will keep LOS, the 9 squares around city center, from the city you raised and once you have left the area.
I am looking into the idea of unit production out side of cities. It will most likely take a large dll changes though, something I am not familiar with.
Thank you for finding that bug with razing cities Spanky. I tested it out and the same thing seems to occur when razing forts and possibly other improvements as well. I believe I know where the problem lies, and I will try to fix it before releasing the new version. This may delay the release a couple days, but I have finished testing everything else so once this bug is fixed the new version should be ready.
If anyone else has found a bug please leave a message on this thread.
Concerning merging, I have not merged myself, but I was under the impression there was no way to directly merge two DLLs. Spanky, I believe you have to merge the .h and .cpp files of the two mods and compile a new DLL. If this is not the case, then I would appreciate being corrected and learning something new.
Announcing Version 1.0!
As promised Version 1.00 is finally here!
I will soon update the first post in the thread with the things added but the major ones are these three XML tags in ImprovementInfos:
<iCultureRange> - Determines the range of an improvement's cultural influence. If the improvement acts as a city, then this is the range of its borders. An improvement with <iCulture> will add culture to all plots within its range, but only one that <bActsAsCity> will extend borders.
<bBombardable> - Now any improvement can be bombardable or not. An improvement will be bombardable if this is set to 1, and it has a defense modifier.
<bUpgradeRequiresFortify> - Make improvements upgrade by fortify-ing their plot with units instead of being worked by a city. Note: no improvements currently have this active in the XML, but I did test it and then deactivate it again.
I believe you are correct on needing to recompile the DLL but again, I do not know much about it. I have comepletely rewrote my mod anyway and was about to merge your superforts again when I noticed you updated it. Your welcome on finding the bug. Super Forts makes a great addition to my mod.
Now, I have also noticed that the AI loves placing forts everywhere now... usually unprotected too!
I think you have posted that if a Unit is stationed in the fort then it can't be culture flipped, correct?
If so, how can I implement that a fort loses it's culture after x amount of turns if a unit is not stationed at the fort, forcing a player/AI to "Control" the fort? Of course this would mean out side of a cities influence radius in contested lands.
Yes the AI does do that. In version 0.91 I changed the AI for building improvements, so that the AI would build forts outside their borders to take control of resources. At that time I also started looking at the code to see how to make the AI better defend and attack forts, but I decided to put it off until later...
Now that version 1.00 is out, later has come. My highest priority now is to make the AI better defend and attack forts. So the AI's forts will be better protected in the next version.
What you described above would take some SDK changes. The changes could all be done in CvPlot.cpp. You would have to add a variable to keep track of the amount of turns a unit had not been stationed there. If the variable became greater than x, then you would use the setOwner() function to set the plot's owner to NO_PLAYER. This check could be put in the doCulture() function which is where the game checks for fort and city culture flips.
It might also be possible to do it with python, but I prefer the SDK and am unfamiliar with python.
Edit: You might not need this anymore after I update the AI because the AI should keep a unit in each of their forts. Unless you want it for human players.
Hi, Red Key and others. Is here, please somebody, who can implement this mod to mY library?
thanks for answer
PS: maybe better wait new version but I cannot hardly wait to...
Adding this setting and maybe making it game option would be nice but I think that would be a python change, I am not sure. I am will look into it and think about it adding something like that to your mod for my mod.
Are you talking about adding it to your main game or adding as a mod where you have to select the mod and then play?
Hi, Sir Spanky. I have on mind adding SDK components to the my gamecorelibrary what I have in my HrochMod. Xml and python I hope can add oneself
If all you need is the SDK components and you aren't going to modify the SDK, then copy CvGameCoreDLL.dll from the Assets folder to your mod's Assets folder. You should also copy CIV4TerrainSchema.xml from the Assets/XML/Terrain folder to your mod's own copy of those folders. Also in Assets/XML/Terrain is CIV4ImprovementInfos.xml. You should copy this file to your mod, and modify it to the settings you want for improvements in your mod.
If you want to mod the SDK, then I recommend the tutorials here: http://modiki.civfanatics.com/index.php/Civ4_SDK. If you need to combine the SDK changes of this mod with another mod that has made SDK changes, then there is no way to merge them without modding the SDK.
Let me know how it goes. If you get it working in python, then I'm sure anyone else who wants this option would greatly appreciate it if you made your python files available.
Hi. Thank you very much for answer. I have tried it already. It is, why I write here my courteous request. Programing is not for my head. My bussines are models.
Can somebode help me, please?
Will do Red but right now I am getting a strange xml error in my mod in a file that isn't even in my mod!
I believe there is a call or a function missing in something I merged...
Luckily, it isn't from Super Forts.
Hrochland, I am not really familiar with the Library as I have just started modding but I will try to help you out, my modding is without the SDK at this time... Also, you do models? I could use new models for new units
Separate names with a comma.