#1 04.04.2017 15:29:06

Posts: 3

caravaning shall be part of free-civilisation

The honourable Liu-Tingxun organised  an exploration of western worlds in the hope of bringing back new riches,
but instead found some giant horses and which a few decades later he traded for silk ...

since then 1/2 millions people visit towns in the middle of most arid deserts checking out where this incredible deal took place.

..and that is all (sigh),

although the 300 years of Tang dinasty did not suffer much defeats but a fair prosperous time, and a splendid deployment of artifacts...

My take is that caravans trading shall be part of this game;
but you, experienced players found it spoiling, and decadent,
by flooding with extravagant bonuses linked to distances...and other artificial factors
to the extra gold and bulbs lavishly received.

let have the option of cutting this from the rule-set ...:

I think the function get_caravan_enter_city_trade_bonus() does the job to retrieve bonuses from those :

  362   tb = map_distance(pc1->tile, pc2->tile) + 10;
  363   tb = (tb * (pc1->surplus[O_TRADE] + pc2->surplus[O_TRADE])) / 24;
  365   /* Trade_revenue_bonus increases revenue by power of 2 in milimes */
  366   bonus = get_target_bonus_effects(NULL,
  367                                    city_owner(pc1), city_owner(pc2),
  368                                    pc1, NULL, city_tile(pc1),
  369                                    /* TODO: Should unit requirements be
  370                                     * allowed so stuff like moves left and
  371                                     * unit type can modify the bonus? */
  372                                    NULL, NULL,
  373                                    NULL, NULL,
  374                                    /* Could be used to reduce the one time
  375                                     * bonus if no trade route is
  376                                     * established. */
  377                                    action_by_number(establish_trade ?
  378                                                       ACTION_TRADE_ROUTE :
  379                                                       ACTION_MARKETPLACE),
  380                                    EFT_TRADE_REVENUE_BONUS);
  382   /* Be mercy full to players with small amounts. Round up. */
  383   tb = ceil((float)tb * pow(2.0, (double)bonus / 1000.0));

with...get_target_bonus_effects() :...
  530 {
  531   int bonus = 0;
  533   /* Loop over all effects of this type. */
  534   effect_list_iterate(get_effects(effect_type), peffect) {
  535     /* For each effect, see if it is active. */
  536     if (are_reqs_active(target_player, other_player, target_city,
  537                         target_building, target_tile,
  538                         target_unit, target_unittype,
  539                         target_output, target_specialist, target_action,
  540             &peffect->reqs, RPT_CERTAIN)) {
  541       /* This code will add value of effect. If there's multiplier for
  542        * effect and target_player aren't null, then value is multiplied
  543        * by player's multiplier factor. */
  544       if (peffect->multiplier) {
  545         if (target_player) {
  546           bonus += (peffect->value
  547             * player_multiplier_effect_value(target_player,
  548                                              peffect->multiplier)) / 100;
  549         }
  550       } else {
  551         bonus += peffect->value;
  552       }
  554       if (plist) {
  555     effect_list_append(plist, peffect);
  556       }
  557     }
  558   } effect_list_iterate_end;
  560   return bonus;
  561 }

here are my takes...

* variable "bonus" would be therefore twickable in the ruleset using the city effect of ruleset_cache.effects[EFT_TRADE_REVENUE_BONUS] ?

* also tb could be further divided but more effective would be to return a cubic root (tb = pow(1/3, tb)) from get_caravan_enter_city_trade_bonus() ?

* as for changing the added trace surplus , "...->surplus[O_TRADE]", I would also not be so sure.

what do you think?


#2 04.04.2017 16:01:29

Posts: 241

Re: caravaning shall be part of free-civilisation

I have no clue what you just wrote here, but let me just say that I think that a one-time bonus upon caravan arrival into a city was never a problem and that the only issue is the fact that a trade route, once established, gives a solid profit without any further effort, forever.


#3 04.04.2017 16:28:23

Posts: 743

Re: caravaning shall be part of free-civilisation

In LT36 there was a bug that allowed caravans to be used. I think it was around T80 when it was already possible to make over 20 000 gold in one turn, as a one-time bonus. With that kind of bonus building almost anything else is meaningless. After a while it only got worse. Th one-time bonus was devastating and also was the actual bonus for the routes. Of course the permanent increase in trade was not that bad because there was almost no reason top build any markets or banks. The bonus was good enough even without those.

I guess that adding this on the line 559 might fix the problem for one time-bonus but it's hard to say what would be the correct value.

if (bonus>50)bonus=50;

By reading the comments I guess that's not the correct place. The extra trade the cities will get should also be fixed.


#4 06.04.2017 09:41:58

Posts: 3

Re: caravaning shall be part of free-civilisation

yes capping is a sweet way....but a tat blunt.
and also then towns "surplus[]" might be an issue... I am not sure how this is calculated...

* taking the point of Corbeau, how to replenish/perish trades other that knocking out the available city slots...?
does it means may be (without any efforts...) to redirect some of the city production to the management of a trade route?
meaning that the bonus/surplus[O_TRADE] could be linked to how much production is diverted to "building pseudo economy'.

anyway I have not much time to code all that..., but still will explore this "effects[EFT_TRADE_REVENUE_BONUS]" and check if it is easy to create one in the rule set (unless some freeciv gurus advise better!) ...

in all, the point seems may be, is to contain and balance a game to avoid reaching these 20K+ gold revenues/turn@T80 without paying another hefty price... on production/population growth.


