I have played a game (Sid Meier's Railroads) and a few days ago I installed it again to relieve some fun memories.
While I was playing I noticed that when my railroad crossed rivers or a ravines then the game would create a bridge and it is this part which have me puzzle:
The bridges were never too short no matter how wide the gap were the bridges just got longer to neatly (I dare say) fit the gap.
If anyone wants to bother having a look then there is a tons of screenshots on google.
Now to my question:
How was this made ?
My own guess is (and I'm not a programmer, which is why I'm asking you !) that the developers made the bridges in three segments:
1. a start segment
2. a middle segment which is expandable
3. an end segment
Here is another thing I don't understand:
How the the program knows:
1. how many middle segments to add
2.how pick the most suitable type of bridge for a particular gap
I hope someone would like to enlighten me.