advanced city planning, unit bonuses, marshalls, and fuzzy tech goals

nzhavok

Chieftain
Joined
Mar 8, 2006
Messages
2
Hi all,

I'm a long time lurker of CFC, but this is the first time I've been motivated enough to do anything worth posting ;)

I used to enjoy moving around my workers/settlers to improving my land by hand, but after about 15 years of playing civ I/II/III/IV I'm starting to get a little bored of it. In C3C I experimented with automating the settlers and really wasn't too happy with the results. I find it even worse in civ IV because I like to specialise a lot of my cities.

At the moment I am "hand tuning" the cities on my home continent and automating the rest, even this causes problems as sometimes the home continent can be quite large. With the release of the SDK I think this problem should be solvable (I'm fairly sure it's not possible with a python only solution).

Essentially I would like to create a city planning screen similar to the current city management screen. However instead of allocating workers to the plots around the city, I'd like to allocate improvments. Then when an automated worker decides to improve a tile around the city it can take a look at the plan I have created and use that in preference to how it does it now.

My next gripe is over the building cost for new cities. I find the fact that a granary costs as much time to build in the modern era as it does in 4000BC a little strange. It's clear that the modern era cities can grow faster because we can build the tile enhancements faster, but the building speed of the city improvments remains constant.

In the same vein all buildings and units are not created equal, modern power plants are more efficient and safer than older ones, modern infantry are superior to the pre WW2 equivilant. One solution to this is to create a lot of seperate units that do the same job and this has partilly been done (tank --> mod. armor, musketmen-->riflemen-->infantry-->mech infantry) but not to my satisfaction.

I would prefer a simpler solution which would attach some sort of bonus points to units which would increase their abilities. This would be similar to promotions, but they would be automatically available to newly built units. To elaborate slightly, if you were to build a single tank it wouldn't normally have any additional bonuses, but by the time you hve built your 100th tank your tank building should have increased somewhat, resulting in an increase in hitpoints for new tanks. Similarly if you are constanly defending with longbowmen the newly built longbowmen will come with defence bonuses, and if you are constantly attacking with cavalry they will receive attack bonuses. I would think old units could be upgraded (perhaps refitted is a better term) within the same unit type, but these bonuses shouldn't carry across when upgrading to a new unit type.

This can be extended to buildings in several ways. Firstly if you have built 20 granaries, your granary building skill increases resulting in a shorter catch-up time for new cities (this can be extended to all buildings of course). As well as this some buildings may have additional bonuses, such as factories increasing their production bonuses. Like with units, I would expect old buildings could be refitted to newer versions. The final extension could apply to buildings which increase the promotion points of units, such as the barracks. A barracks that creates a lot of units starts to produce units with more promotion points, this is slightly different than the other extensions because it applys to a specific instance of a building rather than that class of building.

Gripe number three concerns micromanaging units before big wars. It's a pretty simple idea, I would like to be able to create "Marshalls" which would be a special unit capable of organizing other units. They would have no ability to attack or defend, nor any cost (I guess they would be like spies). The marshall would be able to be created anyware and configured to collect other units. For example I might deploy 6 marshalls in the north prior to an attack, each collecting 15 tanks, 5 helis, 5 arty and 5 infantry. At the same time I deploy 2 in the south, to defend against an uncertain neighbour, each collecting 15 infantry and 5 tanks. Then I start producing these units in my cities. When a military unit is produced at a city it can be automated and it will then seek out the nearest marshall that requires a unit of this type. The marshalls don't actually do anything themselves except keep battlegroups organised.

My fourth and final (well final for this rant at least) gripe has to do with technology targets. I think it's a little unrealistic to persue technologies with such precision. My solution is to provide fuzzy catagories rather than specific techs, for example you may research 50% growth techs, followed by 30% military techs and 10 each of economics and religious. Every turn you collect research points per catagory and each available tech is randomly tested against a catagory, if the test passes the tech is gained for a cost, and the catagory pool is reduced by that cost.

To give a simplistic example, imagine we only have 2 pools: growth and military. Each of these pools has points acquired from previous turns:

military 450
growth 700