#5 06.04.2017 15:06:24

Posts: 95

Re: caravaning shall be part of free-civilisation

I did some research on this issue a while ago. The objective was to find existing means to nerf the caravans wihtout making any changes in the code of the program. My results in short:

As can be seen from the code quote by ptizoom the one time bonus depends on distance between the two cities involved and trade surplus at the time of establishing the route.
This bonus is affetcted by the ruleset effect Trade_Revenue_Bonus. It is used in default ruleset to reduce the bonus if player has invented railroads.

type    = "Trade_Revenue_Bonus"
value   = -585
reqs    =
    { "type", "name", "range"
      "Tech", "Railroad", "Player"

You can make such rule without requirements to make it effective from the start for example. Also you can make additional rules (they stack) to punish even more those who have advanced in the game in any way you please.
In one of my test runs I had

  • Trade_Revenue_Bonus value set to about -2000

  • 15 player game (map size somewhat similarily defined as in LT)

  • maximum distance that map allowed between the cities

  • trade revenue of 22 in both cities

This resulted in one-time bonus of about 100 gold and bulbs.

The continuous trade increase depends also on the distance but also on the sizes of the two cities involved.
Another factor, scalable by ruleset, is the type of the route

; Trade settings
; IN = international, IC = intercontinental.
; For each of the trade route types:
; "pct"        - Trade income %. If this is 0, trade route cannot be
;                established at all
; "cancelling" - What to do to previously established traderoutes when they
;                turn illegal
;                "Active"   - Keep them active (although they will only
;                             provide nonzero income if illegal due to
;                             trademindist rather than pct==0)
;                "Inactive" - Keep them inactive
;                "Cancel"   - Cancel them altogether
settings =
  { "type",       "pct", "cancelling"
    "National",   100,   "Cancel"
    "NationalIC", 200,   "Cancel"
    "IN",         200,   "Cancel"
    "INIC",       400,   "Cancel"

So to reduce the extra trade you should change those percentages somewhat smaller. If one of them is set smaller than 100 it means that the revenue is less than the code would give.

Also you can set the amount of available route slots between 0-5 (if my memory serves) with ruleset effect Max_Trade_Routes

type    = "Max_Trade_Routes"
value   = 1

This should be adjustable with requirements. For example if you add reqs to the above effect

reqs	=
    { "type", "name", "range"
      "Tech", "Trade", "Player"

then the only possible route can only be established if owners of both cities know Trade.

So there are some real possibilities to make caravans and trade routes less ridiculous.  I think they belong to this game but should be heavily adjusted to keep them in balance with other things in there.

Last edited by HanduMan (06.04.2017 15:12:19)


#6 06.04.2017 16:07:39

Posts: 3

Re: caravaning shall be part of free-civilisation

sehr schön Handuman....

Wieder... off you go.!..inventing an even  greater game than LT37, and mostly one I wont loose straight away or make alliance with Superman.

I might still suggests this tb=power(1/3,tb)  to the masters of Civilisations.

Last edited by ptizoom (06.04.2017 16:10:54)


#7 06.04.2017 19:46:53

Posts: 743

Re: caravaning shall be part of free-civilisation

I'm fairly sure we won't be adding caravans to LT38 but adding them to LT39 is possible. The reason is that LT38 is supposed to start relatively soon (this time, really:) after LT37 has finished or is in endgame.

We need to be extra sure that caravans work properly if the routes are restored. I didn't test any of that but does it scale properly? Close enough cities should give some trade but not too much while far away cities should give just some more.

ptizoom, you could have also allied with mmm2 or maybe with the poor old & ancient East Germany tongue

Really, allying with at least some players is usually the key to the victory. The more the better but that's not all there is to it. More players, more vision, ideas, production, area, players to remain strong if someone is attacked and loses cities. This is also the reason why alliance size is usually limited. Smaller alliances let less players to team up. Unfortunately the best and only really effective way to limit alliance sizes is to limit the number of winners...


#8 07.04.2017 10:17:52

Posts: 116

Re: caravaning shall be part of free-civilisation

I have some ideas for how caravans could really add to the game.

I think there should be no trade routes and crazy bonuses but caravans should be used to moved fixed amounts of resources from one place to another, including to other players with a reasonable bonus.

So for example, you could build a caravan for 20 shields and then move to another city, where it could be disbanded for 20 shields, 20 gold (Same as building coinage) or 20 food. Within your own nation there is no net bonus, its just moving stuff around. (Maybe food would need to be limited to prevent massive growth advantages..)

However, if a caravan is sent to another nation there could be a bonus, maybe 150 or 200%, to encourage trade between players. But this should be fixed and predictable and gives resources to the receiving player, not the one who built it. Adding a minimum distance would also require significant journeys, not just 2 cities next to each other exchanging caravans.

Finally, make them totally capturable, perhaps even if defending units or ships on the same tile are killed. So there is incentive to send trade missions between nations, for the resource bonus and to assist allies, and there is incentive to commit piracy and steal the trade on route. smile


#9 07.04.2017 10:44:45

Posts: 241

Re: caravaning shall be part of free-civilisation

Another idea for caravans, trivial to implement, but may add to game slightly.

Simply make them cheaper, say, 20 shields, and then when they add to wonder, they add 20 shields. Not 50. With 50, some cities take forever to build them, some very good cities are blocked for a few turns. Reducing cost/benefit would make it much more flexible.


Board footer

Powered by FluxBB