Super Forts

Where can I find the source code for this mod?

The mod comes with a folder called "ChangedSDKFiles" or something like that. That folder contains the source code. Just combine those files with the rest of the BTS source code files, and you will have the complete source code. I don't have a separate download for the source code.
 
hi red key,

i rly love ur mod, its a lot like an old mod named jcultural control, only much better.

ive been trying to add it to the kmod, but i had trouble with one file - unitai.cpp, any chance you help me with that?

ty very much in any case.

Hi keldath,

Could you describe the problem or post what sort of error message you are getting? I'll do what I can to answer questions, and hopefully by posting it here some others might help out too.
 
hi,

well,
as i wrote, im merging ur mod with karadocs kmod,

and all went well till i got to a part in the sdk - unitai.cpp,

there i got to a part that deals with bombards, karadoc changed the regular code into a new one, and i dont know how can i merge the lines of ur code with karadocs.

maybe i could upload the the file i wanna merge ur code into and u can take a look?
 
keldath,

Is the part that is hard to merge all in the same section/function? If it is all in the same function then please just copy & paste the kmod's code for the function inside some
Spoiler :
Code:
 tags.

If it is in more than one function then upload the unitai.cpp file from kmod, and I'll take a look. If you upload unitai.cpp then please tell me the name of the functions that are hard to merge, so I can know where to look.

BTW, do you know if there were any big changes to bombarding in kmod? or was only the AI for bombarding changed?
 
Everyone,

I added some ideas I had to make fort building have some costs/penalties associated with it in the third post of the thread under the heading of "Extra Tips". The ideas require you to change some XML values.
 
hey red key,

thank you for willing to help first of all, much appreciated.

ok,
i decided to upload the files them self's, since i think it will be a long post for you to read, better to see the difference with win merge i think.

the problematic sections:

in your files: its line - 10871 - 10936, also - 11059 , 11121, 11198, 16761.

in comparison to kmods line (same order) - 15505 - 15619 , 15765, 15846, 15924, 24362.

karadoc changed this function : bool CvUnitAI::AI_bombardCity()
and disabled this section - bool CvUnitAI::AI_goToTargetBarbCity(int iMaxPathTurns)

all the rest of files are an easy merge, and i didnt had trouble.

i really hope youll be able to help, that would be awesome,
for now ll try to merge you code without the fort bombard thingy, just because im bored, and probably wont succeed :)

thank you,
kel.
 

Attachments

  • CvUnitAI-sf.rar
    49.4 KB · Views: 134
  • CvUnitAI.rar
    92.7 KB · Views: 147
the problematic sections:

in your files: its line - 10871 - 10936, also - 11059 , 11121, 11198, 16761.

in comparison to kmods line (same order) - 15505 - 15619 , 15765, 15846, 15924, 24362.

karadoc changed this function : bool CvUnitAI::AI_bombardCity()
and disabled this section - bool CvUnitAI::AI_goToTargetBarbCity(int iMaxPathTurns)

First the easy ones, I'll use the line numbers from kmod.
15765 - Leave this alone and use what kmod already has
15846 - Leave this alone too
15924 - On line 15926 change pLoopPlot->isCity() to pLoopPlot->isCity(true)
24362 - On line 24360 change pLoopPlot->isCity() to pLoopPlot->isCity(true)

Also make sure line 15689 has pLoopPlot->isCity(true). All 3 of these are for the purpose of making the AI attack forts in a similar manner to cities.

Winmerge is doing a horrible job of matching things up on 15505 - 15619. It appears AI_pillageAroundCity was added in kmod, and winmerge matched it up with AI_bombardCity from SF. To help winmerge match up the functions better I copied and pasted the AI_pillageAroundCity function to the Super Forts code (right above AI_bombardCity). After doing that (and refreshing) winmerge matched up AI_bombardCity from both with each other.

Since AI_bombardCity (lines 15626 - 15664 of kmod) was completely rewritten in Kmod and calls some other functions that are do not exist in SF, I could not see a way to merge them without changing some of the Kmod code. The easiest solution would be to use AI_bombardCity from SF and not use the one from kmod.

I hope it works for you after all that. :)
 
Red Key,

wow thank you very very much for taking the time to do this, its very kind.

for now, i have compiled ur mod with kmod - without any of the defender and bombard codes, and it works :)

so i will try to work with what u wrote me, but if it wont work, at least i have most of the cool stuff you did.

i wanna thank you again,
i hope to see more cool things from ya :)

p.s
u never heard of jackels jculture control mod?
it adds 90% of the same work you created here in super forts, but by far you implemented it better.
 
Cruel, hi,

well, i want to publish the whole package, as a part of my overlord2 mod,

but i guess i could upload the sdk files, i also added a few more things:

upadted kmond 1.16
added mods:
jimprovement
free tech from building
city sizee prereq
better interception
civic specialist yields
influence driven war
dune wars city found value
movable mountains+dune editon
super forts
and fro revdcm - unit civic prereq, unit obsolete tech, and a few more xml tags.
 
Hi Red Key, thank you very much for this. I downloaded your Super Forts last year, in the beginning, I guess it was version 1 but I can't remember for sure because since I downloaded V 1.03 with the intention to implement it and deleted the previous version. As it happens, I haven't made any new change since because I fear it might be a bit too much trouble for Super-Super Forts (I don't want them to replace a city, to have too much cultural output, etc.).

At the same time, I implemented other components and it took me a while to realize that my workboats were not working properly any longer. I opened this thread for it: http://forums.civfanatics.com/showthread.php?t=451984

It seems that I have identified what was wrong and it might well be related to Super Forts. In CvUnitAI.cpp, CvUnitAI::AI_improveBonus, I have commented out your code starting after bIsConnected = pLoopPlot->isConnectedToCapital(getOwnerINLINE()); and now my workboats can be automated again!

I'm not a coder myself and I don't understand 75% of it so I don't know yet what I will miss with it but I wanted to let you know. Maybe it is something that you have corrected in a recent version, but I have not seen anybody reporting that.

Anyway, thank you again for an appreciated component.
 
It seems that I have identified what was wrong and it might well be related to Super Forts. In CvUnitAI.cpp, CvUnitAI::AI_improveBonus, I have commented out your code starting after bIsConnected = pLoopPlot->isConnectedToCapital(getOwnerINLINE()); and now my workboats can be automated again!

Hi isenchine. You are the first to report a problem with automated workboats. I never automate my workboats so I might have missed this when playing Super Forts. I will try it out in a game when I get time (hopefully tonight).

I did take a look at the section of code you say you commented out. I don't see how it would influence your workboats. The part you commented out should only influence workers and workboats when they are building outside of your borders. Like I said, I'll try it out in the actual game later, but the code looks fine from what I can tell.
 
Ok, there is definitely something wrong with automated workboats :(. Kudos to isenchine for reporting and narrowing down the bug. I will fix it and release a new version "soon". I realized I need to give more credit to those who have identified bugs, so I will mention those who have in the first post of this thread as contributors.:)
 
Ouf, I'm not completely crazy :crazyeye:!

Frankly, I don't think that you should give me credit for that. It's nothing compared to the work you have done on the code and it's a pleasure playing with Super Forts.

Although... the AI might overuse it but I think you addressed that issue in a recent version. Also, the stategy for the Forts is all based on resources and has little to do with military strategy. Of course, we can still use Forts to block a narrow passage for instance, but I don't think that the AI ever does it. This is not a criticism, since it was always like that in vanilla Civ4 and it should be quite difficult to teach it to the AI.
 
I really, really, REALLY like what you've done here! Awesome work!

(...now for the annoying part...a --tweak-- suggestion...)

I think forts actually projecting culture, and being capable of expanding borders beyond the single tile they occupy is a little over-powered. Why not just keep the revised fort's culture at one tile? That's still powerful enough to make forts at chokepoints an interesting, fun challenge.
 
Ouf, I'm not completely crazy :crazyeye:!
Although... the AI might overuse it but I think you addressed that issue in a recent version. Also, the stategy for the Forts is all based on resources and has little to do with military strategy. Of course, we can still use Forts to block a narrow passage for instance, but I don't think that the AI ever does it. This is not a criticism, since it was always like that in vanilla Civ4 and it should be quite difficult to teach it to the AI.

Yes, I didn't want to try teaching the AI to build forts at choke points or for canals. Does anyone know if one of the AI mods out there did? (like BetterAI or Kmod)

I think forts actually projecting culture, and being capable of expanding borders beyond the single tile they occupy is a little over-powered. Why not just keep the revised fort's culture at one tile? That's still powerful enough to make forts at chokepoints an interesting, fun challenge.

yturk, you can adjust the "culture range" of the forts in the XML. Go into Civ4ImprovementInfos.XML and find the group of XML values for the fort improvement. Then change the <iCultureRange>1</iCultureRange> to <iCultureRange>0</iCultureRange>. Then forts will only have borders in their tile. The XML settings I have are just a sample, so it is up to the users to adjust them how they want.

edit: Everyone, also see the extra tips I added in this post to prevent humans and AI from overusing forts. Since I have to fix a bug I think I will make some of the XML adjustments I mentioned in that post while I am at it. People can undo my XML changes if they don't like them, but I think I will make so building a fort uses up your worker. Similar to how building fishing boats uses up your workboat or building a city with a settler.
 
To prevent AI from overusing it I added a condition that forts cannot be built adjacent to another fort. At least for my scenario that prevented the cluttering that happened in a few places. I divide time between 2 mods so still haven't merged the latest version to test it but I intend to get to back to it soon!
 
To prevent AI from overusing it I added a condition that forts cannot be built adjacent to another fort. At least for my scenario that prevented the cluttering that happened in a few places. I divide time between 2 mods so still haven't merged the latest version to test it but I intend to get to back to it soon!

A good idea.:) At one time I was considering adding in an XML tag to determine the minimum distance between improvements of the same type. I think I will take this opportunity to add it in while I am fixing the automated workboat bug. I might not make building forts use up a worker the default XML setting, so I'm taking back what I said earlier. It will take some more thought.

If anyone else has found a bug in the Super Forts code please report it, so I can fix it in the next version.
 
If anyone else has found a bug in the Super Forts code please report it, so I can fix it in the next version.

Well, since you are at it... I've noticed that sometimes units stay "imprisoned" in the fort, they can't go out of it. Sometimes it happens immediately with the workers who have just built the fort and the only way out is to make them build an improvement over the fort.

I've also noticed strange behaviours with missionaries. On their itinerary they pass through a fort, have to exit by a different way, go back away and try again the same route for ever. Yes, it's very strange but sometimes units are stuck and there is only one way out. In the beginning, I was even wondering if there was a door on these forts :crazyeye:!

The problem is that it does not happen with all the forts. Some are doomed, maybe they transform themselves into evil dungeons :eek: !

Anybody else noticing something like that?
 
Top Bottom