AssignStartingPlots defaults for VP

Here. I've tweaked the value each deposit can yield to be something random between 1 and the max value and also fixed the account for the total number of strategics. It's working fine for me on Continents.
The change:
Code:
                            -- added by azum4roll: give some variance to strategic amounts
                            local rand = Map.Rand(99, "ProcessResourceList - Lua") / 100
                            local quantity = res_quantity[use_this_res_index]
                            quantity = math.max(1, math.floor(1 + 0.5 * quantity * (1 + rand))) --tu_79 fix
                            res_plot:SetResourceType(res_ID[use_this_res_index], quantity);
                            if (Game.GetResourceUsageType(res_ID[use_this_res_index]) == ResourceUsageTypes.RESOURCEUSAGE_LUXURY) then
                                self.totalLuxPlacedSoFar = self.totalLuxPlacedSoFar + 1;
                            end
                            self:PlaceResourceImpact(x, y, impact_table_number, res_min[use_this_res_index] + res_addition);
                            placed_this_res = true;
                            self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] = self.amounts_of_resources_placed[res_ID[use_this_res_index] + 1] + quantity; -- tu_79 fix

This version works great :). No issues so far.

Spoiler :
20200913052205_1.jpg
 
Not sure. It works better when deposit sizes are big, since you are discounting a percentage. And you are giving a 20% chance to have something bigger, 20% for something smaller, 60% for the stated max value.
As I've put this, there's a full random range between the max value and half the max value, so it's easier to find horses with stacks of 3 and 2, which gives more variety.
A linear random distribution of a small integer simply won't work well. When you set the major deposit size to 7 (for coal and aluminum), it averages 5.286 with more chances on 4/5/6 than 7, which is counter-intuitive for people who want to change the values (no integer value you set can average to 7). And by making every deposit smaller while keeping the total amount you have to generate more deposits on the map, which is exactly what we want to avoid.

And we don't want that many 2-sized major deposits anyway, that's for minor deposits.

EDIT: Wait, Map.Rand(99, "ProcessResourceList - Lua") / 100? That ranges from 0 to 0.98. And math.max(1, math.floor(1 + 0.5 * quantity * (1 + rand))) doesn't work as you intended. It never rolls 2 for quantity = 4, for example.
 
Last edited:
doesn't work as you intended
Oh? But it works! Just check it.
Say rand throws 0.90:
1 + 0.5 * 4 * (1.90) = 4.8 . Floor of 4.8 is 4.
And we don't want that many 2-sized major deposits anyway, that's for minor deposits.
Since there are already some deposit with 2, yes, it makes sense to not have that many deposits with 2 horses. I can change it so the range is 75% to 100% of max value.
 
Last edited:
Oh? But it works! Just check it.
Say rand throws 0.90:
1 + 0.5 * 4 * (1.90) = 4.8 . Floor of 4.8 is 4.

Since there are already some deposit with 2, yes, it makes sense to not have that many deposits with 2 horses. I can change it so the range is 75% to 100% of max value.
Then why not just range it from 80% to 120%, like it already is? The proper formula for rounding x half up is math.floor(x + 0.5) btw.
 
Then why not just range it from 80% to 120%, like it already is?
Let's do the math
Code:
                                   if (rand >= 0.8) then
                                        quantity = math.floor(quantity * 1.2 + 0.5)
                                    elseif (rand < 0.2) then
                                        quantity = math.floor(quantity * 0.8 + 0.5)
                                    end
it does the following: the 20% of the times, floor of quantity * 1.2 + 0.5. When quantity is 4, it's floor of 5.3, thus 5. When quantity is 7, it's floor of 8.9, thus 8.
20% of the times it is floor of quantity * 0.8 + 0.5. When quantity is 4, it's floor of 3.7, thus 3. When quantity is 7, it's floor of 6.1, thus 6.
So, for max value = 4, of every 5 deposits, 1 has 3 horses, 3 have 4 horses and 1 has 5 horses.
For max value = 7, or every 5 deposits, 1 has 6 coal, 3 have 7 coal, 1 has 8 coal.
Horses : 3 - 4 - 4 - 4 - 5
Coal : 6 - 7 - 7 - 7 - 8

What I intended was the following distribution:
Horses : 3 - 3 - 3 - 4 - 4 - 4
Coal : 5 - 5 - 6 - 6 - 7 - 7

