trade points for connecting cities

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

trade points for connecting cities

Post by XYZ »

It would be nice if you get some extra trade points for connecting two cities by road and rail.
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: trade points for connecting cities

Post by Lachu »

In Civilization V, connecting cities with road gives gold to player and connecting cities with railroad gives production to both connected cities.
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: trade points for connecting cities

Post 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.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: trade points for connecting cities

Post 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).
~ AVL
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

Re: trade points for connecting cities

Post 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...
Post Reply