Design: Improvements

Elsewise, we've still very weak excuses as to why specialization occurs.
Specialization occured. Then an ice age came and went. The civs either returned to what they knew, or not, however your game progresses. They can either use the bonus they have, or adapt to better terrain like everyone else. I'd rather have options than strict adherance to setting. (and I love the setting, obviously.)
 
Nikis-Knight said:
Specialization occured. Then an ice age came and went. The civs either returned to what they knew, or not, however your game progresses. They can either use the bonus they have, or adapt to better terrain like everyone else. I'd rather have options than strict adherance to setting. (and I love the setting, obviously.)

Hm, Interesting excuse, and very valid.
Doesnt meant it couldnt be better, and more tasty, but at least I feel satiated as to reasoning.
-Qes
 
Kael said:
I once planned to have a whole line of defences. I imagined countries would be able to build walls around their empires complete with guard towers and gates. But the problem with it is that the AI doesnt understand appropriate use of them. So I couldnt make the improvements that strategic (hence the random sentry towers instead of the ability to build them).

I like sentry towers, and I would like it if they could be built...so I was pondering this problem. I had a couple of Ideas that I felt just might allow the AI to build sentry towers and forts in a sensible manner.

Start with NON-graphical fort and sentry tower bonuses in the map script.
Place them on hills and other flavorful choke points as the map script allows.

Next, lie to the AI by giving these bonuses yields that would be available with the appropriate improvement.

Thus, the AI would be inclined to build forts or towers on appropriate sqaures...

In a script, on some event such as "complete improvement" trigger a terraforming event that changes the tile from the NON-graphical sentry tower bonus, to the graphical versions of the same bonus.
In the case of a plain fort, simply remove the underlying blank fort bonus bonus once the fort is built.


I might suggest further that the sentry tower bonus again lie to the AI and tell it that it will be improved with a fort, and again, via a script, the sentry tower bonus would be removed upon completion of a fort and replaced with the sentry tower/fort improvement...and I would suggest that this improvement actulally give a production yield like a mine or windmill might so that the AI won't be inclined to replace the improvement it just finnished making.

For plain old forts (that didn't start on a sentry tower bonus), with no sentry towers, again, once the AI has been tricked into building a fort there, have the plain old fort give a yield like a mine or workshop would.

Players would be able to build sentry towers where-ever they liked as they wouldn't even see the blank sentry tower and fort bonuses, but upon building a sentry tower improvement, it would become, via a script a graphical sentry tower bomus, allowing one (AI's too) to then build a fort around it.

I obviously haven't looked at the AI very much, but since there is already terraforming code in the mod, and there are lot's of events in the python it seemed like this thing wouldn't be that difficult.

I have some ability to program, and I'd be happy to try to program it and test it myself if I thought my code might have some chance of being integrated back into the mod.

Of course, if the design team has explored such a path already they can also save me from wasting time on this by letting me know it won't work right.
 
as a quick add on...

if forts were going to yield anything for the sake of tricking the AI, I think commerce might make the most sense. A flat +2 or +3 would seem reasonable.
So a fort on a hill would yield a couple of commerce and some hammers.

I haven't done the math so I don't know if that would be enough to stop the AI from wanting to replace such an improvement with a mine.

In fact...How often will the AI ever replace an imrovement?

Would it even be necissary to continue to trick the AI after it had already been fooled into building the fort?
 
http://forums.civfanatics.com/showthread.php?t=181357&page=4

post 129 by me in the Fortresses thread, has the changes you describe as an attachment, that was for 0.15 but i might do it again when i upload my svartalfar changes. the fortresses as sentry tower improvements works exceptionally well, especially with dreiche2s flavour scripts, which, you guessed it, placces sentry towers at good choke points ;)
 
Sureshot:

I had already seen the change you made, and I like it, but it still feels a little weird to me to have random sentry towers dotted on the map and I'd love to have the ability to build my own.

So, I'll almost certainly be using changes like you made in the short term, but in the long term I'd love to see sentry towers as buildable rather than random.

In additon, I'd like to see forts without sentry towers from time to time and the silly AI doesn't build them. Plus that +25% defense is almost pointless. They need to at least be worth more than a forrest, otherwise I'll just cast bloom everywhere except dessert.

It'd be nice to see jFort or something like it integrated into the mod once the AI can learn to use forts better.
 
