Sea Tunels development thread

So in short:

If tunnels don't merge land masses, the AI doesn't understand it can use them; but if we want to teach the AI to do so, it will require a land mass merging - with all the problems you listed, right?


So, out of curiosity: What would the AI do if I'd build a tunnel from southern Spain to North Africa? They were a single land mass before, so will the AI get this new shortcut?


And if I build the tunnel there with the land mass merging in place, would this divide the single big ocean into a really big ocean and the mediterean sea?
Wasn't... uhm... "this guy that wanted to develope a post-map-generation modify program to better simulate terrain" working on dividing water bodies into gulfs and such?
 
So in short:

If tunnels don't merge land masses, the AI doesn't understand it can use them; but if we want to teach the AI to do so, it will require a land mass merging - with all the problems you listed, right?
Correct.


So, out of curiosity: What would the AI do if I'd build a tunnel from southern Spain to North Africa? They were a single land mass before, so will the AI get this new shortcut?
It should understand that sort of shortcut just fine. The problem is in thinking other area targets are automatically out of reach, not with finding the ability to use the tunnel.


And if I build the tunnel there with the land mass merging in place, would this divide the single big ocean into a really big ocean and the mediterean sea?
No. The tunnel doesn't change the tile type so the water area definition is still fine. But if we had a land tile suddenly pop up there it indeed would need to split the water areas. We were having a crash when something similar would happen for landmasses, a chokepoint land bridge between two sections of a landmass could be destroyed and reverted to a water tile by one of the nuclear megaweapons and it would therefore need to add another area to define the newly split off land segment and it would fail somewhere in that process - might not have even been trying and may have still considered it the same 'area' which would've caused major headaches for trade and unit movement that could've been the problem causing the crash. Koshling was aware of the issue and I'm not sure if he ever did anything with it or not.

Wasn't... uhm... "this guy that wanted to develope a post-map-generation modify program to better simulate terrain" working on dividing water bodies into gulfs and such?
He was... I'm not sure if he intended to define them all as different 'areas' or what though - that would certainly have enforced some new naval AI processes and even if his water tile segmentation wasn't via the official 'area' definitions, it could have at least enabled some new naval AI considerations to be made that could drastically improve the ability of the AI to more properly distribute its navies.

I do wish primemOver had stuck with it... (maybe he has and he's still working on it and we just haven't heard from him on the subject in a long time? I dunno...)
 
I don´t really understand part of the discussion here (especially Dancing Hoskuld´s). It sounds like "tunnels shouldn´t be in because...". But we are already a step further: Sea tunnels are in the game for a long time now and I think they are cool even with all problems associated with them. So any improvement here would be very welcome.
My suggestion: Leave the complicated stuff for later and do what looks to be simpler (in my eyes!), stop the notorious spamming of tunnels by the AI and allow tunnels only in shallow water until Transhuman Age.

Please go on with this discussion, it is really great to see that things are improving here!

BTW: There is a tunnel that connects continents, the new railway tunnel in Istanbul, Turkey connects Europe with Asia.
 
BTW: There is a tunnel that connects continents, the new railway tunnel in Istanbul, Turkey connects Europe with Asia.

Sorry for nitpicking but Europe and Asia were already connected over land via Russia.
 
The whole point about connecting contintents was purely for ingame purposes, where one continent = a connected landmass. So ingame, Africa, Europa, Asia is ONE big continent.

The "complicated stuff" is basically:

- AI only knows that it can move units from one continent (ingame) to another via boat.
- If you build a tunnel, it won't use it, because it sees the destination as another continent (ingame again), so it can only be reached by ship - despite having a tunnel there!
- A tunnel could connect two landmasses and merge them together, but this will crash the game.


TL;DR: AI is too stupid to use tunnels and a fix for that isn't simple.
 
The whole point about connecting contintents was purely for ingame purposes, where one continent = a connected landmass. So ingame, Africa, Europa, Asia is ONE big continent.

The "complicated stuff" is basically:

- AI only knows that it can move units from one continent (ingame) to another via boat.
- If you build a tunnel, it won't use it, because it sees the destination as another continent (ingame again), so it can only be reached by ship - despite having a tunnel there!
- A tunnel could connect two landmasses and merge them together, but this will crash the game.


TL;DR: AI is too stupid to use tunnels and a fix for that isn't simple.

I think the key point its the way the IA think the roads. The ia just build up roads everywhere.

I have a ideia: and if the IA just constructs routes connecting tiles with the tag "needs a route"?

And another routine make the IA connect cities and forts? A tile with a improvement in the river tile dont will receive a route. The seas will not receive a route..and another rotine can make the IA aways try to walk before others options of reach a plot.
 
