-
Notifications
You must be signed in to change notification settings - Fork 1.7k
City-States Influence rates; Wary status; Proximity calculations #5198
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
Conversation
yep, I don't get why this is failing. |
Refactored around that How do you not get complaints about
This is kotlin. Do not use Java min, use kotlin min. Likewise...
Remind me to throw these functions out, kotlin has premade ones in Duration... |
Bad luck, the action VM didn't have healthy internet or jitpack.io was down... |
So, no, you copied it so now the costly cr.. ahem, runs three times instead of one. You know, I've meant to optimize that as it can waste around 25% of GameStarter time, but never got around to it? If you want, do it now. Move the assignContinents call to before addCivStartingUnits, produce both the continent numbers and that BTW, jitpack is still down. |
No, jitpack just takes over a minute to deliver a 300 byte file. I've retriggered the check though chances aren't good that the VM has a long enough timeout. |
so this implements landmasses? |
Depends on what you mean. We will end up with a bunch of landmass IDs that are saved |
BFS is now only run once. The performance gain is actually slim:
(When generating a huge pangaea, standard settings, seed 1111111111111) Each |
@@ -33,6 +33,7 @@ class TileMap { | |||
var mapParameters = MapParameters() | |||
|
|||
private var tileList = ArrayList<TileInfo>() | |||
val continentSizes = HashMap<Int, Int>() // Continent ID, Continent size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what Mt. Fuji and Sri Pada placement could use 👍 (#5204)
Indeed. I remember baselining a monster map totaling 10 seconds where resources and rivers were 60-70% and a big chunk of the rest was those landmass-big-enough runs, so I assumed a total gain of at least 10% of the entire GameStarter should be possible. Maybe I measured wrongly. |
Also |
Here's what I came up with.
|
This looks good! |
Part of #4602
This PR implements proper influence resting points, decay and regrowth rates.
It also implements the Wary Of mechanic where city states have a chance to grow wary of you after you've attacked at least two, this lowers their influence resting point by 20.
To do this I also had to implement proximity calculations where civs are graded as being Neighbors, Close, Far, or Distant to each other. I'm sure we'll find more uses for the in AI later, so it needed to be implemented anyway.
To do this I also had to implement a way to figure out if two cities are on the same continent. I decided to add a
continent
field to TileInfo which is assigned at map generation. Two tiles are on the same continent if their continent numbers are the same. Again I'm sure this will be useful down the line.So quite a bit of code for a small functionality at this time.
A note about Permanent War: In some sources you can read about city-states banding together in Permanent War against attackers. This is only true for vanilla Civ V, in G&K and later this was removed in favor of the Wary Of mechanic.