The International Simutrans Forum

 

Author Topic: Great Britain simulation in Simutrans Experimental  (Read 275128 times)

0 Members and 1 Guest are viewing this topic.

Offline Lewis

  • *
  • Posts: 99
  • Languages: EN, ES, FR, RU
Re: Great Britain rail network in Simutrans Experimental
« Reply #560 on: September 06, 2016, 07:40:17 AM »
Quote
On the pak.64-britain idea - it's not a bad idea! It would take a lot of work. It would probably mean painting a lot of new trains for historical times (plus new liveries).

I could do that.

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #561 on: September 10, 2016, 06:17:00 PM »
A quick question, Carl: I'm making my own Britain map, and having a bit of a problem placing the cities properly. How did you go about doing that?

Offline NoMorePacers

  • *
  • Posts: 190
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #562 on: September 10, 2016, 07:05:19 PM »
I recommend you watch his video diaries; on the first episode he explained this.

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #563 on: September 10, 2016, 07:30:30 PM »
He explained how he sourced the data, which is useful stuff, but not what I needed to know. What I'm trying to work out is, having got that data, how to translate it into co-ordinates on the map.

(Linear interpolations seem just to be failing for me, so I think I need something more complex. Not sure what, though.)

Offline NoMorePacers

  • *
  • Posts: 190
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #564 on: September 10, 2016, 07:42:21 PM »
Why not use geographical features to help you? Like the Thames for London, the Clyde for Glasgow, the Mersey for Liverpool etc. Does your map have things like rivers?

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #565 on: September 10, 2016, 07:49:37 PM »
It does, yes.

(The Thames is where I first started having problems, because my formula was placing things on the wrong side of the Thames.)

Offline NoMorePacers

  • *
  • Posts: 190
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #566 on: September 10, 2016, 08:38:38 PM »
OK then. What do you mean by the wrong side?

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #567 on: September 10, 2016, 08:42:49 PM »
I mean that the co-ordinates my formula was giving for the location of Trafalgar Square put it south of the Thames, that sort of thing.

(I have a lot of locations to place, and am trying to find some sort of automatic method of finding the co-ordinates for those locations to save myself time.)

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #568 on: September 10, 2016, 08:51:49 PM »
Sounds like an interesting time-saving idea.

Using the scale of the heightmap (i.e. metres per tile) and measuring distances on Google Earth was the method for me. Any heightmap will require some correction - the curvature of the earth means that things get a bit out of whack over long distances, I think. Because of that I would never use one single point for calculating *all* locations. Rather I'd pick something that's reasonably nearby - a geographical feature like distinct points on Sheppey, or Flamborough Head - to minimise the distortion over long distances. This might make it difficult to place everything in a formulaic way.

Which heightmap are you using?

Offline NoMorePacers

  • *
  • Posts: 190
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #569 on: September 10, 2016, 08:54:22 PM »
Afraid I can't help you with that then, as I'm more of a network builder or graphics painter than a map builder. I thought you were engaged in real life things (as you do), Carl. Nice surprise to see you again.

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #570 on: September 10, 2016, 08:55:40 PM »
Using the scale of the heightmap (i.e. metres per tile) and measuring distances on Google Earth was the method for me. Any heightmap will require some correction - the curvature of the earth means that things get a bit out of whack over long distances, I think. Because of that I would never use one single point for calculating *all* locations. Rather I'd pick something that's reasonably nearby - a geographical feature like distinct points on Sheppey, or Flamborough Head - to minimise the distortion over long distances. This might make it difficult to place everything in a formulaic way.
That was the approach I was trying - doing it county by county - but it seems to be breaking down, and I'm not sure why.

Quote
Which heightmap are you using?
A map I found on these forums, scaled so it's just about small enough to work with. Turns out it's actually yours.

-----------------------------

So I'd get a wodge of data for a county like so:

Plymouth      -4.142593   50.375923
Exeter      -3.533594   50.718544
Torquay      -3.525339   50.461933
Paignton      -3.564236   50.435188
Exmouth      -3.384131   50.625582
Newton Abbot      -3.608396   50.529049
Barnstaple      -4.058376   51.078297
Tiverton      -3.492539   50.901941
Brixham      -3.513991   50.395353
Teignmouth      -3.496709   50.547352
Bideford      -4.206774   51.01681
Sidmouth      -3.237478   50.67876
Dawlish      -3.464221   50.582666
Ivybridge      -3.920458   50.390254
Honiton      -3.188819   50.799758
Northam      -4.21321   51.039868
Tavistock      -4.143353   50.555026
Ilfracombe      -4.126848   51.205305
Kingsteignton      -3.598556   50.549485
Totnes      -3.685286   50.433768
Okehampton      -4.004339   50.738284
Crediton      -3.65162   50.792511
Axminster      -2.994943   50.782711
South Molton      -3.832365   51.016534

