Page 1 of 1

trade points for connecting cities

Posted: Mon Mar 05, 2018 12:36 pm
by XYZ
It would be nice if you get some extra trade points for connecting two cities by road and rail.

Re: trade points for connecting cities

Posted: Mon Mar 05, 2018 7:50 pm
by Lachu
In Civilization V, connecting cities with road gives gold to player and connecting cities with railroad gives production to both connected cities.

Re: trade points for connecting cities

Posted: Tue Mar 06, 2018 6:47 am
by Arbogast
In Freeciv you get points for trade, according to distance AND research points. But you must know this so maybe I'm not understanding fully your message.

Re: trade points for connecting cities

Posted: Tue Mar 06, 2018 7:35 am
by Alien Valkyrie
I believe XYZ is asking about a bonus for a connection with the terrain improvements road and rail; not trade routes. You are of course correct.

As far as I know, at this point, there is no easy way to do this. Freeciv itself has no simple way to do this, so it would have to be done through lua scripting. Now, this is where I'm not sure if it's possible to figure out whether a tile has road or rails in lua script (and I'm too lazy to check right now), but then you could implement a pathfinding algorithm that can figure out whether there's a path, and then connect that to the turn change signal. Of course, if two cities are each connected to a large rail network, but those two networks aren't connected, this pathfinding will take a long time to realize that, so caching will probably be a good idea, but then you'll have to cache a lot of data per city.
Also, that's just for figuring out if two cities are connected. As for how to apply the bonus, I'm not sure. I don't think it's possible to apply stacking bonuses for an arbitrary number of connections, and in order to apply a bonus at all, I think we need to wait for some additional functionalities to be added to the lua scripting interface (which is already planned for a specific one of the currently developed versions, if I'm not mistaken).

Re: trade points for connecting cities

Posted: Wed Mar 07, 2018 10:53 am
by XYZ
@Caedo got what I meant.

Probably limiting the bonus to two connections would be sufficient, otherwise its too much micromanagement. But that only an implementation problem not a technical one...