I see stuff on this way: the ia detects a not routed improvement, calculates the short way to walk to this tile, store the info and try to build a road. When advanced game the calculations will be small because will have less variables to analyse. When the ia developes the tunnel tec, the work boats receive the same routines, searching for not routed tiles improvements, not cities because cities in coast are auto routed, and calculate the path and build a "road" to the tile. On this way the IA only will make functional tunnels, not a cross ocean one.
 
The fact that the AI builds routes everywhere isn't a big problem here. Tunnels aren't that expensive and you don't have a big penalty from having them. It just looks uncool.

However, the Via Appia connects all cities with the shortest route system possible. Can't this code being recycled for all workers? And then there is a Worker automation that should only connect cities and resources.
 
I don´t really understand part of the discussion here (especially Dancing Hoskuld´s). It sounds like "tunnels shouldn´t be in because...". But we are already a step further: Sea tunnels are in the game for a long time now and I think they are cool even with all problems associated with them. So any improvement here would be very welcome.
My suggestion: Leave the complicated stuff for later and do what looks to be simpler (in my eyes!), stop the notorious spamming of tunnels by the AI and allow tunnels only in shallow water until Transhuman Age.

Please go on with this discussion, it is really great to see that things are improving here!

BTW: There is a tunnel that connects continents, the new railway tunnel in Istanbul, Turkey connects Europe with Asia.
Yeah, I'll take a look at the AI at least. Allowing them only in shallow tunnels until a certain age though - should that be a factor of the route itself or a general overall rule about routes in ocean tiles?

We would also really need to eliminate the +1:gold: otherwise it does make sense for them to spam those tunnels! (And for the player to do so as well.)
 
You could have floating tubes as tunnels as well, so dept isn't really an issue at a certain technology. It's probably more the length of the tunnel that could cause problems, but this will also increase. Note that normally tunnels don't end directly at the coast AFAIK but continue underground for several kilometers; enough to justfy having a different kind of route on the land tile, like an adapter.
 
Note that normally tunnels don't end directly at the coast AFAIK but continue underground for several kilometers; enough to justfy having a different kind of route on the land tile, like an adapter.

1) Routes have a linear upgrade path. If you add a new route the AI and automatic workers will upgrade all lesser routes to it and then when they have the technology they will replace the route with the new one. This is done by assigning routes a number in the XML. The bigger that number the better the route is assumed to be. This makes the decision for the AI and auto workers easy, if the plot has no route or a route of lesser number that tech allows replace it with the best one that the tech allows.

2) there is currently no way to restrict routes by terrain. This can be fixed with new tags.

3) There is currently no way to identify if a plot is a coastal (land) plot otherwise I would have used it for some of the animal placement and movement.

4) Before you could have such a transition we would need to be able to restrict it to coastal (land) terrain next to a coastal plot which already contains a sea tunnel in it. This is much more than has been currently suggested. Of course all land plots next to the tunnel would get this new route so you could end up with all 8 plots around a single plot lake having the transition route if the lake has a tunnel in it.

5) A bit of history. In RoM Zappara tried having two equivalent railways one steam/diesel for those with coal and the other electric for later when you did not have coal. This was done by them having the same number. What happened if you had coal was that all railways were replaced by electric railways then all electric railways were replaced by railways and so on. So they were changed and electric railway made a proper upgrade of railway. This is still true in C2C at the moment.

I don´t really understand part of the discussion here (especially Dancing Hoskuld´s). It sounds like "tunnels shouldn´t be in because...". But we are already a step further: Sea tunnels are in the game for a long time now and I think they are cool even with all problems associated with them.

No. I am just listing the impedements to the requested changes to how tunnels act. Because they are routes changing tunnels will affect routes so you can't do them in isolation. With tunnel implementation in v35 and earlier there were three big problems.

1) Unrealistic combat and troop movement between sea units and those in the tunnel. This is now fixed by Thunderbrd.

2) Connecting of map regions. This has been discussed over and over and no acceptable solution has yet been found. The two main issues are
- connecting small islands that are inside a city work radius so you can get the yield and the resource. This is not an issue with bigger islands as you just build a fort or other city and the problem goes away.
- ai movement

3) once 1) was fixed people added more requirements and I listed the problems associated with achieving those. I am not against them I am trying to ensure we don't break other things and that we have a clear way of achieving what is needed.
 