This turn we have 400 new points to allocate and the current split is 75% military, 25% growth, so at the beginning of the turn we have:

military 450 + 300 = 750
growth 700 + 100 = 800

Now at this point we have the chance of discovering some techs. Let us say that a tech has a nominal value and a standard deviation of 10%, there are 4 techs whose prerequisites are satisfied, listed below is the nominal value, and the actual value (random deviation from the nominal value for each game) of the techs. The available techs for the round would be orderered randomly.

Horseback riding (military) 800, 650
Fishing (growth), 600, 700
The wheel (growth), 600, 50
Archery (military), 100, 150

So we would discover Horseback riding because the 650 actual is less than 750 in the pool, this reduces the military pool to 100. we would discover fishing because 700 is less than 800, and we also reduce our growth pool to 100. The we discover the wheel because the dice have favoured us and it is alarmingly cheap (50) reducing our growth pool to 50, we cannot discover archery because the cost is 150 and we only have 100 in the military pool.

This is obviously a highly contrived example, I'm not suggesting it would be normal to discover 3 techs in a turn (!), I only wanted to illustrate how the system could work.

Erm right, I think that's all, just a few tiny changes :D I should start working on these in the next week or so, but I wanted to check in here first to see if anyone knows of similar efforts, I'd hate to waste my time working on features that have already been done. Suggestions or critiques are welcome so long as they don't contain the words "ludicrous" or "imbecile".

- nzhavok
 
Hey nzhavok!
Great ideas, and I little comment on these:
advanced city planning:
I have no meaning about this.
unit bonuses && marshalls
I am so-so with this
and fuzzy tech goals
THIS IS the best idea I have incontered in a long time! I have been think more or less the same. But I could not really precise excately what I wanted. This is great!

I will to my own satisfaction look into the last one... :D
 
Planing improvments sounds like a nice way to speed up the game, I could plan out a whole base area and automate away. It would be tricky to set this up in the interface as it will be nessary to look at your plans. Some kind of toggle to "view plans" that removes all the real improvments and shows the planed improvments, then we can click on and change them a bit like the WorldBuilder.

The idea for reducing costs of buildings and units late game is very interesting. I was thinking of a Tecnology angle on it rather then a quantity of built items. Currently units and Buildings have "BonusProductionModifiers" that alow you to accelerate production if you have access to someparticular bonus (say for Example Marble and the Parthanon). How about an equivilent "TechProductionModifier" which gives a bonus when you have a specific Tech. So for example When you get Construction your Granaries could be built at double speed. Each building could have several such cumulative boni and by the late game your Granaries build 4x fater then normal. Ofcorse theirs the even more stratiforward solution of just giving you a particular building free once you hit a particular Tech.

Units could recive Promotions or ProductionBonuses with specific tecnologis, personaly I would think the Free Promotions (or free XP so you can pick promotions) would be better as I rarley build the obsolete units once a new tech becomes avalible.

I also like your Fuzzy Tech goals, it reminds me a bit of Master of Orion I (which I love). I think a lot of players would like the challange and randomness of that and it would be easy to get the AI to follow the same rules for fairness. SMAC had a similar system (though not as nice as what you described).
 
Some comments on your ideas nzhavok
1. City planning...I agree wholeheartedly with this approach, in fact here is an excerpt from a post I made back in January on this very topic!

Dreams...

An interface that brings up an improvement planning overlay for a city, used to specify what improvements/roads are wanted on each tile within the city's fat cross, with priorities as to which needs to be done first. Ideally this would also allow you to stack tile improvements so that when a new improvement becomes available workers know they can replace the existing improvements in specific tiles. Maybe triggers based on city population could be defined for each tile to give guidance for when the improvement should be built and/or upgraded.
Workers could then be assigned to improving that city according to the master plan. It feels like micromanagement when you first think about it, but imagine not having to touch those workers again and trusting them to build exactly what you want!
Wakes up...
Ah well, back to manually moving workers, but it would be nice if it happened.

