Round Earth in Openttd

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Round Earth in Openttd

Post by agentw4b »

Do somebody repair a game for a round Earth please :-)

Just the train when it arrives at the edge of the map, appears on the other side.
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Round Earth in Openttd

Post by Gwyd »

This is a very interesting concept, but I think it'd be more useful if you could go between/link maps
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Round Earth in Openttd

Post by Transportman »

Gwyd wrote:This is a very interesting concept, but I think it'd be more useful if you could go between/link maps
You could play on a bigger map and have the same result. Linking maps while keeping them separate is not possible, as calculations would still need to be done for both maps (although drawing and stuff is not needed for one of them).

I do recall that there is a patch or NewGRF that would create industries at the map edge where you could drop all cargoes and get all cargoes back, mimicking such a link.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Round Earth in Openttd

Post by kamnet »

Design your maps or scenarios using polar projection? :)
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Round Earth in Openttd

Post by agentw4b »

kamnet wrote:Design your maps or scenarios using polar projection? :)

Earth is Flat ? :?:
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Round Earth in Openttd

Post by Drury »

agentw4b wrote:
kamnet wrote:Design your maps or scenarios using polar projection? :)

Earth is Flat ? :?:
Yes ! :!:
Attachments
N0m7OHA.jpg
N0m7OHA.jpg (62.83 KiB) Viewed 1585 times
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Round Earth in Openttd

Post by agentw4b »

Drury wrote:
agentw4b wrote:
kamnet wrote:Design your maps or scenarios using polar projection? :)

Earth is Flat ? :?:
Yes ! :!:

I made it .
viewtopic.php?f=60&t=82397
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Round Earth in Openttd

Post by Redirect Left »

agentw4b wrote: Just the train when it arrives at the edge of the map, appears on the other side.
That'd be an interesting way to play. Certainly should be possible (with a lot of editing / patching). Although you'd need to make sure you had tracks setup at the other side of the map. It'd be hard to make sure you have properly aligned tracks at the other side of the map.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Round Earth in Openttd

Post by Leanden »

Getting track/roads to match either side would be the simple part.

Rewriting the pathfinder to crossover the map edges to the other side would be the challenge
Image
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Round Earth in Openttd

Post by Redirect Left »

Leanden wrote: Rewriting the pathfinder to crossover the map edges to the other side would be the challenge
Hmm. Would probably require a pathfinder specifically wrote for this purpose, clone another one then edit it to your needs. Not sure it'd work with a normal 'earth' in openTTD after modification, with any sort of efficiency.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Round Earth in Openttd

Post by Gwyd »

What if the map actually wrapped around, so at the left, the right would start again. This would mean old pathfinders work... Maybe. This is why I dont do patches.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7238
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Round Earth in Openttd

Post by Redirect Left »

Gwyd wrote:What if the map actually wrapped around, so at the left, the right would start again. This would mean old pathfinders work... Maybe. This is why I dont do patches.
I suspect that'd be more patching than just making the train appear at the other side, more graphic stuff in my experience takes more work.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Drury
Tycoon
Tycoon
Posts: 2168
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Round Earth in Openttd

Post by Drury »

Gwyd wrote:What if the map actually wrapped around, so at the left, the right would start again. This would mean old pathfinders work... Maybe. This is why I dont do patches.
When you see this done in a game (like in Civilization games), what they actually do is just have a regular rectangular map and teleport things from one side to the other at the edges (which is the original suggestion anyways), it's just made to look seamless by rendering the edge bits from the other side when needed. There isn't really a magical way to have looping maps without this workaround.
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Round Earth in Openttd

Post by agentw4b »

Round Earth should, of course, only be one of the choices. If you can do this, it will be great.:-)
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
raidho36
Engineer
Engineer
Posts: 3
Joined: 05 Apr 2017 02:26

Re: Round Earth in Openttd

Post by raidho36 »

Redirect Left wrote:
Leanden wrote: Rewriting the pathfinder to crossover the map edges to the other side would be the challenge
Hmm. Would probably require a pathfinder specifically wrote for this purpose, clone another one then edit it to your needs. Not sure it'd work with a normal 'earth' in openTTD after modification, with any sort of efficiency.
No it would literally require no modification. Pathfinder works over abstract graphs which don't care about space-time geometry, and a piece of rail going to the other side of the map over the edge is not in any way different from a piece of rail simply going from left to right in an ordinary fashion. Same logic applies to rails that loop over the edge of the map - loops are already well handled in ordinary maps.
GiaNN
Engineer
Engineer
Posts: 6
Joined: 29 Oct 2015 15:54

