orlanth
Storm God. Yarr!
- Joined
- Nov 17, 2001
- Messages
- 1,805
I like this idea a lot. However I just realized something. Say we have a regional administration building, which can only be built in 1 out of 4 cities in the plotgroup. We build one in a plotgroup with 6 cities. We disconnect the city with the building and we are left with a plotgroup of 5 cities with no administration building. This allows us to build one again, disconnect that one and the remaining 4 cities are allowed to build yet another one. This allows 3 administration buildings in 6 cities when only 1 was intended. Yes it is exploiting a bug, but it still makes it possible. We will have to either deactivate the building when building requirements are no longer available or check plotgroup cities and all cities and only allow building if both fits the 1 out of 4 cities. Alternatively the "support" cities could point to their "master" city meaning once they point, they are stuck with that pointer unless the master gives them free, even if they are no longer in the same plotgroup.
Whatever we do, we should consider how to avoid exploitable bugs like this. My long term plan is to make M:C (+all mods using the same DLL source) playable on network and that will be no fun if somebody exploits bugs like that.
That's a good point. For situations where you want to set a maximum for a buildingclass, I'd say its best to use maximums on an x-per-civ basis rather than x-per-plotgroup to avoid that. Civ4Bts buildingclassinfos.xml has
<iMaxGlobalInstances>
<iMaxTeamInstances>
<iMaxPlayerInstances>
for National and World Wonders respectively, I don't see that in the Col version but IIRC RaR did have World Wonders. Are these still present in the code or would be possible to reactivate?
edit: After thinking further, it could still be possible to have buildings depend on local resource access if you have each building actually "absorb" or use x units of a Bonus from the local plotgroup, and trigger some consequence if there is a negative net amount in the plotgroup (number of that bonus supplied minus number used).
E.g. say a factory consumes 1 electricity and a powerplant generates 5, their "freebonusresources" xml values would be -1 and 5 respectively. If a given plotgroup contains 6 factories and 1 powerplant, the sum at end of turn would be -1, triggering a consequence (to penalize players who tried to "game the system" or got supplies disconnected by blockades etc.)
Possible consequences could be:
* charges a penalty of x units of gold (or Crosses, or Fealty, etc) times the number of undersupplied bonuses; representing increased maintenance costs & supply chain disruption
* creates a percent chance that one of the undersupplied buildings in the plotgroup gets destroyed due to lack of maintenance
(I was also thinking about inactivating a building's functions if it lacks needed access, but buildings can have so many functions this would be horrible to code. And it would be arbitrary to pick which of the plotgroup buildings was the "unsupplied" one.)