-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly calculate city borders based on culture #556
base: Development
Are you sure you want to change the base?
Conversation
0be3a62
to
23ec25a
Compare
This doesn't yet implement the benefits of specialists, but it does allow us to force certain tiles to not be worked. This is important when passing tiles between cities, for example. #541
Unlike with `.SAV` files, scenarios don't specify the tile assignments for each of the citizens in cities. To handle this we backfill them using the tile assignment AI. This is slightly complicated by fact that the `C7Engine` code can't depend directly on the AI logic, so we have to do some dependency injection via an `Action`. #541
This doesn't yet handle per-turn culture (we'll need building for that) but it should allow us to determine the proper border expansion levels in a following PR, as well as improve the tile assignment logic to restrict things to the BFC. #541
23ec25a
to
af0e501
Compare
IF you use an exponent of 1,8 it is working for all Culture size up to 20K (Which is a victory condition) but it breaks again slightly at 101K, no idea what formula they are using there. |
af0e501
to
6a473ea
Compare
@KulkoBSW nice! I've updated the code and PR description. How'd you figure that out? |
We now have nearly tile-for-tile accuracy with the real game for loaded save files! I've based this mainly off of https://forums.civfanatics.com/threads/the-eight-laws-of-border-dynamics.106882/, but haven't yet implemented rules 7 or 8
@TomWerner Have you tested it out with your code. I realize you still have that additional Sqrt in DeltaX/DeltaY and I am not totally sure how that will interfere with my test data. So the exponnent might still be slightly off. As for How I got this? Studying math in University. changing the exponent changes the roundness of the circle and there is basically no other valid Metric on the plane. So I just wrote an excel to try out different exponents until I found one that fit. |
6a473ea
to
9d605d0
Compare
Yeah, I tested it with a quick hack to exponentially increase culture, and it looked good, and I also loaded the save game I was using for testing and updated the screenshot. The |
I also checked it out on 5 editor saves and with that addition it works even for Culture 100K, so its probably the correct formula. |
We now have nearly tile-for-tile accuracy with the real game for loaded save files! There is 1 tile that is different from the real game to C7 in the screenshot below, which I've circled.
The difference I suspect is due to rules 7/8 from https://forums.civfanatics.com/threads/the-eight-laws-of-border-dynamics.106882/:
I'm not sure the best way to implement this without doing a second pass over all the tiles, but that may be what we need to do.
This change required changing how we track tile owners, from a player owner to a city owner, so that we can correctly check rank and culture comparisons.
#288