...and then do a linear interpolation formula to convert all those grid references to places on the map, having found two fixed points that form the corners of a box surrounding the county.
« Last Edit: September 11, 2016, 03:07:48 PM by Isaac.Eiland-Hall »

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #571 on: September 10, 2016, 10:02:45 PM »
Interesting. I think the most likely cause is as follows. The heightmap in question was adapted from SRTM data, but I did adjust it to make distances consistent across the country. If I remember correctly this involved separately adjusting the y-axis scale of different slices of the map (e.g. squashing Scotland and extending the South), so that the height of one pixel corresponded with a consistent value at each point in the map.

I think this would affect the lat/long approach you're taking and lead to discrepancies. However I would have thought that using a single point for each county (rather than one for the whole country), as you are, would mostly alleviate this. As a result I think you're running up against the limits of how accurate it is possible to be with Simutrans heightmaps.

Your approach might work better with Easting and Northing, if you're able to get those coordinates?

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #572 on: September 10, 2016, 10:18:48 PM »
What seems to be happening is that I'm getting problems near the edges of counties. I put in most of Essex and it's fine, and then there's stuff near the Hertfordshire border that's obviously wrong when I compare it with the Hertfordshire towns.

Ah well, back to the drawing board. Maybe the problem is with linear interpolation and I need a non-linear interpolation on the North-South axis.

ETA: Let's try with a county that's pretty big and see what's going on...

Cumbria.

The southern tip of Cumbria seems to be at (-3.195910, 54.044276) and at (1072, 2976)
The western tip of Cumbria seems to be at (-3.640176, 54.514060) and at (909, 2676)
A northern point just below the strait separating Cumbria from Annan and Gretna seems to be at (-3.213980, 54.953477) and at (1067, 2395)

Hmmm, no help there.
« Last Edit: September 10, 2016, 10:32:54 PM by Jack Rudd »

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #573 on: September 12, 2016, 08:26:03 AM »
I would say that on all the real-world-simulation maps I've done, I've had to triangulate the position of difficult locations (e.g. those in the middle of the country or not near any geographical features) based on several already known points. So I might measure from multiple coastlines or elevation peaks to find where the location most fits - and they don't always agree, so you have to come to some kind of compromise.

Offline Lewis

  • *
  • Posts: 99
  • Languages: EN, ES, FR, RU
Re: Great Britain rail network in Simutrans Experimental
« Reply #574 on: September 17, 2016, 05:10:16 PM »
 ;) Class 66
« Last Edit: September 17, 2016, 05:28:56 PM by Lewis »

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #575 on: September 18, 2016, 08:08:00 AM »
Thanks Lewis - looks like a good start on those. Could probably use a bit more colour differentiation on the roof, and between the front and the side.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #576 on: September 18, 2016, 10:10:38 AM »
Carl, I am working on a UK map with fictional cities. It'll feature as much routes and lines as possible. The map will include a plane service and Coach (Long Distance) bus services. Also an Airport shuttle in-game. Photo's will be posted on a Discord page soon. Watch this space! xD

Link to the Discord page: https://discordapp.com/channels/227891198520459264/227891198520459264

DONT MAKE ACCOUNTS! Reply here instead. :)
« Last Edit: September 21, 2016, 04:07:15 PM by fam621 »

Offline NoMorePacers

  • *
  • Posts: 190
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #577 on: September 18, 2016, 11:43:50 AM »
Carl, just to let you know, you know the long class 90 sets you did for the London map. They've overwritten the originals for the UK map, which renders the UK map practically unplayable, because of the excessive 'train too long to fit in x station platform'. Could you have a look at this please.

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #578 on: September 18, 2016, 11:48:26 AM »
Thanks - I have noticed this and will fix it.


Edit: here's an updated pak.ngb folder and London.sve which should do the trick:
https://dl.dropboxusercontent.com/u/61716/London-sep16.rar
« Last Edit: September 18, 2016, 12:24:40 PM by Carl »

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #579 on: September 28, 2016, 07:26:52 PM »
Can you maybe give us the updated version of UK2016 .sve please? Even though the map is finished. :)

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #580 on: September 28, 2016, 08:08:54 PM »
I just put some fixed points in and the correlation coefficients were:

e-w axis: 0.998
n-s axis: 1

Hah, screw doing it county by county, that's what's introducing the errors. I'll try again and see whether doing things on the whole map scale makes things work...

Trafalgar Square ends up at 2263, 4598...

Yes! It's north of the Thames, it's just west of the bit where the Thames goes north for a bit.

Problem solved by zooming out. Go figure.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #581 on: September 29, 2016, 06:24:58 PM »
Carl, can you maybe give us the updated version of UK2016 .sve please? Even though the map is finished. :)

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #582 on: September 29, 2016, 06:27:55 PM »
fam621, I saw your post above from yesterday - no need to repeat :) I need to make one more tweak to the folder I uploaded last time. I'll add the savegame to it if that will help.

Jack - that's really interesting. Does that work everywhere in the map? I wonder why that is...?

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #583 on: September 29, 2016, 06:31:56 PM »
Calibrating north-south has worked very well. East-west was slightly trickier, but I think I've now got it right: Richmond is now east of the Thames, and Margate has not fallen into the sea. :D

