Page 1 of 1

First Impressions

Posted: Sat Sep 03, 2016 7:13 pm
by nweismuller
Digging into the diplo_issues.lua file, I note a 'bias' figure intended to set first impressions, and an effect labelled 'everybody loves Phidi' in the code. Is it intended that Phidi not get negative first impressions? Because, I can say from experience, Phidi get negative first impressions. If I am parsing the code in this section correctly, the effect is more like 'Phidi love everybody' than 'everybody loves Phidi'- making it so that when somebody contacts a Phidi empire, the Phidi will have a positive first impression of them AND have the relations boost for being 'Friendly'. I can't be entirely sure if this is a bug, which is why I'm asking for intent rather than reporting in the bug report thread.

Re: First Impressions

Posted: Sat Sep 03, 2016 7:24 pm
by sven
nweismuller wrote:I can't be entirely sure if this is a bug, which is why I'm asking for intent rather than reporting in the bug report thread.


It's a bug :oops: I'm referencing the right empire here, but, the variable I should be checking is 'other_empire.species', not 'other_empire.race'. (I use 'race' and 'species' inconsistently in the code, which is a problem I should really get around to fixing.)

As of the next patch, Phidi should always get positive first impressions. (Which is the correct intention, though Arioch or others may soon convince me that it's an unreasonable buff.)

That said, there have been outstanding diplomacy bugs in which I manage to confuse who's who one each side of the transaction. (Until yesterday afternoon, the trade charter revenues calculations were reversed, relative to my intention.)

Thanks for the report :) And bonus points for digging through the Lua.

Re: First Impressions

Posted: Sat Sep 03, 2016 8:23 pm
by nweismuller
Out of curiousity: how do trade charter revenues work, precisely? What would having things be reversed affect?

Re: First Impressions

Posted: Sat Sep 03, 2016 8:57 pm
by sven
nweismuller wrote:Out of curiousity: how do trade charter revenues work, precisely? What would having things be reversed affect?


Basically, right now, you're getting foreign trade routes equal to 20% of your partner's total trade routes (not including whatever routes *they're* getting from trade charters). Foreign trade routes generate twice as much trade income as domestic trade routes. So, if you have no transports assigned to trade, you get nothing from trade charters, but, if you do have a number of trade ships, and the empires you're trading with have large trading economies, it can work out to a significant bonus income. (Though to really take good advantage of it, you'll probably need to build more trade ships.)

The relevant raw code in trade_charter.lua is:

Code: Select all

function Empire.trade_charter_routes(empire,other)
  local r = max(2, round | .2 * other.raw_trade_capacity)
  if empire.species=='phidi'
    r*=2
  end
  return r
end


So, once again, Phidi are getting special bonus (they collect twice as many foreign trade routes as other species). The old bug was referencing 'empire.raw_trade_capacity', which meant that you were getting 20% of your own domestic routes as 'foreign trade routes' :oops: