PPQ_Purple
Purple Cube
- Joined
- Oct 11, 2008
- Messages
- 5,436
I was basically worried that I might end up in a situation where the AI just does nothing but sits around mindlessly not even teching up because I didn't fill out some file or something.
Normally, but there are some exceptions, e.g. giving value to workers will cause all sorts of issues, CTD IIRC. You can ask the C2C crew about it.Normally if XML tags exist, AI was already taught how to handle possible settings then. So there should be no need to adjust AI logic in the DLL if you balance reasonably.
As I said, normally only if you want to program really new game mechanics you need to worry about adjusting AI logic - otherwise it is in most cases just (reasonable) XML balancing.
That is a Civ4BTS specific issue then.e.g. giving value to workers will cause all sorts of issues, CTD IIRC
Unless the issue comes from a difference in the EXE. I don't know what's the exact cause of the issue but IIRC the C2C crew didn't fix it, though they have programmers too.That is a Civ4BTS specific issue then.
(Since I do not mod Civ4BTS I know nothing about it.)
In Civ4Col that issue definitely does not exist.
(Every single Unit has at least iCombat of 1 in our mod.)
Also if this is the case it should be pretty easy to fix the code if it was already analyzed and the issue is as clear as you describe.
(Analyzing the cause of such an issue is like 90% of the work. Fixing the code is normally just the remaining 10% of work.)
Oh, why so? I have done that in my mod for one civilisation...?Normally, but there are some exceptions, e.g. giving value to workers will cause all sorts of issues, CTD IIRC. You can ask the C2C crew about it.
This is what I was told in RoM-AND forums. I'm not sure if it really was a CTD or an infinite loop but something. It was some conflict with the unitAI. Better ask the C2C guys. But I'm almost certain that Archmage @f1rpo knows the answer too. He knows everythingOh, why so? I have done that in my mod for one civilisation...?
EDIT: And I definitely have not encountered a CTD in all the years of having this implemented.
I don't know, but I seem to recall that Dawn of Civilization has Roman military units that build roads and that some minor AI change was needed to really make that work. Maybe the issue in C2C involves code added by C2C. But, generally, any unconventional XML change (e.g. non-naval cargo units) may well cause some AI or UI issues in the DLL.It was some conflict with the unitAI. Better ask the C2C guys. But I'm almost certain that Archmage @f1rpo knows the answer too. He knows everything
AI support for ranged attacks is very rudimentary, some 20 lines of code in CvUnitAI.cpp. Ranged units will shoot at units that happen to be near them, and the choice of the target (if multiple are in range) is based on combat odds ... I don't even remember what that boils down to when the survival odds are always 100%. @keldath has spent a lot of time e.g. getting ranged units to seek safety sometimes rather than always firing and to select targets more intelligently. (But he also experimented with changes to the range-attack rules, so I doubt that his code is easily portable.)[...] and I intend to give some units ranged attack capability. But that's an XML thing so I assume the AI can handle it?
At least CvCityAI::AI_buildingValue doesn't look encouraging: CvCityAI.cpp#L3364[...] and making sure that the AI can figure out to build war factories in order to build tanks and stuff. But it handles missionaries just fine so it should be fine?
Yes, RoM-AND has some units requiring buildings but these are mostly late game stuff, where it isn't considered so important whether the AI is using them or not. E.g. mechs, nukes and other futuristic stuff.Edit: And mods with buildings that enable military units may have already added some AI code, e.g. Rise of Mankind probably has such buildings.
Is DOC related to KMOD? Because I took that as my starting position so there might be some stuff there. And if not at least more easily ported.I don't know, but I seem to recall that Dawn of Civilization has Roman military units that build roads and that some minor AI change was needed to really make that work. Maybe the issue in C2C involves code added by C2C. But, generally, any unconventional XML change (e.g. non-naval cargo units) may well cause some AI or UI issues in the DLL.AI support for ranged attacks is very rudimentary, some 20 lines of code in CvUnitAI.cpp. Ranged units will shoot at units that happen to be near them, and the choice of the target (if multiple are in range) is based on combat odds ... I don't even remember what that boils down to when the survival odds are always 100%. @keldath has spent a lot of time e.g. getting ranged units to seek safety sometimes rather than always firing and to select targets more intelligently. (But he also experimented with changes to the range-attack rules, so I doubt that his code is easily portable.)
Thanks. I will look into that definitively. If all else fails I'll dig into FFH submods. Those definitively have building requirements for all sorts of stuff and even a game option to let the AI ignore them. Of course, I'd love to avoid this work but how hard can it be?At least CvCityAI::AI_buildingValue doesn't look encouraging: CvCityAI.cpp#L3364
The lower part of the loop body only deals with missionaries. The upper part seems to assign some utility only if 0 units of the same UnitAI type exist on the city's landmass. I suppose that's also aimed at missionaries. Oh, and I see that the BBAI mod has helpfully added a comment:
"TODO: Smarter monastary construction, better support for mods"
Just setting an AI weight in XML isn't going to work well because, as you say, you want the AI to specialize - and construct war factories only when having gone with the vehicular techs. But, then, adding AI code that perhaps just adds some fixed value for every (non-missionary) unit type enabled by the building shouldn't be much effort; could be good enough. Edit: And mods with buildings that enable military units may have already added some AI code, e.g. Rise of Mankind probably has such buildings.
I definitively want hard requirements because it's supposed to be a strategic tradeoff. All production buildings (except the barracks) come with [IMG alt=""]https://forums.civfanatics.com/images/smilies/civ4/yuck.gif[/IMG] points to discourage spamming them in each city. The idea being that only your production cities that specialize in building units are going to have a massive army base full of buildings in them. And the rest might have one or no military buildings. Kind of how in C&C not every mission lets you build all the stuff up front.Yes, RoM-AND has some units requiring buildings but these are mostly late game stuff, where it isn't considered so important whether the AI is using them or not. E.g. mechs, nukes and other futuristic stuff.
But you can dodge this issue by a civ-ish approach: War Factory is not a requirement for tanks but a booster building granting +2Xp and double production speed for tanks. AFAIK the AI understands the use of Barack-like buildings, since that is vanilla feature.
Those two mods pretty much only have BUG in common.Is DOC related to KMOD? Because I took that as my starting position so there might be some stuff there. And if not at least more easily ported.
Industrial hunting may be a bit of a clumsy term. But it's the best one I could come up with to adequately describe the sort of insane mass scale hunting practices that emerged during that period where people were hunting animals in near industrial quantities to provide for the growing urban food markets. It exploded in popularity at about the same time and for the same reasons as industrial scale fishing and whaling. And it was just as insane.Minor comment on the tech tree from a 2 second glance. While industrial agriculture makes sense to me, I don’t see what Industrial Hunting would be other than a path to species’ extinction. Would it not make sense to allow construction of camps (which would not be as efficient as the industrial improvements) from the start of the game? Some type of conservation (tech) of species, so they’re not over hunted, could allow a boost to the camps later.