Happiness from Luxuries

@ilteroi: Would it be much trouble to copy/paste the code for us to see? I couldn't find it on GitHub. (I'd be happy to make a nice chart of how it works with some sample values, for example.)
 
here you are. it's really very simple.

int CvPlayer::GetPlayerHappinessLuxuryPopulationFactor1000() const
{
//todo: add traits and policy effects here
return GC.getBALANCE_HAPPINESS_LUXURY_POP_SCALER(); //default 100
}

int CvPlayer::GetPlayerHappinessLuxuryCountFactor1000() const
{
//todo: add traits and policy effects here
return GC.getBALANCE_HAPPINESS_LUXURY_COUNT_SCALER(); //default 950
}

int CvPlayer::GetBonusHappinessFromLuxuries() const
{
int iTotalResourceWeight = 0;
int iCurrentWeight = 1000;
for(int iResourceLoop = 0; iResourceLoop < GC.getNumResourceInfos(); iResourceLoop++)
{
ResourceTypes eResource = (ResourceTypes) iResourceLoop;
if(eResource != NO_RESOURCE && GetHappinessFromLuxury(eResource) > 0)
{
iTotalResourceWeight += iCurrentWeight;
iCurrentWeight = (iCurrentWeight*GetPlayerHappinessLuxuryCountFactor1000()) / 1000; //reduce the weight for each additional luxury
}
}

//scaler is in 1/1000th
return int(0.5f + iTotalResourceWeight / 1000.f * getAveragePopulation() * GetPlayerHappinessLuxuryPopulationFactor1000() / 1000.f );
}

@pineappledan : the current numbers are just an initial guess, don't worry. but i think it's enough bonus happiness. you really can't compare with vanilla, in VP currently a luxury typically gives you 2 or 3 happiness for most of the game. and remember, this is just the bonus happiness. you get 1 base happiness in any case.

 
Last edited:
10% seems crazy low... Wouldn't 25% be better?

Also, the 95% saturation mechanic doesn't seem necessary. It's a punishment for going tall, which luxuries don't need because amassing luxuries already favors wide. Your own math indicates that the inclusion of a saturation limit caps out pretty early, and could pose a serious threat to tall players.
(3/2) = 1.5 bonus :c5happy:happiness per luxury with 15 :c5citizen:pop.
(15/10) = 1.5 bonus :c5happy:happiness per luxury with 18 :c5citizen:pop. (the exact same amount. bonus caps at 2.5 happiness per lux total?)
(24/18) = 1.3 bonus :c5happy:happiness per luxury with 20 :c5citizen:pop. (the luxury bonus has DECREASED while population continues to increase)
From what I understand of ilteroi"s post, the saturation is based on additonal luxuries, not population. This punishes wide, not tall. Increasing the average size of your cities increases the value of each luxury, while gaining additional luxuries become less and less effective.
 
the current numbers are just an initial guess, don't worry. but i think it's enough bonus happiness. you really can't compare with vanilla, in VP currently a luxury typically gives you 2 or 3 happiness for most of the game. and remember, this is just the bonus happiness. you get 1 base happiness in any case.
I misread the saturation as being scaled off of population, rather than number of luxuries. My mistake.

Still, however, I maintain that those numbers are small. Those numbers need to be bigger.

Parity with the current system should not be the goal I think, because the current system devalues luxuries. People don't care about luxury diversity, only their monopolies. Right now, the reduction in poverty from a +3:c5gold: on tile monopoly does more to eliminate unhappiness than the actual luxury mechanic. I can't speak for others, but I know that my early settling strategy revolves around securing 1 luxury, rather than securing an assortment of luxuries. It doesn't seem like there's much reward for risky play and forward settling in the new system; I used to do that to get more different luxuries, but now I don't even care.

The other issue is that trading luxuries should be the short term solution to patching up a problem with your happiness, but they don't work that way right now. You pay those extortionate rates, up to 30:c5gold: per turn, to other civs for enough happiness to manage through a problem with your needs. However, 2-3:c5happy: doesn't provide you enough cushion. You'd be far better off using the gold you would have spent trading luxuries, and rushing more buildings. The luxury saturation mechanic will also act against luxury resource's ability to act as this sort of emergency button. The AI also continues to overvalue luxuries, offering 10+ :c5gold: for something of little worth.

TL;DR - I maintain that the happiness from luxuries should be higher than it is now. 95% asymptotic Scaling on luxuries hurts their value as tradable resources.
 
well i really don't have a strong opinion on those balnce topics, i dont't play (well) enough. my goal was to ensure the late game isn't totally dominated by the bonus luxury happiness.

so, if you guys can agree on a set of numbers we can easily change the parameters for the bonus calculation. but i propose to play some games with the next version first and then we'll see. btw the numbers are in the db so you can even do experiments on your own.
 
Is it possible to expose it to custom mod settings, like how vase happiness is? People can play around with it easily then
 
I did a quick comparison of 10% population scaling vs 15% and 20% scaling, with and without the 95% saturation.

It's my opinion that a 15% scaler, with luxury saturation is a good starting point. If people think it's too much or too little it can be adjusted up or down from there.
 

Attachments

  • Luxury happiness.xlsx
    46.9 KB · Views: 167
What are reasonable average population, and reasonable # luxuries numbers for end game?

Say, 25:c5citizen: population and 10 luxuries? In that case:
10% pop scaler gives 3:c5happy:/luxury
15% pop scaler gives 4:c5happy:/luxury
20% pop scaler gives 5:c5happy:/luxury
 
you keep forgetting the base happiness contribution .... so let's say 15%.
No I didn't...
You can check the excel spreadsheet yourself; the flat +1 is in there
 
uh. my bad. can't check the excel from my phone. anyway, let's talk about money. how much should one happy face per turn be worth in gold? any dependency on net gpt?
 
I thought that was tied to AI logic, and was fairly independent of what the luxuries were worth re: happiness. I think the AI currently does a pretty good job of pricing luxuries based on where their own happiness is at, and seems fairly good at driving a hard bargain if you're hard up, or they don't like you. No complaints, and I can't honestly recommend any changes for that.
 
the thing is, the only take into account the base happiness for pricing, not the bonus happiness. so you'll pay comparatively more in the early game. which seems counterintuitive.
 
OK here are some numbers (thanks @pineappledan!):



My preferred option is the last one: higher base Happiness per Lux and scaling factor but much more powerful saturation, which hits Wider Civs (with access to more luxes) harder and makes Avg Pop. a more important factor.

@ilteroi's scaling is interesting: Civs with relatively few Luxes (say, a tall Civ with less Cities/territory/Luxes, to whom one more Lux would be pretty valuable) will be much more likely to go out and buy Luxes from wider Civs (one less Lux not so valuable).
 
Last edited:
OK here are some numbers (thanks @pineappledan!):

(coming)
That green number is illegible. :(

Is the penalty for the number of available luxuries ever needed? I mean, what does it try to achieve? Discourage the player from getting more luxuries when he already has enough? Prevent it from a player trying to have them luxuries all? Nerf Netherlands?

Wide empires are naturally nerfed by the scaler, which are the ones that usually get more luxuries. Tall empires usually lack the gold for purchasing them, and they aren't eager to find more luxuries when they don't have happiness problems, unless trying to gather golden age points.
 
Top Bottom