ya, theres mods out there that help make forts worthwhile, but ive yet to see any that the AI uses well.. thats why i favour the sentry tower fort idea, the ai uses it perfectly (and dreiches mapscripts place towers in great chokepoints :)).. in my changes i always give forts +100% def and bonus yields on towers ;)
 
I've been playing around with Forts some in an effort to get the AI to build them and use them more.

It's easy enough to get the AI to build them more. A simple yeild will do that. The wrong yeilds can lead to Fort spam on desserts and Tundra and even ice though.
A "fix" for that is to only normally allow the forts on hills.

As for what bonuses and when: Food is the biggest AI incentive, so I've been working a lot with that. One only needs to offer up a little food from a hill plot to make the AI interested in building a fort there.

What I've come up with that seems to work thus far, in terms of building, is this:
Fort --
+50% defense
Buildable on hills
Buildable in forrest and does not remove forest
-4 Commerce Yield
1/1 chance of discovering a Sentry tower randomly

Then....I add tweak the fort yeilds with civics and such:
On road +1 C
On river +1 C
Feudalism +1 C
Trade +1 C
(at this point the fort maintanance is a wash...its back to a null improvement)
Military State +1C
Aristocracy +1F
Conquest +1F/+1C

So, on a grassland hill with forrest and the right civics and techs on a road and river, the tile yields +3F/+1P/+2C...which seems to be enough incentive for the AI to build the fort on marginal tiles, but not enough to spam the fort.

Some issues I've had:
although even with the value of 1 in the XML, it shows up as a 1 in 1% chance and while sentry towers are freqently popping up, they don't show up automatically. Once there is a resource on the plot, the AI will even rebuild raised forts there.

I can't force AI's other than my own to have all 3 civics I like, but even with 1 or 2 of the appropriate civics the AI builds forts.
My automated workers love forts when I have all 3 appropriate civics. Windmills must be worth less than forts or the AI likes them better...


And worst of all... I can't get the AI to guard all the forts it builds. How can I encourage this behavior?

Even forts with a Tower Resource it doesn't seem to guard the forts (though, admitadly, thusfar the tower resource is essentially a non-yield resource)

If I give a yield or a happy to the tower will that cause it to guard them, or is it a different flag in the XML? I've tried the AITrade wieght flags and the iUnique flags, but that doesn't seem to help.

I was planning on trying the following:
+1 Happy from sentry tower with Castle

Thus, like in a feudal levy system, the outer forts would send stuff to the main lords. Will that be enough to get the AI to guard the plot?

I'll be testing it later to see.

If I can get the ai to guard forts well, then I'll try to add in ZOC, as I think that would be a great addition...but until those forts are guarded it just isn't fair.

any feedback or advise on the matter would be appriciated.
 
the problem with giving forts yields is that they will spam them when they do offer yields, and they won't build them outside of city radius, which is usually the best place for them (though i really like the idea of forts "discovering" sentry towers).

giving them a happiness boost on sentry towers really does the trick nicely, since the AI guards them and builds them outside of city radius.

some ideas ive had some success with have been giving forts "spreads irrigation" with a really weak yield like 1 commerce, since then the AI will favour every other improvement over them, but will build them outside city radius to help spread irrigation (would also add a nice mechanic for spreading irrigation over hills, though not sure how much sense it makes). would be nice if those had a chance to find sentry towers, but that "discover" mechanic only works when you are working the tile, which wont happen with improvements outside of a cities radius.

added:
one thing to remember, forts are bad if you dont garrison them, since they offer enemies places to siege you from, and the AI will only protect resources which offer a bonus they need.
 
I like the adaptive trait. It would be a lot more useful if there was a mouse-over effect that displayed the bonuses that each trait gives when the opportunity to switch comes up every 100 turns.
 
Dwarven Mines:

I think that it would be cool if mines would improve over time (like cottages) for dwarven civs. In addition to producing additional production and/or commerce as the mine goes deeper, there should also be a chance to discover a mineral resource each time the mine upgrades. The chance should be progressively better with each growth of the mine.

I also like the idea that was posted earlier to make an underground tunnel that acts like a road for dwarven civs. The tunnel improvement could increase the commerce of mountain/hill tiles by +1.
 
Sureshot said:
(though i really like the idea of forts "discovering" sentry towers).

I'm somewhat partial to that over having sentry towers randomly on the map...but that's me.