I'd say it's a matter of taste.
 
I don't think there needs to be less coal around. Perhaps something like

Horses: 3 - 3 - 3 - 4 - 4 - 4
Coal: 6 - 6 - 7 - 7 - 8 - 8

Would be good IMO. There is a large a difference between the amount in major and minor coal deposits though, it might be nice if they were a bit more reliable. E.g. if major deposits have less on average (5 to 7), then minor deposits might have more to compensate (2 to 3, or 2 to 4).
 
Last edited:
Coal design is totally intended. If you grab a minor deposit with a new city it pays for itself (factory+seaport/train station). Only if you grab a major it fuels your other cities.

The other large major deposits are oil (6) and aluminum (7). Aluminum minors are already 3 and there are 3-oil tiles in the sea. Lategame resources are designed to be in large amounts to make lategame settling viable.

We don't need even fewer horses. It's already in low amounts. They're just even more concentrated at grass/plains than before.

Remember the range of strategic size is just a flavour. They're still supposed to be averaging their designated value, and be that value most of the time. Don't think too much of it.
 
OK. I get the intention.

I'm just saying that given an option I would very much prefer more mid-range deposits to some little ones and some big ones. It can be annoying if you settle wide and get three deposits in your territory... but each of them only has 2 coal. Whereas your neighbour who has far fewer cities has more coal coming from their single mine.

Aluminium and oil I don't care so much about (I can usually get some but until I start building spaceship parts it's not essential). Horses don't vary so much that minor vs. major makes a huge difference. But with coal (and sometimes iron), the distribution can feel frustratingly arbitrary.
 
Last edited:
That's minor deposits for you. Minor deposits happen when the major procedure doesn't generate enough strategies for the players. Setting major deposits with a small amount generates more deposits. But if major deposits are too big, then some players don't see horses around. It's a delicate balance, that's why feedback is necessary.
 
I like the resource plot imbalance, mainly for the effects of the asymmetry on strategy, particularly war.
 
OK. That's fair.

Btw, @tu_79 did your script do anything related to grassland-jungles. I'm not seeing them in general but I am seeing the under luxury resources sometimes. Not sure what is intended.
 
Did you overwrite the full package of modinfo, AssignStartingPlots and FeatureGenerator?
 
OK. That's fair.

Btw, @tu_79 did your script do anything related to grassland-jungles. I'm not seeing them in general but I am seeing the under luxury resources sometimes. Not sure what is intended.
I copied the file azum4roll provided called featuregenerstor and it works turning some jungles grasslands into plains, but rather randomly. I wish it would follow some logic instead but I haven't made up my mind yet.

About the deposit sizes, another thing to consider is that making something happen 20%, 20% and 60% only leaves room for 3 values. It's not a problem when the max value is 4, but with coal you can't have deposits ranging from 4 to 7.
On the other hand, it's easier distribute the deposit sizes among these three values. The function I used give linear results, any other distribution requires the use of quadratic functions. Not impossible, but harder to get the fine results you might expect.
 
I mean, you can do linear, but make it 80%-120% to keep the average value intact.

Any logic with feature generation should be kept in mapscripts. FeatureGenerator is mostly random generation with simple criteria.
 
I mean, you can do linear, but make it 80%-120% to keep the average value intact.

Any logic with feature generation should be kept in mapscripts. FeatureGenerator is mostly random generation with simple criteria.
I want to note that I've seen several stacks of horses with 5 units this patch. I think 2 or 4 is the ideal.

Stacks of 5 horses were not asked for. That's why I lead towards having them be 75% to 100% of max value, where max is 4 for horses, provided some minor deposits are already happening with smaller stacks.
 
We'll have to place more horse deposits if we lower their amounts. Is that ok for everyone? I thought our aim was to reduce that.

And is 5 iron fine?
 
5 iron is great IMO.

My understanding was that the total amount of horses was going to be reduced. I don't know how other people feel though.
 
Currently iron comes in stacks of up to 6. So I think 5 should be okay.

My understanding was that the total amount of horses was going to be reduced. I don't know how other people feel though.
I'd prefer if the number of horses was around 2/3 the current amount.
 
I don't know what the "current" amount is (I guess the stable version since this one doesn't have 6 iron), but now (with my version, not tu_79's) there are around 75 horses on the map in average.
 
Back
Top Bottom