Unit Limit Per Tile

im not to sure wether it is already implemented in the game, but is it possible for ships(even military vessels) and airplanes(jets etc) to be excluded from the tile limiting, since naturally you cant really set a front line for planes and stuff, and they all have bases, are these units applicable to the unit limit rule?

Planes are exempted but ships aren't unless they're stacked in a city.
 
Related: I'd really like to see some manner of unit-per-tile limit applied to cities, shunting built units out to a nearby unoccupied tile. I just lost a slew of more modern units in a city invasion because Trebuchets (!) had stacked up in a city and they all focused one one three-unit stack.
 
yep, the city stacking is somewhat annoying. Afforess, i think you should rethink your option 3 choice as there is little support for it from nUPT players.
 
Maybe somehow make it that the field can have "x" amount of troops and cities are allowed to have "x" amount of troops? 3 isn't a lot for defending a city if you break through a weak defensive line...

Also, MP update for UPT. The host set the limit to 3 and I had gone into single player and changed it there and re-joined the game and the BUG option stayed to 3. It works for both of us fine and the AI as well and we have yet to have an OOS and we just hit construction.
 
Maybe somehow make it that the field can have "x" amount of troops and cities are allowed to have "x" amount of troops? 3 isn't a lot for defending a city if you break through a weak defensive line...

Actually, it makes the defensive buildings and units more beneficial.

Also, if a competent AI gets the drop on you, even with the same number of units, there's a chance you will lose a city. Case in point, my current game playing as India and Khmer to my north with Ruthless AI declared war and while I was trying to mobilize my troops, they were rampaging around my border fortress of Susa with 95% defensive modifier. However, surround and destroy got the best of me and they smashed me in Susa and I had to fight to get the city back.

The funny thing about xUPT is that low numbers can lead to bloody stalemates. Khmer kept sending troops into the fray and I did as well and we were both losing a respectable number of units each turn. Meanwhile, on another part of the border far from the city of Susa, even more Khmer troops were trying to break through and the only thing that saved me there was war elephants and the Siam UU, Battle Elephants.

The only reason why Susa wasn't overrun the second time was because I had Archers there this time instead of one archer and two other units.


Anyway, a Daring Commando Raid (TM) lead one of my swordsmen to take out a Mounted Footman which, in and of itself is no big deal except he was escorting two warlord chiefs.

So yeah, I'm happy now.
 
I think the idea is rather interesting so I "borrow" Afforess's code and implemented the UPT limit when the unit is being trained. Basically all I do is adding the same check in CvCity:: popOrder() function, and if the newly built unit can occupy the city tile it will be bump out to nearest tile. I simply call CvUnit::jumpToNearestValidPlot() because I am lazy :mischief:. The result is quiet acceptable to me and possible exploit is rather uncommon so I decide to run several test games to see its effect. I've tested one game till mid age and already saw a lot more battle on the field, but I think that using the same number of UPT for both city and field seems to be too large an advantage against AI. Maybe we should have two seperate UPT number for city and field?
 
That could crash the game, because jumpToNearestValidPlot has a possibility of killing the unit, which will make the pointer invalid.
 
sounds like an insecure programming concept on fireaxis end... oh i think some programmers shouldn't touch the mother of all programming languages if they are not experienced enough. invalid pointers are deadly and cause errors that are hard to track. so you either return a valid pointer or a NULL pointer but NEVER something else. and you NEVER write functions that could possibly invalidate other pointers.
 
sounds like an insecure programming concept on fireaxis end... oh i think some programmers shouldn't touch the mother of all programming languages if they are not experienced enough. invalid pointers are deadly and cause errors that are hard to track. so you either return a valid pointer or a NULL pointer but NEVER something else. and you NEVER write functions that could possibly invalidate other pointers.
It returns false if the unit is killed, and the function description gives a warning.

I modified it to take a parameter, so it won't kill the unit given the correct parameter, just do nothing instead. In 1.74, with xUPT, units will be forced out of cities, if there is valid plots to go to.
 
it should not do any damage even if the parameters are wrong (except for bad pointers). they should have used a shared pointer object or something similar and it would be much harder to invalidate a pointer. they are a tiny bit slower but they save a lot of time (that is because they are effectively classes that mange a double pointer **).
 
Lol. Firaxis's style of programming is that their functions work with the correct input, but crash with with garbage. I do agree, there should be some safety on these functions (or at least make the function private, so it can't be called via a pointer). My own functions are generally safer than Firaxis's.
 
I see this feature with good eyes, specially because a special case of it (1 UPT) is happening in Civ V too.

But, wasn't the original goal of it to limit the Stacks of Doom in the game? Aren't there better and smarter ways of doing it? I see two paths we can follow here:

- The first is one that I already tried to go: limiting SoDs via higher unit maintenance. Look this thread and see if it's adequate to revive my minimod using Afforess' skills.

- The other is someway to connect armies and population. I talked about that a long, long time ago, but we didn't had Afforess to implement it. Maybe it's time...
 