Re: Round Earth in Openttd

Post by GiaNN »

raidho36 wrote:
Redirect Left wrote:
Leanden wrote: Rewriting the pathfinder to crossover the map edges to the other side would be the challenge
This is not at all complicated, I wrote it some years ago not for OpenTTD. All you need is the access of the map (be it read or write) to be wrapped in a function. The function translates any false coordinates to correct coordinates. Then make sure all scripts always use this function and everything rolls just fine without big changes of the core code, yet the game "world" becomes infinite beyond the edges.

if you request data for position X,Y and X and/or Y is a negative value exiting the map in the top or a larger than the map size number exiting in the bottom, than add or subtract the value from map size until a valid positive value is the result. depending on if the map is using 0,0 as first coordinate, or 1,1 doesn't matter for the concept. So for explaining and understanding, I now assume the first tile is identified as [1,1], in programming this more likely will be position 0,0.

hence, in the case we are using a map size 1024x1024:

requesting coordinate [-20,1300] (both X and Y are outside the map range) the function simply results in returning values for [1004,276]

or requesting coordinate [500,4000] (Y is outside the map but X is not) results in returning values for [500,928]
in the last example the value 4000 is 3 times outside the world so 3 times 1024 was subtracted.

or maybe more simple to understand assuming we again have a map size of 1024x1024 tiles:

requesting the coordinate [-1,-1] should result in accessing the data for [1023,1023] and requesting ccordinate [1025,1025] will result in accessing the data of [1,1]

In this virtually visualised example (not from OpenTTD), it works the same way, the lower corner is closer to the upper corner. the left corner is closer to the right corner.
Image

The pathfinder should now automatically find a shorter route to a location outside the map if that same location inside the map is further away.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Round Earth in Openttd

Post by Eddi »

while this approach would generally work, you get two main problems here:
  1. the world you produce isn't actually "round" but "toroidal"
  2. the map generator is not equipped to make sure the map border is "smooth" enough to connect both sides, unless you force map edges to be water
and then you need to find all the places where it currently checks that it *doesn't* cross the map borders
tylla
Engineer
Engineer
Posts: 2
Joined: 04 Dec 2022 21:25

Re: Round Earth in Openttd

Post by tylla »

Anybody has (still) any interest in this thing?
I recently had this same idea, and after doing my homework (aka searching the forums:) it turned out others had the same idea before me. :)
But anyway, this feature could bring a new twist to the gameplay.
User avatar
odisseus
Director
Director
Posts: 552
Joined: 01 Nov 2017 21:19

Re: Round Earth in Openttd

Post by odisseus »

This is an interesting idea, but I'm not convinced it would improve the gameplay.

One of the challenges in the game is to deliver cargo from A to B as quickly as possible to get the highest reward. This requires planning a route in a way that would minimize the detours, while taking into account the terrain, water, towns, other transport routes, signal gaps, curve width... As the cargo supply grows, the line throughput needs to be increased, which involves planning for additional parallel tracks, minimizing the signal gap, optimizing junctions etc. The greatest distance that can be covered would be corner to corner, which e.g. on a 1024x1024 map would be 2048 tiles (by Manhattan distance).

Now let's have the rectangular game map wrapped into a torus (cf. Snake in old Nokia phones). Now the greatest possible distance on the map of same size would be just 1024 (from the centre to any of the corners). Moreover, you could build the track in almost any direction, and eventually reach the destination without excessive detours.

That said, has anybody considered building a railroad simulator in Hyperrogue geometry? Possible features would include:
  • an infinite ocean with infinite number of infinitely large islands;
  • straight parallel tracks that can be spanned with a very short bridge, yet have enough space between them to fit a very large junction;
  • a network just 30 tiles at its widest could reach about 14 million of different tiles;
  • any route that doesn't bend back on itself will turn out to be very close to a straight line.
The only problem I can think of is the inability to build balanced multi-track mainlines, because all the equidistant tracks would have unequal lengths.
Last edited by odisseus on 09 Dec 2022 22:28, edited 4 times in total.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Round Earth in Openttd

Post by Eddi »

odisseus wrote: 09 Dec 2022 03:13I'm not convinced it would improve the gameplay.
while it might not be strictly "better", there's also nothing in your argument that would make it worse
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 3 guests