giving them a happiness boost on sentry towers really does the trick nicely, since the AI guards them and builds them outside of city radius.

I'll be experimenting with that more later. Perhaps it's the only way without the SDK...

but that "discover" mechanic only works when you are working the tile, which wont happen with improvements outside of a cities radius.

Ah ha. That's probably why sentry towers haven't popped up all the time. Excellent to know.

added:
one thing to remember, forts are bad if you dont garrison them, since they offer enemies places to siege you from, and the AI will only protect resources which offer a bonus they need.

So, happy resources are always protected? Or would the AI only protect 1 of any such resource?

I'll be testing later either way. But if you know...spread the word.
 
Plodding on with my research into Forts I've learned how it is the AI determines what resources to guard.

First, you need a unit to have the UNITAI_RESERVE...and then there is a chance
it will be given the mission GUARD_RESOURCE.

I'm working on how to determine when units will be "RESERVE"

But assuming you have some reserves...AND the AI doesn't think it needs more units to either: Guard a city or guard an airlift, then the units will go and stand on a resource.

What resource the choose to stand on is determined via a function in the SDK...I don't know yet if python modifies this value.

The formula is roughly something like this:

((100*Happy +100*Health)
+(40 per unit "AND" prereq + 30 per unit "OR" prereq + unit production modifier /10) * 1.5 for units it can build or divided by the difference in tech eras from where it is now
+(30 per unit "AND" prereq + 20 per unit "OR" prereq + building production modifier /10) * 1.5 for buildings it can build or divided by the difference in tech eras from where it is now.
+ 2 * project building modifier /10 * 1.5 for projects it can build or divided by the difference in tech eras from where it is now. )
/ 10
= PlotValue

If the value of ANY plot is greater than 10 and is greater than all other plots
AND
the function isVisibleEnemyUnit returns true for that plot
THEN
the RESERVE unit running the AI mission function will be assigned to guard the plot

MY CONCLUSIONS ARE...

The best way to get the AI to guard a plot is to pile on the health and happy bonuses. Absurdly high numbers for these values should result in high numbers of guards.

However, if the civ can also build non-obsolete units and buildings that require a resource, then it only takes a few of these to catch up to a single health or happiness bonus.

So, if for instance mages, archmages, and liches all required a tower resource, and the AI could build them all, then a tower resource would get 40*3*1.5/10 = 18 for a plot value, which is better than a single happiness, so the AI would be more inclined to guard that resource, and any fort that happened to be on it.

at least I think thats about how it works...
now on to find out how to encourage more "RESERVE" units from the AI...
 
The UnitAIWieghtModifier can be set in the LeaderHead XML file.

By setting this value higher, an AI will prefer these units more and will allow itself to build more units with this AI than previously.

With more of these units, and secure cities, the AI will happily put at least 1 unit into a fort that has a "bonus" yeild such as a tower, provided that bonus is "better" as far as it's math goes.

I'll be testing later.

I think that setting the AI weight up a bit for Reserves will really help the AI to use forts better.

I wonder if it will even try to re-capture forts....hhhmmmm...
 
The more I think of forts as improvemetns in Civ, the more it strikes me as a square peg in a round hole. I'm not one of you Civ modders, but I gather there is always some programming shortcoming to the improvement.

[Edit: Moved to the New Units thread.

M@ni@c: That durn AI ... figures.)
 
use what? everything ive heard has sounded perfectly useable by the AI (and has been shown to in tests)

edit: maybe unsers moved stuff? ya im not sure that would be easy for the AI.. ive pretty much abandonned tryin anything that the AI doesnt easily handle
 
Anyone ever think of doing canals? It would boost trade and connect cities and, if you can find out how to do it, allow ships to "move" across land. I can imagine a canal across a strait like that of the panama canal or one connecting 2 cities like the Grand Canal in from Sui dynasty China. If not an improvement then it would make a good wonder. If you build it then a popup will come up asking you which cities you what to connect. Once you pick them the canal graphic stretches from the first city to the second. This would probably require a river in between the 2 cities and im not sure how that would play out with the programming. I also dont know how you would get the ships to move up and down them, but it would be pretty cool/useful if you found out how to implement this.
 
The Lanun can partly achieve this by building a Pirate Cove on an isthmus, though it then prevents land units from moving across without a boat plugging the gap.
 
Back
Top Bottom