I just found a bug (or feature) of xUPT.

Currently, you can build pass the limit but we already knew that. However, you can also stack units on ships and then bring them back in the city and unload.

The other problem is that if you're loading units on ships, the units on the ship are still counted to tile limit which to me, doesn't make sense because if I recall, units of ships can't defend (correct me if I'm wrong). You can move ships filled with units normally in waters and in cities.
 
Afforess, is it possible to set like 9-18/24/36 limit per tile-city with minor changes in the game?

I think if we let a considerable amount of units per tile/city, instead of just few, the AI will respond better and we will have better quality wars without being necessary to change the original gameplay.

Besides that, it is necessary to do something with new units built in full cities, to have some preocupation with: transports over the sea; airplanes based in cities; ships landed; defensive units; the possibility for a tile to hold units from more than one team simultaneously.

I would like to do it for a map that I am uploading 03/12 and the next version could have something like that.

So, my question is: can I get these results from working with your files?

:confused:
 
Afforess, is it possible to set like 9-18/24/36 limit per tile-city with minor changes in the game?

I think if we let a considerable amount of units per tile/city, instead of just few, the AI will respond better and we will have better quality wars without being necessary to change the original gameplay.

Besides that, it is necessary to do something with new units built in full cities, to have some preocupation with: transports over the sea; airplanes based in cities; ships landed; defensive units; the possibility for a tile to hold units from more than one team simultaneously.

I would like to do it for a map that I am uploading 03/12 and the next version could have something like that.

So, my question is: can I get these results from working with your files?

:confused:

J AV F, I don't think I understand what you're saying; can you clarify a little bit? (For example a single tile CAN hold units from more than one team simultaneously, so I don't understand what you're proposing; and units per tile limit can be set via BUG options). Besides, Afforess visits the forum from time to time but he's not actively developing AND since 1 year or so.
 
45°38'N-13°47'E;12277749 said:
J AV F, I don't think I understand what you're saying; can you clarify a little bit? (For example a single tile CAN hold units from more than one team simultaneously, so I don't understand what you're proposing; and units per tile limit can be set via BUG options). Besides, Afforess visits the forum from time to time but he's not actively developing AND since 1 year or so.

45°38'N-13°47'E, thank you for answering. Sorry, it was confusing. It happens that English is not my first language, so I will try to clarify what I asked.

I would like to set, for instance, the limit of 9 units per tile and the limit of 18 to 36 units per city, because I thought they could be fair numbers for the AI to handle (what I have recently known it does not matter, once the AI would not know how to act and could enter in an infinite loop). The intention was to limit stacks and drive the gameplay to a point that instead of huge stacks attacking cities, it would happens differently as the limitation would split stacks in smaller ones, taking the battle necessarily to the ground.

As I have read in threads discussing this topic, I have considered possible problems, like new units in cities already full of units, stacked transports, based airplanes, etc and something that Afforess said about team limitation, because it seemed to be a cause of problems somehow.

I would like to use the unit per tile limitation in a map scenario, but, considering that AI can have problems handleing it, it is probably better to let it out.
 
45°38'N-13°47'E, thank you for answering. Sorry, it was confusing. It happens that English is not my first language, so I will try to clarify what I asked.

I would like to set, for instance, the limit of 9 units per tile and the limit of 18 to 36 units per city, because I thought they could be fair numbers for the AI to handle (what I have recently known it does not matter, once the AI would not know how to act and could enter in an infinite loop). The intention was to limit stacks and drive the gameplay to a point that instead of huge stacks attacking cities, it would happens differently as the limitation would split stacks in smaller ones, taking the battle necessarily to the ground.

As I have read in threads discussing this topic, I have considered possible problems, like new units in cities already full of units, stacked transports, based airplanes, etc and something that Afforess said about team limitation, because it seemed to be a cause of problems somehow.

I would like to use the unit per tile limitation in a map scenario, but, considering that AI can have problems handleing it, it is probably better to let it out.

Ok, I got it now (no problem, english is not my first language either ;) ). But as the code is now you can't have different limits for units-per-tile and units-per-city. Via BUG Options you can select a limit for units-per-tile but that won't work for cities because new units will accumulate in cities as they are built.
 
45°38'N-13°47'E;12277892 said:
But as the code is now you can't have different limits for units-per-tile and units-per-city. Via BUG Options you can select a limit for units-per-tile but that won't work for cities because new units will accumulate in cities as they are built.

The answer satisfies pretty much my question. Interesting, I will try to set a large limit in order to watch what happens, since I have never tried it. Thank you for your attention! :goodjob:
 
What I would like to see is limits mostly in cities and not so much on the countryside. Which would force out bigger stacks into the open and most battles taking place in the open to prevent bigger armies ever reaching the cities. And I would also suggest that some buildings increase the number of allowed defenders of a city. Walls, castles and barracks for example.
 
Top Bottom