1) Routes have a linear upgrade path. If you add a new route the AI and automatic workers will upgrade all lesser routes to it and then when they have the technology they will replace the route with the new one. This is done by assigning routes a number in the XML. The bigger that number the better the route is assumed to be. This makes the decision for the AI and auto workers easy, if the plot has no route or a route of lesser number that tech allows replace it with the best one that the tech allows.

2) there is currently no way to restrict routes by terrain. This can be fixed with new tags.

3) There is currently no way to identify if a plot is a coastal (land) plot otherwise I would have used it for some of the animal placement and movement.

4) Before you could have such a transition we would need to be able to restrict it to coastal (land) terrain next to a coastal plot which already contains a sea tunnel in it. This is much more than has been currently suggested. Of course all land plots next to the tunnel would get this new route so you could end up with all 8 plots around a single plot lake having the transition route if the lake has a tunnel in it.

5) A bit of history. In RoM Zappara tried having two equivalent railways one steam/diesel for those with coal and the other electric for later when you did not have coal. This was done by them having the same number. What happened if you had coal was that all railways were replaced by electric railways then all electric railways were replaced by railways and so on. So they were changed and electric railway made a proper upgrade of railway. This is still true in C2C at the moment.



No. I am just listing the impedements to the requested changes to how tunnels act. Because they are routes changing tunnels will affect routes so you can't do them in isolation. With tunnel implementation in v35 and earlier there were three big problems.

1) Unrealistic combat and troop movement between sea units and those in the tunnel. This is now fixed by Thunderbrd.

2) Connecting of map regions. This has been discussed over and over and no acceptable solution has yet been found. The two main issues are
- connecting small islands that are inside a city work radius so you can get the yield and the resource. This is not an issue with bigger islands as you just build a fort or other city and the problem goes away.
- ai movement

3) once 1) was fixed people added more requirements and I listed the problems associated with achieving those. I am not against them I am trying to ensure we don't break other things and that we have a clear way of achieving what is needed.


Dancing, what do you think of my approach? Don't resolve the issue of spam roads and be more realistic? Even the IA will be more efficiently when just build roads where are needed. I want your opinion.
 
One annoying thing I have observed is that my automated work boats start to build sea tunnels all over the place. There is a bug option where you can choose what your automated workers are allowed to work on. Would it be possible to add a selection for sea tunnels? Break ice is already there so this is definitely not only for land units.
 
One annoying thing I have observed is that my automated work boats start to build sea tunnels all over the place. There is a bug option where you can choose what your automated workers are allowed to work on. Would it be possible to add a selection for sea tunnels? Break ice is already there so this is definitely not only for land units.

When it changes for the AI it will by default change for automation. Automation is basically just telling the unit to do what the AI would have it do.
 
Just for the player side of the one tile isle problem. Could there not be a "great land mover unit" somewhere in the medieval times, that just works like the great farmer. (takes a ton of time to create and works uber so slowly) It could just be a little boat unit that dumps earth in to the water un till it becomes land. The region that is now part of Belgium and the Netherlands started to do this did in the 11th century. Although not with boats.

And I would lobe to have its counter action too, making land in to water. Like a canal digger XD
"King, this is a glorious day, our capital has finally gotten its own beach. Now your highness can smell the ocean from the palace gardens.. " :king:
 
Just for the player side of the one tile isle problem. Could there not be a "great land mover unit" somewhere in the medieval times, that just works like the great farmer. (takes a ton of time to create and works uber so slowly) It could just be a little boat unit that dumps earth in to the water un till it becomes land. The region that is now part of Belgium and the Netherlands started to do this did in the 11th century. Although not with boats.

And I would lobe to have its counter action too, making land in to water. Like a canal digger XD
"King, this is a glorious day, our capital has finally gotten its own beach. Now your highness can smell the ocean from the palace gardens.. " :king:

Of course, both of these would offer directly the same problems discussed there. BUT, once resolved, it may be possible to do or provide something along these lines. At the moment we only need the art for the improvement to enable canals as an improvement already.
 
If you need an icon (or something along those 2d lines) I can help, but I am clueless on how to mod or code.
 
It would probably mean figuring out how to have/show multiple routes on a plot. If we go with canals we should consider/include the bit of history where canals and railways were competing.
 
The tag is not designed to be utilized as a route so it won't conflict. That said, some special programming magic will be necessary to get the angle of the canal to situate correctly. That's really the part I'm not ready to try to sort out. I'm also not sure if the useable river artwork can be converted from a route to an Improvement. Or rather HOW it can be done. Surely it COULD be since its all based on underlying 3d art.

That said you may be on to something because I do eventually want to make rails operate differently to standard routes too and this would really require there to be an ability to overlap them.
 
Top Bottom