Civ4 Reimagined

Not really. Floating point calculations are... problematic because floating point numbers are infinite where as their computer representation is not. Long story short if you have say 13.37 that might very well not be equal to 13.37 because even though all you care about is the .37 and all you enter is the .37 and your math newer does anything with any other decimals somewhere in the memory one of those is 13.370000001 and the other is 13.370003. That's why you newer ever use floating point numbers for storing anything critical like coordinates or money. *He said, painfully reflecting on the fact people do.*
My point is that, unless I'm severely mistaken, floating point calculation is deterministic, i.e., addding/multiplying/... two certain floats always gives you the same result (on the same machine). This is completely independent from what we assume these three numbers are or what we want them to be. As long as all computers in a multiplayer game are wrong in exactly the same way, there's no OOS. The problem that you seem to describe, that different calculations have different results even though they shouldn't (e.g., 0.1*3 != 3/10), also doesn't have anything to do with OOS errors, since every computer executes the same sequence of floating point operations.
 
My point is that, unless I'm severely mistaken, floating point calculation is deterministic, i.e., addding/multiplying/... two certain floats always gives you the same result (on the same machine). This is completely independent from what we assume these three numbers are or what we want them to be. As long as all computers in a multiplayer game are wrong in exactly the same way, there's no OOS. The problem that you seem to describe, that different calculations have different results even though they shouldn't (e.g., 0.1*3 != 3/10), also doesn't have anything to do with OOS errors, since every computer executes the same sequence of floating point operations.
The key point being on the same machine. OOS issues are to my understanding what happens when two machines have different values for the same thing and the game can't decide who is right. So potentially floating point errors might be a contributing factor.

Really the entire implementation of floating points on binary architectures is deeply flawed. Not that I could do any better but it is flawed.
 
Great game. Thanks for all the hard work to the team!
 
Last edited:
I just downloaded this mod and have been trying to get it to work however I am receiving error messages upon loading the mod. Im not sure if anyone here is still looking over this thread or whatnot, but if someone could help that would be great. When reading the XML files, my computer shows these error messages:
Screen Shot 2021-08-13 at 3.04.38 PM.png
Screen Shot 2021-08-13 at 3.04.31 PM.png

I've tried reinstalling the mod and installing a previous version however neither has worked. My only theory is that it is because I am playing on Mac instead of a PC but honestly I'm clueless and could use some help because I'd really like to try out this mod. This is my first time installing a mod for Civ4 so perhaps i'm making some sort of rookie mistake.
 
I just downloaded this mod and have been trying to get it to work however I am receiving error messages upon loading the mod. Im not sure if anyone here is still looking over this thread or whatnot, but if someone could help that would be great. When reading the XML files, my computer shows these error messages:
View attachment 605322View attachment 605323
I've tried reinstalling the mod and installing a previous version however neither has worked. My only theory is that it is because I am playing on Mac instead of a PC but honestly I'm clueless and could use some help because I'd really like to try out this mod. This is my first time installing a mod for Civ4 so perhaps i'm making some sort of rookie mistake.

I'd also like to add that i have received other error messages about the xml files located under the "text" folder however these were the only two that popped up on my most recent attempt to load the mod.
 
Since I saw this post while doing some checking, AND I'm not sure if the OP is active:
This mod is not going to run on a Mac.
Basically all mods, which contain AI improvements (and a bunch of other mods too), cannot run on a Mac, because...er .... the short version is that files are loaded differently on a Mac, which includes the AI part. This is connected also to other parts, e.g. modifications in how the XMLs are loaded.
In short: You'll be out of luck with this mod, sorry :(.
 
Since I saw this post while doing some checking, AND I'm not sure if the OP is active:
This mod is not going to run on a Mac.
Thanks for troubleshooting. :thumbsup:
I'm still checking occasionally, but wouldn't have been able to identify the mac issue anyhow, so it's great that you stepped in.
 
Is there a mechanic in place for historical research times? It seems from my games that there is a bit of a wall in research before the Renaissance, and I notice in the current game that it may be due to the game timer.

Also could we get a game option that disable cultural linked starts?
 
Scrach that, I was just producing too little research. Still there is a fairly big price step up from medieval to Renaissance.

My impression from two games at emperor difficulty is that conquest may even be more dominant than in vanilla. Considering tech transfer and slave workers, it seems optimal to just conquer as much as possible. Couple that with the hyper-aggresive ai (is kind of funny to see an ai just chain wars like no tomorrow) it seems the only optimal strategy in higher levels is to be very aggressive as well. I agree that conquest should be dominant due to risk- reward, but I think that conquest shouldn't always be the optimal strategy, excluding isolated starts. I have some suggestions in this regard:

- Whipping should only be allow for buildings. Whiping is somewhat of a problematic mechanism, and while the mod allows some alternatives, slavery at the end of the day seems to be the superior choice. In that regard, I think that limiting whipping to just buildings would make building units a bigger strategic choice, but also contain a little bit the snowball effect of more cities- more pops - more whips

- In similar vein to Adv civ, I think culture shouldn't be removed on player elimination. Conquered cities should require garrisons until some culture conversion take place.

- A smaller one, but I think that healing on promotion should be removed. Honestly it is a bit weird realism wise, and allow to keep momentum for offensives while making your troops harder to kill.

- Tie unit production cost with population. I think that like how resources are tied to cities, your ability to support units should be limited by your population. Considering the use of dimishing returns on the mod , the idea would be fairly similar: your population can support x number of units, and beyond that point each additional unit cost increasingly more, representing the difficulty of finding more able bodies to support your troops. So for example, have each pop support one military unit without additional cost, but each additional unit increases cost by 1.~^X, with X being the number of units over the support cap. Alternatively, there could be two break points: one after which cost increases linearly, and one adter which cost increase exponentially.

I think this mechanic could bring some neat advantages to the game. First and foremost it would make military snowballing harder, specifically if tied with culture so that you can only recruit units of your culture pops. So conquering enemy cities could leave you exposed to counterattacks. Even without this mechanic in play, it could limit the upper limits of unit building, and if done correctly, it could allow defenders to actually win wars of attrition. Secondly it could be neatly tied with the military civics, so for example militia giving a flat increase per city but lower per pop support, levied armies giving extra unit support at the cost of extra war :c5angry: while professional having smaller better train armies. Mercenaries could get a reduced per pop support but allow for buying mercs at a fixed cost an finally conscription could allow the biggest armies at the cost of economic maluses.

I think this mechanic could specially tied in with the cultural revolts in while making conquest still important, making snowballing out of it harder to pull out.​
 
Thank you for the great feedback! There are definately some interesting suggestions. Conquest is for sure a very strong strategy but did you also try colonizing? If you play on a Totestra map with new world continent this is also a very appealing strategy (depends even more on Slavery civic though).

I actually quite like the idea of allowing slavery for buildings only. This would be quite a drastic change but worth considering especially because gold hurry already distinguishes between units (Mercenaries civic) and buildings/projects (Capitalism civic). Concerning unit costs: What you suggest already exists for unit upkeep but maybe this can be tweaked a bit more. Tieing production capabilities to population is also interesting but I would try something else first: Right now resource ratios are are solely based on population and tech progress which is fine for health and happiness resources. But for strategic resources the number of units consuming the resource should probably be taken into account as well. So if you have a lot of tanks/plains etc you should need more oil to support them. Basically when we implemented the resource ratio mechanic we had lots of different ideas how to refine it but went with the simplest solution first. And then it just worked so well out of the box that we didn't touch it again.

Also you probably noticed that there hasn't been much progress here lately. The team now only consists of one person (me ^^) and I am only working on this when I have time and motivation. I definately want to release one more version with some bugfixes and minor changes. And I am also working on another feature which I hope to finish soon.
 
I did actually reach the point of colonization but actually prefer to focus on the continent in both games. I think that return of investment in both terra and totesta maps favour focusing on the continent, specifically if the others Ai are killing potential rivals.

Yes resource consuption for units may work as well, as offensive units tend to require resources. The only issue I can see is that snowballing actually increase the amount of resources you get, so the effect will widly depend on if who you are invading have the resources in the first place. Still I think it makes sense, as oil access for example is a very important strategic issue.
 
Hey, I have a question. Which files from the source code should I edit to add a change from Kek-Mod (specifically, this one: 'Enemy units present in city are no longer deleted when city flips, they are just bumped out of enemy borders') ?
 
Hey, I have a question. Which files from the source code should I edit to add a change from Kek-Mod (specifically, this one: 'Enemy units present in city are no longer deleted when city flips, they are just bumped out of enemy borders') ?

I do not know the changes since I mod Civ4Col not Civ4BTS but from what you describe it is most likely: CvCity.cpp
(Since it sounds like City related logic. I would definitely start checking there.)
 
Last edited:
The source and Kmod both are still missing things like the project files (.sln), the deps folder containing boost etc. And without those I can't compile anything.
 
The source and Kmod both are still missing things like the project files (.sln), the deps folder containing boost etc. And without those I can't compile anything.
I think you can just copy those files from Beyond the Sword/CvGameCoreDLL folder but I also added them in the latest commit.
 
A while ago I made a copy of the repo and pushed it to my github. I could provide the build system (project files and other stuff) if you guys need it.
OTOH I think you can simply copy AdvCiv's project folder. Just copy paste the project folder and adjust the paths as needed.
 
Hmm... a "fictitious" range in combat mode is a "must have", yes. Given the fact that the difference in firing range even between a javelin thrower and a three-inch gun is 300 times, it is directly impossible to display this. Will you help me... rob you a little:crazyeye:? Please.

The problem is that I could not determine which part of the code is responsible for the "unpunished" attacks. Can you tell me where to look? Next, I'll try to extract the code myself.
 
Last edited:
Hmm... a "fictitious" range in combat mode is a "must have", yes. Given the fact that the difference in firing range even between a javelin thrower and a three-inch gun is 300 times, it is directly impossible to display this. Will you help me... rob you a little:crazyeye:? Please.

The problem is that I could not determine which part of the code is responsible for the "unpunished" attacks. Can you tell me where to look? Next, I'll try to extract the code myself.
That part of the code is super ancient and not very sophisticated. If I would design it from scratch I would do it differently. Probably I would define a new "range" property for units (right now it is just based on first strikes). The combat bonus is basically just a one liner in CvUnit::maxCombatStr. Look for:
Code:
// Civ4 Reimagined: Ranged Combat for collateral units
For the modifier to be displayed look into CvGameTextMgr and search for
Code:
TXT_KEY_UNIT_RANGED_ATTACK
. If you also want the bow symbol to show up you have to dig a bit deeper. I think it was in python somewhere.

I think we also made a few AI changes to encourage the AI use that feature properly. Unfortunately we designed this feature not very modular so it is buried somewhere deep into the AI code I fear.
 
Top Bottom