2a. Building costs for new cities, also strong agreement, although not as bad as Civ3 where corruption and waste made many new cities grind to a halt it is still irritating that the costs are not affected by increases in productivity through the ages! I would like to see something like an improved settler that founds cities with basic infrastructure in place or maybe new cities could build 'infrastructure' as a building that produces granary/library/market/harbor etc as a package at a lower cost than the individual buildings.

2b. Increased effectiveness of frequently used units/buildings...I must admit I have not really thought about this as units tend to fly past in the timeline before I can build too many of the same type. (I guess I should play marathon more!) The extra XP from a barrack after it has built several units of the same type might be a nice idea though. For buildings, again this is an interesting idea but it has not bothered me to the extent that I am desperately looking for a solution.

3. Marshalls...interesting idea, I would have to play test it to see if it would really make a difference.

4. Very interesting idea, at first I thought it reminded me of the way research worked for SMAC but not quite, as what you describe sounds better. It sounds like a good idea but as with most radical changes it would need to be prototyped and playtested.
 
City Planning:
A planning screen in my opinion only means you plan all at the same tile instead of doing it on worker by worker basis. Seems as if the reduction in actual work is not so big.
How about setting Priorities that are given to the automated workers. Like: I want this city to max out production, you workers do it. This could even been done with the automation buttons that are already there (Production, commerce, food, no_growth, several of those). In fact i thougth to do something along this lines -and most probably others, too - as it would allow the AI to specialize its cities.

Marshals: Again a good idea. The marshals would be invisible, would have range of sight 0 and could only move (high movement) within revealed terrain. They would not even cost anything. That mechnism could be used to improve the AI, too, to allow it to move its forces in a more controlled (higher level strategic) way. (Of course than a good AI for the Marshal has to be written).
 
Chalid said:
How about setting Priorities that are given to the automated workers. Like: I want this city to max out production, you workers do it. This could even been done with the automation buttons that are already there (Production, commerce, food, no_growth, several of those). In fact i thougth to do something along this lines -and most probably others, too - as it would allow the AI to specialize its cities.
I'm pretty sure automated workers take into account city specialization already. The worst bit about AI city specialization is how it decides which specializations to use. I'm currently doing some work on that...
 
No unfortunateley they do not. I am unfortunateley absolutley sure of that. The emphaisis used in the code that selects which improvent shall be placed is only dependend on the plot, and not on the city specialisation.

Code:
        bEmphasizeFood = (!(GET_PLAYER(getOwnerINLINE()).AI_isCommercePlot(pPlot)) || (bLowFood && (pPlot->isHills() || pPlot->isFreshWater())));
        bEmphasizeProduction = (!bLowFood && pPlot->isHills());
        bEmphasizeCommerce = GET_PLAYER(getOwnerINLINE()).AI_isCommercePlot(pPlot);

and now the funny thing: every second plot (diagonally) is a commerce plot...
Code:
bool CvPlayerAI::AI_isCommercePlot(CvPlot* pPlot)
{
    return ((pPlot->getX_INLINE() % 2) == (pPlot->getY_INLINE() % 2));
}
 
You seem to be right. I was sure it was dependant on the emphasis type. Should be an easy fix... but not one you'd probably want to do with the default AI emphasis selection.

On a completely unrelated note, are you still working on that promotion AI tweaking? How is it going?
 
As Chalid and others well know, I am definitely interested in more intelligent improvement selection and building by the AI. Since Civ4's core dynamic is city specialization, it's a shame that the AI for it has finally caught up only to Civ3's mechanics (generic city maximization). A truly "intelligent" AI would set goals and then develop a strategy around those goals. Perhaps there are too many possible combination of strategies to optimize for, but based on the max-min players who have figured out general formulae for how many science, commerce, production, etc. cities you need for a typical game, I think the AI can be "taught" these strategies.

At a minimum, at the risk of repeating myself from other threads, I'd like for the AI to be able to (1) balance between the value of an improved tile NOW vs. redoing the tile LATER; and (2) recognize civic choices' impact on improvements.

Ideally, the AI would be smart enough to answer these questions:

1. Should I build a farm now and replace it with a cottage later?
2. Now that ivory/fur is obsolete, should I replace this camp with a cottage?
3. Should I replace this town with a farm now that I need GP's?
 
Back
Top Bottom