[MODMOD] PTSD v.2.6.x for We The People 4.1 - NEW: More or Less More or Less!

Ok, doing some searches and I found this good explanation.

Reading through that I have a few takeaways:
1. The YieldBoughtTotal can be positive or negative, so that should, in theory, allow prices to go up or down.
2. The Dutch trait works by halving the YieldBoughtTotal. So if you buy 100 goods, it only counts as 50.
3. EUROPE_MARKET_CORRELATION_PERCENT also impacts YieldBoughtTotal, in WTP it is set at 25, so if you are playing as England and Spain sells 100 furs, it counts as if you sold 25.
4. The formula is affected by your difficulty level, but his post wasn't clear on at which point that enters the formula.
 
He also copied over this formula, which is different than what I thought it was after reading your explanation. I may have misunderstood you, or it may have changed (that thread was from 2008 and about vanilla I believe). Either way, this formula looks better than what I had:
Code:
for each yield
{
    int newPrice = random(BuyPriceLow, BuyPriceHigh) + (YieldBoughtTotal / PriceChangeThreshold);

    if (random(100) < PriceCorrectionPercent * abs(newPrice - currentPrice))
    {
        newPrice = clamp(currentPrice - 1, newPrice, currentPrice + 1);
        setYieldBuyPrice(newPrice);
    }
}
 
Hmmm, I tried recreating this formula in Excel to do some tests there. I think I did it right, but the results are quite different from my in-game trial.

Here is the formula:
newPrice=((YieldBoughtTotal/PriceChangeThreshold)+RANDBETWEEN(BuyPriceLow,BuyPriceHigh))

=IF(((ABS((newPrice-currentPrice)*PriceCorrectionPercent)>RANDBETWEEN(1,100)),MEDIAN((currentPrice-1),newPrice,(currentPrice+1)),currentPrice)

I copied it to 260 columns (260 turns) and prices were far more stable. Refreshing it a few times gave me 13 trials, and clearly something doesn't match up since on average only 2-3 goods got cheaper and 2-3 goods got more expensive.
 
Last edited:
How is the stock adjusted? Does that use iEuropeVolumeAttrition at all? How does it interact with YieldBoughtTotal?

Some initial thoughts, having not yet nailed down the full formula yet:
1. With 25% of the other colonial powers' transactions counting against you, that can really add up the more AI players in the game. 25% sounds like a reasonable amount if you first divide by the number of players, but otherwise it escalates quickly. I don't know whether or not it is currently modified by player count, but that would be something to fix. Note that in the original game it was set at 0%, then WTP made it 10% and then 3 years ago they switched it to 25%.
2. I think the iEuropeVolumeAttrition should be higher across the board and/or should fluctuate as the game goes on.
3. Now that I've got more of a handle on the formula I suppose my hopes for the stock number are basically covered with the YieldBoughtTotal, but stock would at least be more transparent since you can see the stock amount. And adding in additional movement to the stock number through European production would make it more responsive and sensible.
 
The situation that I was perplexed about with the addition of buyPriceLow on one line and then subtracting it for no reason on the next line is not there... I must have hallucinated. The correct formula should be something like this.

For Each Yield:
BaseThreshold = PriceChangeThreshold x Handicap.EuropeThresholdMultiplier x GameSpeedStorage / 10000
NewPrice = BuyPriceLow + Random(BuyPriceHigh - BuyPriceLow +1)
NewPrice = NewPrice + YieldBoughtTotal / BaseThreshold

If (Random(100) < PriceCorrectionPercent x the absolute value of (NewPrice - YieldBuyPrice))
Set NewPrice but it can't be > YieldBuyPrice + 1; or be < YieldBuyPrice - 1

I haven't attempted to connect the Europe Stock to anything, though they obediently happen to fire right next to each other doing more or less the same thing, but one with a more visual impact and the others purring under the hood.

The Dutch Mercantile trait gets added to EUROPE_MARKET_CORRELATION_PERCENT.

I am not seeing where the markets might affect each other except that the king is being referenced as a parent 'player' to the human or AI players and basically owns the goods in all the different ports, including Port Royal, because there has to be an actual 'player' with gold to trade with.
 
Resource Depletion

A thought I had about balance/realism, along the lines of having lumber be an eternally renewable resource, is furs and wild feathers. It is strange to have a patch of forest adjacent to a major metropolis that provides enough furs to operate a massive coat industry. The colonists were not known for their sustainable harvesting practices.

It'd be neat for certain goods, like furs, lumber, gold/silver/coal/etc, fish, to degrade over time and then run out. Different goods could have different depletion rates. Coal & ore should last longer than gold or furs for example. But you shouldn't be able to harvest beaver from a single patch of forest for 200 years.

Fur trappers/mountain men could be units that are unbound from cities. They could wander the map, harvest furs from outside your territory and then bring them back, like fishing boats. It would also encourage players to trade more with the natives for furs. Both of these changes would be far more realistic and, I think, more fun. If you can overfish the waters around your city it'd make fishing boats more important too, which would also enhance realism & fun. Fishing seems too easy right now. With enough water squares and expert fisherman you can support a massive population.

Rebalance Raw & Finished Goods

I think also the balance between raw & finished goods is off. Quite often I can support 3-6 workers making finished goods from a single field worker. That just seems like an inverted pyramid. In the real world, the vast majority of workers at this time were in agriculture. The game is currently set up like a more modern economy where everyone works in the city and agriculture is like 20% of the workforce.

One of the things driving expansion In the real world was the need for more land to produce more crops that could be sent back east (or to Europe) to be finished into goods. I usually get to a point in the game where I can't keep up with the amount of raw goods I produce and end up just throwing away furs or sugar or something because I don't have enough storage space. I also don't have much need/interest in expanding except to add new goods or to just run up the score (which just increases the burden of moving around a ton of goods that aren't all that useful since the prices have collapsed).

I know you've already reduced the amount of goods map tiles produce, but maybe further reductions, or reductions in the modifier from experts & resource tiles are needed. Reductions in Founding Father bonuses too would be good.

Rebalance Storage Space

Finally, I'm always annoyed by the mid game by managing storage space. I'm always at my limit and end up losing goods to auto-selling. Reducing production, as I mentioned above, would help, but I think we could boost storage space as well. Not only is it pretty annoying to always be at your storage limit, but I'm quite sure that if we went back in time to talk to a colonist at the time they wouldn't tell us "gosh, our main problem in the colony is that we produce so much stuff we just can't find a place to put it! We're drowning in goods!" Maybe give more goods the tag that food & lumber have to not take up storage space (ore, coal, rocksalt, etc), and just boost the amount of space that warehouses provide. It'd be reasonable for various other buildings to provide storage space as well. Obviously, the stables should have a place to put animals. A fur factory should have space to put furs and coats. Separating out storage for different goods is probably not worth the coding effort or micromanagement in the game, but I think each production building in a city should come with some bonus storage space.
 
I agree that the wandering hunter/trappers would be more fun. I have taken a shot at implementing that in the distant past and gave up for some reason, but I probably have better skills to get it done now. I also tried to implement a depletion and renewal system to encourage crop rotation, but it also did not turn out well for some reason which I can't remember.

I also used to keep the raw resources at even lower production levels, but the AI did not fare that well with it; and it also seemed like most people frowned at it. Then I lowered the production rate of the manufactory goods in another hair-brained attempt to find balance, but maybe it needs a higher scale. Maybe 3, 5 and 6 products per turn for a regular colonist instead of currently 2, 4 and 6 (We The People is producing at 3,6,6 which I felt caused too big of a disruption in raw materials going quickly from too much to not enough at tier 2 building levels).

Yes, maybe storage space should be boosted (I am not a huge fan of worrying about whether there is enough room really, though I saw it as some kind of annoying game necessity to keep you awake, like kissing pinkies), and ore definitely can be kept in a pile out in the yard. I had a separate storage system for food in a past version which I liked to a certain extent (granaries behaved more like themselves); but I haven't decided if it was too much micromanagement to ship food around just for survival in low storage cities. It certainly felt more realistic. It might be doable to have a separate storage slot squeezed in near the stable, lets say, which can hold 100 animals and will not count towards the warehouse storage accumulation.
 
I agree that the wandering hunter/trappers would be more fun. I have taken a shot at implementing that in the distant past and gave up for some reason, but I probably have better skills to get it done now. I also tried to implement a depletion and renewal system to encourage crop rotation, but it also did not turn out well for some reason which I can't remember.
I think true soil depletion and crop rotation is a bit too nuanced to incorporate into the mod. I'd make the dividing line between renewable resources and nonrenewable resources. Two thoughts on implementing it:

1. This would probably be the hard way, but each terrain tile on the map would be generated with a random amount (within a preset range) of each nonrenewable good that can be produced there. X tile has 250 fur, 500 lumber, Y tile has 400 fur, 200 premium fur, 900 lumber, 700 exotic wood, etc. Production of those goods on the tile subtract from that initial value and when it hits zero that good can no longer be produced there.
2. The easier solution would probably be to just create a series of events that have a chance of triggering on any worked tile with a nonrenewable resource. If it triggers the event would just remove that good from the tile. We can adjust the chance of triggering based on the good and the terrain. A bunch of new event pop-ups would probably be annoying though, but it seems simpler to implement.

I also used to keep the raw resources at even lower production levels, but the AI did not fare that well with it; and it also seemed like most people frowned at it. Then I lowered the production rate of the manufactory goods in another hair-brained attempt to find balance, but maybe it needs a higher scale. Maybe 3, 5 and 6 products per turn for a regular colonist instead of currently 2, 4 and 6 (We The People is producing at 3,6,6 which I felt caused too big of a disruption in raw materials going quickly from too much to not enough at tier 2 building levels).

I'm not too concerned about the AI, especially since they don't have to deal with most of the constraints placed on human players (health, justice, etc), they are always hopelessly ahead of me in my games (unless they inexplicably found their first city on some useless scrap of land and then just never build more cities). I agree with having a smoother transition than WTP, 2, 4, 6 seems like a good way of doing it. Don't increase it. And consider this a vote in favor of lowering production for raw resources again.

Yes, maybe storage space should be boosted (I am not a huge fan of worrying about whether there is enough room really, though I saw it as some kind of annoying game necessity to keep you awake, like kissing pinkies), and ore definitely can be kept in a pile out in the yard. I had a separate storage system for food in a past version which I liked to a certain extent (granaries behaved more like themselves); but I haven't decided if it was too much micromanagement to ship food around just for survival in low storage cities. It certainly felt more realistic. It might be doable to have a separate storage slot squeezed in near the stable, lets say, which can hold 100 animals and will not count towards the warehouse storage accumulation.

I'm against creating a new line of buildings for food storage. There are more than enough buildings already. I'm ambivalent about whether food should take up storage space or not. I could go either way. If you did make it use storage space then if storage were boosted overall then it would be less micromanagement to provide food to small cities.
 
Screenshot (120).png
 
Back to the matter of EUROPE_MARKET_CORRELATION_PERCENT. I ran some trials using base WTP. I tested the price of goods over time. I did trials with different numbers of AI opponents on a huge earth map. For all the trials except the last one I didn't play myself, just hit enter every turn. You can see the prices collapse faster the more AIs are added to the game:
1734446197505.png

The more AI you have the greater the impact on market prices. If you like playing with more AI the market prices bottom out faster.

Here is another chart comparing my trial with no AI and no buying & selling from me (baseline), the Seven AI game with no buying/selling from me (AI) and the game with seven AI and me playing a normal game (player). A majority of the price drops you see in the market are entirely out of your control and have nothing to do with your own play in the game.
1734447396829.png


I see that PTSD has the EUROPE_MARKET_CORRELATION_PERCENT set at 35, which would only make the impact of the AI on the market greater.

I think 25-35% is a fine amount for the total impact of the AI, but that variable should be divided by the number of AI so it doesn't just build and build and become more determinate of the market prices than the player's own transactions. Should be fairly simple to divide by the number of players if we can find where that market correlation percent gets used in the code.
 
