any coding idea how to limit units on a tile

I'll take it. ;)
 
I feel the main Problem lies within the AI as when i remember correctly units are moves sequencially. So you will have to introduce new waiting functions.
For example you have an enemy Stack on a tile that can be attacked only from one tile. If that tile has a full stack all AI units that move before the units in the stack will not be able to move to the tile. A human player would simply first attack with the units in the stack and than move those from neighboring plots in.
Thats of course a very constructed example but i think it shows the problems.

So creating a waiting function for AI units is the real task.
 
Chalid said:
I feel the main Problem lies within the AI as when i remember correctly units are moves sequencially. So you will have to introduce new waiting functions.
For example you have an enemy Stack on a tile that can be attacked only from one tile. If that tile has a full stack all AI units that move before the units in the stack will not be able to move to the tile. A human player would simply first attack with the units in the stack and than move those from neighboring plots in.
Thats of course a very constructed example but i think it shows the problems.

So creating a waiting function for AI units is the real task.
yeah its a problem but a single "if" solve that...:) suposing that the trouble start two tile away of attacked city
 
Shqype said:
Well, for my Eastern European Battles mod, I planned on implementing a tile limit for all tiles EXCEPT cities. The goal is to diversify city attacks and to prevent super-large stacks of 20 and above. The 10 limit would have been ideal for me. This means that the absolute maximum number of units that could attack a city per turn is 80.

12Monkeys, I have a request for you for CIV4CCP!

Could you implement such a system that limits the amount of units on a non-city tile? I believe the way would be like this:

Allow an option (preferably in GlobalDefines.xml) for each terrain type that has a "space amount," or the amount of space available on each tile for that terrain. By default, you might want to set it to -1 so that there is no limit unless someone actually wants one.

Then, in the CIV4UnitInfos.xml allow a new XML tag <i[TERRAIN]Space> which will define the amount of space the unit takes up. For example, let's say that each plot of land has a maximum of 10 space, then the "space values" of all the units on that plot of land are added up and allowed so long as the number does not exceed the limit (10).

So, regular army units could take up 1 space, for instance, but then you could get heavy artillery which takes up 2 spaces, etc, etc. Maybe later on a tank could take up 3 space.

You could set the default value to 1 so that it wouldn't break any mods already out there; coupled with the -1 default value for the terrain limit this wouldn't hurt at all.

But, it would add a greater depth to the game as far as strategy is concerned. If you made the space limits by terrain type and not domain type, then you could fit much more units in open space (plains) than you can in hills or forest, for instance. This would really protect civilizations with their cities deep in forests or hills because less enemy military units will be able to attack them per turn (because of the terrain tile limit), instead of the way it currently is in CIV 4: if enemy units are on a jungle tile outside of your city, they actually get a defense bonus which only aids their conquest against you, not hinders it!
this is fine ,another think is make generals or medic use 0 spaces but just one in the tile ... but will be very harder to implement especialy diferent tile capacities because ai will get crazy to move troops... i know how program in python...c++(im learning yet ,but im good in C) but the code of civ4 is bad documented at all...hard to find anything ...i think
 
Back
Top Bottom