New Barracks System [IMPLEMENTED]

But yes: Especially considering point 3, the current implementation is much better in terms of workload/benefit ratio!
It is also 100 times more preformant, because it is handled in "Process Building" when built and not calculated every turn. ;)
(Also it only needs to check if the value of the new Building is higher than what is currently stored in the city. - No loop of existing Buildings.)

But I have never understood why the citadel is not simply an extension of the fortress. The city screen could then simply continue to display "wall" + citadel.
Because it is not just about the City graphics, it is also about the 3D Building graphics of the City on the Map.
And as one Building you could not have handled it properly in LPlot-System to be displayed / placed nicely.
(Walls and Buildings are handled differently in the LPlot-System and MUST be separated.)

OK, technically it's nicer if three expansion levels don't have to refer to the same city walls for the 3D view,
Exactly. :)

----------

See, I had reason for why I implemented it like this and usually I put a lot of thought into my feature design. :dunno:
Since this feature is EXTREMELY critical for performance since it is related to movement / pathfinding I had to make it peformant.

Players often believe that the only thing that matters is the game play they imagine.
But as a modder you need to consider a lot of other factors as well and need to make compromises. :)

---------

But as I said:
Feel free to implement something better. :thumbsup:
If you want to invest the effort I really do not mind.
 
Last edited:
I have at least managed to rewrite it so that the place information is summed up.
Advantage: It could be implemented at least also the not apparent "minimum value" about the main building.

Basically I find the limitation of the units very good! Personally, I would find it great, if the "perceived military strength" of the city is reflected more strongly by the barracks capacity.

Suggestion:
Main Building
  • Basecamp / Village Hall +4
  • Town Hall / City Hall +3
  • Goverment Palace / Continental Congress +2
(If you build only civilian buildings and leave no room for the military, you will have a problem in case of emergency!)

City walls
  • Chevaux de Frise +2 (=4 to 6 with main building)
  • Stockade +4 (=6 to 7 with main building)
  • Fort +6 (=8 to 9 with main building)
  • Fortress + 8 (=10 to 11 with main building)

Other defensive works
  • Citadel +2 / Great Bastion +3 (=12 or 13 with main building)

Armament industry (Sum: up to +5)
  • Armory / Magazine +1 and (Great) Arsenal +2
  • Powder Maker's House / Shop +1 and Powder Magazine +2
  • Blacksmith's House / Shop and Ironworks +0 and (Great) Tool Factory +1

Results in a maximum of 18 space (instead of 12), whereby it is not worthwhile to build so many expensive buildings just for the space. However, a city with weapons production is still able to accommodate more military units and thus defend itself better.

The "negative record", on the other hand, would be a city without defense works and palace with only 2 places (instead of 4).

If the proposal is found to be good, I would implement that. Otherwise I discard the changes in the calculation also gladly again :)


EDIT
It is also 100 times more preformant, because it is handled in "Process Building" when built and not calculated every turn. ;)
I have not changed the location of the calculation. Still in "processBuilding" and save the value further to "m_iCityBarracksSpace".
Test: If I change XML values, start the game, this actually recalculates the space first when a building is added/removed.


Adjusting the anchorages Equivalent is then accordingly also no problem. This at least allows more mod flexibility.
I can imagine, for example, to give the whale oil house / factory +2 anchorage, because in the pedia animation the whaling ship docks directly at the building.

Thanks for taking the time to explain/discuss it in detail!
 
Last edited:
Other defensive works
  • Citadel +2 / Great Bastion +3
Please just add this SpecialBuilding additionally for "Barracks Space" if you want. :thumbsup:
That is the only part I like, the rest feels just totally cofusing and randomly chosen to me.

Simply basically keep the old balancing and give Citadel +2 and Great Bastion +3 additionally then.
Also there is always already a base value provided if no specific Buildings are constructed.

-----

Base Value = 4
  • Chevaux de Frise +2 --> on being built
  • Stockade +2 --> on being built
  • Fort +2 --> on being built
  • Fortress + 2 --> on being built
Other defensive works
  • Citadel +2 --> on being built
  • Great Bastion +2 --> on being built
_____

Total: 16


However:
That might look a little bit ugly in Colopedia - because it will not dispay the complete number anymore as now.

_____

And if want to "add" in ProcessBuildings and not loop all existing Buildings everytime a new Building is added, there might be another issue.
(Which is what I had tried to do to keep this as performant as possible since we also have so many Buildings now.)

Or do you want to loop all existing Buildings to recalculate everytime a new Building is built?
Since it is still just called once on built it may still be ok, still much much slower than what I currently implemented.

-----

Considering the other balancing changes:

As I said: "More is more" and "just unnecessary complex" is not always better to me.
In most cases I prefer a simple and clean design for small features like this.

In your private version you can implement whatever you want. :thumbsup:
But in the core mod version I would really not like to see the rest of your suggested changes.

-----

Summary:
I am ok with the new logic but please configure only "Walls" and "Citadels" to give "Barracks Space".
Anything else would make the feature worse to me and I would veto it. (Because all of us need to like a change.)

Still I am not really perfectly happy with it:

1) It will be less clear in colopedia (compared to the way it is now)
2) It will allow edge cases that could cause cheats and exploits in the future, see below.

-----