Back to the matter of EUROPE_MARKET_CORRELATION_PERCENT. I ran some trials using base WTP. I tested the price of goods over time. I did trials with different numbers of AI opponents on a huge earth map. For all the trials except the last one I didn't play myself, just hit enter every turn. You can see the prices collapse faster the more AIs are added to the game:
View attachment 712452
The more AI you have the greater the impact on market prices. If you like playing with more AI the market prices bottom out faster.

Here is another chart comparing my trial with no AI and no buying & selling from me (baseline), the Seven AI game with no buying/selling from me (AI) and the game with seven AI and me playing a normal game (player). A majority of the price drops you see in the market are entirely out of your control and have nothing to do with your own play in the game.
View attachment 712453

I see that PTSD has the EUROPE_MARKET_CORRELATION_PERCENT set at 35, which would only make the impact of the AI on the market greater.

I think 25-35% is a fine amount for the total impact of the AI, but that variable should be divided by the number of AI so it doesn't just build and build and become more determinate of the market prices than the player's own transactions. Should be fairly simple to divide by the number of players if we can find where that market correlation percent gets used in the code.
Suspected as much based on how Trade Good prices always fly in Africa at no fault of mine. I don't play on big maps so I probably haven't gotten to see the meltdown levels you have.

The weirdest thing is that of course EUROPE_MARKET_CORRELATION_PERCENT is being bandied around in the areas of code that mutter the most about mercantile percent and the like, so it really should be doing the opposite of what it is doing. I should be responsible for my own king's prices with perhaps a small influence here or there from other players. So, I don't think you really want to just divide and conk based on the number of players.

Right now --if we are going to stick with it-- each king has its own set of embargoed goods, so it would make sense if the unprotected ones get to be slightly affected by the trades of other players. Also, the prices at other Colonial players settlements are now slightly different based on if the product is under embargo or not for them (I think a 10% variance).

So think for me here again, or think further... What interrelated market-system would be the most realistic and most fun? That is always what I go for. A nice caricature that makes you feel like you were there, but not get too bored or too annoyed of being there.
 
Merry Christmas for all of you!
:xmastree:


@Ramstormp
Could you please send us a compiled DLL with activated new Movement-System? Unfortunately I don't have any skill at all for that.
I would like to see how it works with your mod. I'm playing with PTSD version 2.6 and PTSD Graphic-Art 3.1 (in case of relevance).
 
Merry Christmas for all of you!
:xmastree:


@Ramstormp
Could you please send us a compiled DLL with activated new Movement-System? Unfortunately I don't have any skill at all for that.
I would like to see how it works with your mod. I'm playing with PTSD version 2.6 and PTSD Graphic-Art 3.1 (in case of relevance).
Ok, gave you your parcel one day late... I think. Happy Other Day of Yule!
 
Hi @Ramstormp, that was quick! Thank you very much!! :thanx:

I really appreciate that you develop your individual interpretation of how the game should feel, like all the other approaches out there.
Thank you all enthusiasts! :bowdown:

And maybe one day even the Dawn-of-a-new-Era-Mod (DOANE) will be further developed. :please:
 
Hi @Ramstormp, that was quick! Thank you very much!! :thanx:

I really appreciate that you develop your individual interpretation of how the game should feel, like all the other approaches out there.
Thank you all enthusiasts! :bowdown:

And maybe one day even the Dawn-of-a-new-Era-Mod (DOANE) will be further developed. :please:
rewrapped the gift without bugs in it this time... hopefully. Apologies
 
Just wondering about the technical side: How much of the WTP development branch have you incorporated into your dll? I wonder how much PTSD is being developed in parallel with WTP,
in particular when it comes to bugs that have been squished by the WTP team within the past year.
 
Just wondering about the technical side: How much of the WTP development branch have you incorporated into your dll? I wonder how much PTSD is being developed in parallel with WTP,
in particular when it comes to bugs that have been squished by the WTP team within the past year.
No, I have not put any of the new things in there. My philosophy has been something like 'a modmod shall be based on an actual release unless there is something crashy or absolutely gamebreaking going on'. Not sure it makes sense, but it is what it is. My problem is that I am for some reason terrible at Git. I learn how to use it and then I forget and do something dumb that causes me to lose months of work.
 
Top Bottom