Those fixed points in full:

 
Lizard Point
-5.20646
49.95763
251
5596
Land's End
-5.70806
50.05938
49
5531
Portland Bill
-2.45631
50.51342
1370
5234
Sandbanks
-1.94747
50.68325
1574
5126
Selsey Bill
-0.78916
50.72194
2038
5102
Beachy Head
0.24143
50.73382
2449
5093
Dungeness
0.977418
50.91207
2738
4980
Hartland Point
-4.52588
51.02184
543
4912
Folkestone Harbour
1.194846
51.07603
2866
4855
Lundy
-4.65502
51.16173
494
4824
Fayrneness
1.441665
51.38701
2899
4674
Foulness Point
0.958945
51.62006
2701
4525
Skomer
-5.29567
51.74258
251
4449
Bradwell Point
0.92355
51.74805
2683
4443
Cardigan Island
-4.69021
52.13141
494
4193
Lowestoft Point
1.762847
52.48115
2976
3969
Uwchmynnydd Point
-4.73219
52.78174
487
3777
Spern Nature Reserve
0.107989
53.57267
2308
3278
Roa Island
-3.17364
54.062
1080
2964
Flamborough Head
-0.07616
54.11458
2224
2930
Mullach Mor
-5.07021
55.5227
401
2027
Cape Wrath
-5.00207
58.62616
468
40
Duncansby Head
-3.02516
58.64359
1129
31

EDIT: I spoke too soon, having checked the south and not the north. Scarborough appears to have fallen into the sea. Back to the drawing board.
« Last Edit: September 29, 2016, 07:14:39 PM by Jack Rudd »

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #584 on: October 01, 2016, 06:55:14 PM »
It will Carl, but when will I be able to run 800's again on the GB map? :)

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #585 on: October 01, 2016, 06:58:06 PM »
I'm not surprised that you've found a south/north discrepancy Jack. I think the error introduced by the curvature of the earth will mean that the east-west distances are different up there. The north/south values may also be influenced by the corrections I had to add to ensure consistency.

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #586 on: October 06, 2016, 07:41:37 PM »
Hmmm. Seems to be 1 degree in the east-west direction is 380.95 tiles at latitude 51, and only 352.18 tiles at latitude 58. That could be something to work with.

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #587 on: October 07, 2016, 12:39:15 PM »
That is intended behaviour, I think. The size of a tile is supposed to remain constant in terms of metres across the map, whereas the number of metres in a degree will change at different latitudes (I think?)

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #588 on: October 07, 2016, 12:46:05 PM »
That is intended behaviour, I think. The size of a tile is supposed to remain constant in terms of metres across the map, whereas the number of metres in a degree will change at different latitudes (I think?)
Yes - it'll be zero at 90 degrees North. Now to see whether the reduction is linear or something more interesting.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2714
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Great Britain rail network in Simutrans Experimental
« Reply #589 on: October 07, 2016, 04:06:11 PM »
I would guess it is not linear, but something like const*cos(latitude)

Const is km/degree at equator (lat 0)

Offline Carl

  • Devotee
  • *
  • Posts: 1600
    • Website
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #590 on: October 07, 2016, 04:07:24 PM »
I think I made the manual adjustments in chunks, so it's likely it will be less regular than that.

Offline Jack Rudd

  • *
  • Posts: 29
Re: Great Britain rail network in Simutrans Experimental
« Reply #591 on: October 07, 2016, 04:18:01 PM »
cos 51 deg = 0.62932039
cos 58 deg = 0.52991926

Hmmm, ratio is 1.18 rather than the 1.08 for the numbers themselves, but it might be good enough.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2714
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Great Britain rail network in Simutrans Experimental
« Reply #592 on: October 07, 2016, 07:00:44 PM »
The function with cos is just my guess, based on the fact that it is at max on equator and 0 on poles, and that earth is approximately spherical. But it may be something more complex...

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Great Britain rail network in Simutrans Experimental
« Reply #593 on: October 08, 2016, 01:32:52 PM »
See http://williams.best.vwh.net/avform.htm#flat

If you stay in the vicinity of a given fixed point (lat0,lon0), it may be a good enough approximation to consider the earth as "flat", and use a North, East, Down rectangular coordinate system with origin at the fixed point. If we call the changes in latitude and longitude dlat=lat-lat0, dlon=lon-lon0 (Here treating North and East as positive!), then

 distance_North=R1*dlat
 distance_East=R2*cos(lat0)*dlon

R1 and R2 are called the meridional radius of curvature and the radius of curvature in the prime vertical, respectively.

R1=a(1-e^2)/(1-e^2*(sin(lat0))^2)^(3/2)
R2=a/sqrt(1-e^2*(sin(lat0))^2)

a is the equatorial radius of the earth (=6378.137000km for WGS84), and e^2=f*(2-f) with the flattening f=1/298.257223563 for WGS84.

   

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Great Britain rail network in Simutrans Experimental
« Reply #594 on: October 08, 2016, 07:22:02 PM »
Carl, I've waited long enough for a Sept. or EVEN an Oct. 16 update of the GB map... xD