WARNING for "edge cases" (if you do not loop and fully recalculate):
With your new logic if e.g. the "Walls" are destroyed or removed by WorldBuilder and they are built again, the value will be added twice. *
So I am really not perfectly happy what you are trying to do since it can caus bugs - but since you since seem to really insist on it - go ahead. :thumbsup:

So you basically will have added a way for players to cheat the system by WorldBuilder. :dunno:
(By continously adding and removing the Buildings by WB.)

But since I usually hardly care if players cheat, I also do not care much about it.
Just wanted that you guys are aware of that.
 
Last edited:
I have given the main building (SPECIALBUILDING_BELLS) +4 each. The GLOBAL_DEFINE_BASE_BARRACKS_SPACES_WITHOUT_BUILDINGS is still active (for mod purposes), but is not actively used because each settlement reaches the +4 via the main building.
This increases transparency in the help, as the +4 BASE does not automatically appear in the help.

(Unfortunately, this doesn't work for ports, because we don't have a "basic building" (like "natural coast")).

The calculation during building construction goes through all buildings. Such an "exploit" or rather "bug" in the world builder I would not find acceptable (You must also be able to remove a building there).
 
@AemonAlCaar

I have given the main building (SPECIALBUILDING_BELLS) +4 each.
Which from my point is unimmersive, because in peace times you would not have troops living in the city halls.
And explicitly asked you not to do that.
This increases transparency in the help, as the +4 BASE does not automatically appear in the help.
But it easily could and would from my point of view be much better than what you did above.
Why not simply count the base value as start value (instead of 0) and then display the Base Value as text first in the help?
(Unfortunately, this doesn't work for ports, because we don't have a "basic building" (like "natural coast")).
Exactly, so please count and display the base values ike suggested above.
And then it should feel much better already for me.

----------------

Also I have checked your code.

Please run the loop logic ONLY if the Building actually has a value for Barracks Space / Harbour Space.
Becuase ONLY then the cache needs to be recalculated. --> Otherwise do not run your logic.

Everything else is just unnecessarily wasting performance. (to loop through 100+ Buildings to calculate no change for cache).
Please think about performance and when to logic needs to be run and when not. :thumbsup:

I know this logic is only triggered on built.
(But still it is not necessary to loop and touch the cache without reason.)

------------------

By the way:
I am not really happy what we are doing right now. :rolleyes:
(But ok I am currently not modding so you guys can do whatever you want.)

But still:
1) First you created a solution now that damages my immersion: Because now troops live in the City Hall (even during peace time).
2) From my point there was absolutely no benefit for gameplay (to me) and still performance gets wasted.
3) Also, why does stuff like this has to be implemented now before the beta release ?

-----------------

So ok, you already implemented your solution and it is a bit more versatile for modding.
But please at least also implement the changes I suggested above. :thumbsup:
 
Last edited:
Exactly, so please display the base values ike suggested above.
And then it should feel much better already.
I will try!
For me as a player, it was just counter to the usual logic that there is a "base value". The usual sizes always manage without one.
(The idea of a government palace being used as a warehouse is also somewhat abstruse. A "palace guard" (= military in the government palace) fits almost better. I personally find at least)

Please run the loop logic ONLY if the Building actually has a value for Barracks Space / Harbour Space.
Becuase ONLY then the cache needs to be recalculated. --> Otherwise do not run your logic.

Everything else is just unnecessarily wasting performance. (to loop through 100+ Buildings to calculate no change for cache).
Please think about performance and when to logic needs to be run and when not. :thumbsup:
I try also!

3) Also, why does stuff like this has to be implemented now before the beta release ?
You are right. I can also take that out for now.
Actually, the reason is only that I, as someone who didn't know your thoughts, came across it while translating and didn't really understand the system. From the thought "was probably something forgotten" was simply more
 
So: Have changed it :)

- Updating is now only done if the built building has corresponding bonuses.
- Base value is always added up, which makes the calculation more consistent (The main building has accordingly no more barracks places).
- Display in cityscape screen indicates base value and building bonus
 
hi @raystuttgart
you said somewhere (can't remember where) that military experts (veterans) in the city can also be teachers for students. now in my test game in one city there are veterans of the city guard in the garrison, but the unit that graduated from training cannot learn this profession. could you check why he can't do that?
 
you said somewhere (can't remember where) that military experts (veterans) in the city can also be teachers for students.
I think you are confusing something. :confused:
Barracks System has absolutely no influence on School System.

----------

Maybe you are thinking about this feature concept here which is however not implemented yet. :dunno:

It is one of the features I was originally considering for my next feature branch aka "Upkeep and Logistics".
(But I have not even yet decided when I will return to active modding and officially start working on it.)

Then garrisoned troops will be potential teachers for the new Training System.
(It will be separate from the School System though - see concept above)

-----------

Otherwise there used to be a very old exploit that if a Veteran Soldier was working as e.g. a Fisherman,
then the Education System would offer expert Veteran Soldier to be chosen when a Student was graduating from University.

But I consider that an exploit and never used it myself since it is kind of immersion breaking for me.
So I am not even sure if it is still working although I think that it still is because I also can not remember that we actively fixed it.

However once I would implement the feature mentioned above I would definitely test and eliminate the current exploit.
 
Last edited:
Yes, I'm sorry, I got confused.

Otherwise there used to be a very old exploit that if an Veteran Soldier was working as e.g. a Fisherman,
then the Education System would offer expert Veteran Soldier to be chosen when a Student was graduating from University.
it works.
 
Top Bottom