Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Sep 24, 2018 10:33 am

All times are UTC




Post new topic  Reply to topic  [ 39 posts ]  Go to page 1 2 Next
Author Message
 Post subject: 90 degree tunnels
PostPosted: Wed May 23, 2018 1:22 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jan 17, 2013 5:13 am
Posts: 119
would nto be nice to have the opportunity to have angle 90 degree tunnels in the game??

but to make the code easier we can split it into 2 tunnels

if we create a new tool if possilbe
you will be able to lower the soil but in a level under you to create a cave? and road and rail road can have their one tool that will not only create the cave but also put all the diagonal pieces of track so it can be used?

if the game can allow the creation of caves
then we can do 90 degree tunnels by simply make the 2 tunnels that will meet in the underground cave we created.

i do not know how the game treat the hills
but would it be possible??

lets see if i can get another answer than code it ypurself


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Wed May 23, 2018 2:18 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jan 17, 2013 5:13 am
Posts: 119
i include a pic to show what i mean

the new tool will make the cave of that size adding the track and leave all soil above untouched only touch this small area

when you have the cave you can just build the 2 tunnels and you have a 90 degree angle tunnel


in more thinking
if cave is possible then we can use the cave tool to excavate a mountain for a 2 line track and only put tunel in the start end of tunnel. the rest will be a cave and you can build signals in the lines crossing.

also it opens the opportunity for underground stations to be build

a huge help for in city transportation where you could have your train station in the city but not destroying the city

we need an offset number in the construction tool to tell the game what depth to build the select item
game can check if there is empty space at that space and build them


in this scenario the copy past utility will be handy since you will not have visibility, so you make the configuration somewhere and then you copy it there it can be more like cut paste.

you build it on surface so you can see what you build and then the cut past function not COPY will just move it in the right place. and the cut paste function does not go against the idea of the game. you build it in real time but this tool will only help you place it where you should have put it

also i remember people asking the tunnel for canals if gave is possible this will be possible to be done.

you can even build underground airports with 100% fatality rate lol

i think the gave idea can really spice up the game
solve many request of the past
underground, 2 lien tunnels, signals in tunnels, underground station, underground canals,


Attachments:
90degree.gif
90degree.gif [ 72.51 KiB | Viewed 1142 times ]
Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Wed May 23, 2018 10:03 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
Signals in tunnels and bridges are already done as a patch. Look in JGR's patchpack.
Underground station, cave etc idea is good, and is something which would need implementing. However, it would need an underground view (like SimCity 4) and so a rewrite of the map array. Thus, it is possible, you will be able to load your old savegames with the new map array, however, there is total irreversibility. Also, rewriting the map array is hard, although i'm sure there are some people (such HackaLittleBit, that done the signals in tunnels patch and cirdan, who did NMF) which may be able to do it.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Wed May 23, 2018 11:15 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jan 17, 2013 5:13 am
Posts: 119
acs121 wrote:
Signals in tunnels and bridges are already done as a patch. Look in JGR's patchpack.
Underground station, cave etc idea is good, and is something which would need implementing. However, it would need an underground view (like SimCity 4) and so a rewrite of the map array. Thus, it is possible, you will be able to load your old savegames with the new map array, however, there is total irreversibility. Also, rewriting the map array is hard, although i'm sure there are some people (such HackaLittleBit, that done the signals in tunnels patch and cirdan, who did NMF) which may be able to do it.



well visibility is another issue
butt first first
if we could get the cave function would be nice even if we build in blind
that why i said the toll like copy past, or even better cut paste will be handy,
build it somewhere you can see and then move it into place.

as i see ti now the landscaping tool effect the whole column of area
to make a cave we will have to say to ignore the above area and only apply changes to the tiles under it

which if possible then we can have the opposite tool and dig in things

dig in an area build what you want to do and then dig it in. in this case the landscape tool will not affect the area bellow only the area above

as for visibility
an easy way around is to draw part of the map
meaning if the map lets say has a height of 16 tiles and you want to see at tile 12 then ignore the 4 tiles or in simple terms treat the game as if it had only 12 tiles and not 16

or maybe with invisibility transparency?? make the above tiles to be invisible??

and this function goes beyond the signals in the tunnel since now you can custom make tunnels of any width and crossing and even put depot inside them

for beginning i would not mind building blind if we can have the feature
visibility can come later on

if we can get visibility then it will be awesome since we can really build underground
imagine a late game with a big city with a complex multi level metro running in it


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Wed May 23, 2018 12:34 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
ANIKHTOS wrote:
acs121 wrote:
Signals in tunnels and bridges are already done as a patch. Look in JGR's patchpack.
Underground station, cave etc idea is good, and is something which would need implementing. However, it would need an underground view (like SimCity 4) and so a rewrite of the map array. Thus, it is possible, you will be able to load your old savegames with the new map array, however, there is total irreversibility. Also, rewriting the map array is hard, although i'm sure there are some people (such HackaLittleBit, that done the signals in tunnels patch and cirdan, who did NMF) which may be able to do it.



well visibility is another issue
butt first first
if we could get the cave function would be nice even if we build in blind
that why i said the toll like copy past, or even better cut paste will be handy,
build it somewhere you can see and then move it into place.

as i see ti now the landscaping tool effect the whole column of area
to make a cave we will have to say to ignore the above area and only apply changes to the tiles under it

which if possible then we can have the opposite tool and dig in things

dig in an area build what you want to do and then dig it in. in this case the landscape tool will not affect the area bellow only the area above

as for visibility
an easy way around is to draw part of the map
meaning if the map lets say has a height of 16 tiles and you want to see at tile 12 then ignore the 4 tiles or in simple terms treat the game as if it had only 12 tiles and not 16

or maybe with invisibility transparency?? make the above tiles to be invisible??

and this function goes beyond the signals in the tunnel since now you can custom make tunnels of any width and crossing and even put depot inside them

for beginning i would not mind building blind if we can have the feature
visibility can come later on

if we can get visibility then it will be awesome since we can really build underground
imagine a late game with a big city with a complex multi level metro running in it


Visibility is an issue. Imagine a train getting blocked because you badly placed a signal. How can you solve the problem if you're in total blindness ?
Underground view is what i am talking about : total transparency for tiles that block the view.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Fri Jul 06, 2018 3:51 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 09, 2004 12:14 am
Posts: 1487
Location: Not over here
For this a rewrite of the map array is needed (all that information needs to be stored somewhere):

iirc the maximum size of the map is 8192x16384. Each tile takes 10 bytes at the time of this writing. So, that's a whopping 1.28 Gigabytes just for the map array. These maps need to be playable too.

However, we're looking to store information on underground. Now we end up doubling the amount of memory required just for storing 1 level of underground. You would probably want more, given that you'd want to build some cool underground constructs. Lets just say 3 underground layers to be nice. That would make it 5.12 Gigabytes of memory needed (ground level + 3 underground levels), just for the map array (if set to max size).

Of course someone is going to come by and ask for tile animations on underground stations, cellars for buildings, caves and underground rivers. Perhaps things get asked about mines in the games actually occupying space underground. So, ok. The game needs to loop over all those tiles too. Now the system requirements for openttd go up even further (not just memory now, but you will also need a faster processor, a faster main board and faster memory.

Ok, obviously it's not useful to blindly claim some Gigabytes of memory when you're not even sure it's all going to be used. So, we need to find a solution to not consume that much memory... however, we must also maintain performance, as openttd's map array is consulted quite frequently by the game.

A solution for the performance/memory problem needs to be found that
  1. Doesn't come at a too big a performance penalty;
  2. Doesn't drain memory too much;
  3. Is compatible with the current map array;
  4. Can be dropped in, instead of needing to change everything.

Now, I'm not a maintainer of OpenTTD; But I do know that OpenTTD is quite complicated and things that might seem easy, may actually be really hard.

EDIT: corrections in maths and explanation added.


Last edited by Expresso on Sat Jul 07, 2018 3:42 pm, edited 1 time in total.

Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Fri Jul 06, 2018 4:03 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Jan 05, 2013 2:34 am
Posts: 256
Location: at home
perhaps we should take a peek into

ahem
simutrans
call me a heretic but they get the tunnels right. Subways aren't uncommon there. Heck, most paks have subway kits!

_________________
Jetrain
========
I'm drawing things... you'll see what soon.
========
I want a sandwich.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Fri Jul 06, 2018 7:22 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
I don't think Simutrans is coded in C++, so in fact that's different.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sat Jul 07, 2018 12:41 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sat Jan 05, 2013 2:34 am
Posts: 256
Location: at home
Sure, but it may help to look as to what they do to store data on tunnel location. It's not C, sure, but whatever they do might get some ideas flowing.

_________________
Jetrain
========
I'm drawing things... you'll see what soon.
========
I want a sandwich.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sat Jul 07, 2018 1:12 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
trainman1432 wrote:
Sure, but it may help to look as to what they do to store data on tunnel location. It's not C, sure, but whatever they do might get some ideas flowing.


There are things you can code with Java you can't code in C++.
See Minecraft for example. Coded in Java, thus allowing a HUGE map size and an even more complicated map array, this using as much RAM as a game with over 5k vehicles in OpenTTD.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sat Jul 07, 2018 7:17 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4667
Location: home
acs121 wrote:
There are things you can code with Java you can't code in C++.
See Minecraft for example. Coded in Java, thus allowing a HUGE map size and an even more complicated map array, this using as much RAM as a game with over 5k vehicles in OpenTTD.
Oh really, please tell me how that is not possible in C++?

Just because something doesn't exist doesn't mean it's not possible.
Programming language is mostly irrelevant, you can express pretty much everything in any programming language you want.

Likely the real reason why it doesn't exist is that it is a huge undertaking, or it costs too much performance (Minecraft doesn't move 5K vehicles every few micro-seconds), or it would break many or all NewGRFs (Minecraft uses the GPU for rendering rather than the CPU, we can't break away from that without breaking NewGRFs).
So yes, there are likely good reasons why there is no better map array yet, but programming language isn't it.

Of course, feel free to proof me wrong, build openttd2 in Java, and show it can be done. I would honestly be very much impressed if you manage it.

_________________
Being a OpenTTD developer does not mean I know what I am doing.
Also, other OpenTTD developers may have different opinions.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sat Jul 07, 2018 3:22 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 402
Java eats a lot more memory than C/C++ for a single object. I saw a video somewhere about it. So the map size would be very limited.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sat Jul 07, 2018 4:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 09, 2004 12:14 am
Posts: 1487
Location: Not over here
One solution to the memory consumption problem might be to cut the map up in little pieces (say 64x64 (the smallest map size)) and have underground layers on a per piece basis. However, this would mean another layer of indirection (which would come at a performance penalty).
Another option could be to put all tiles in a separate place when there are underground tiles present and then make the tile in question contain a reference to the appropriate position. However, this also comes at a performance penalty.

How do you solve underground editing for the user interface?
Oh, and while we're at it: and how to deal with the selection rectangles? Leave as is? Apply 3D (no, not opengl) to them? If so, how?
What if you end up editing inside a mountain? How do you solve that problem?
What would happen to the catchment area of stations? Do they check underground too now? How deep underground can stations be built until their catchment area no longer covers the town on top? Does the catchment area remain a flat area, or does it become a box?

Not to imagine, this idea opens up a whole can of worms.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sun Jul 08, 2018 1:47 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 402
CS did all this in Locomotion, so it's not impossible, so stop this hysteria. Only we need somebody smart to figure out all this.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sun Jul 08, 2018 3:32 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
Alberth wrote:
acs121 wrote:
There are things you can code with Java you can't code in C++.
See Minecraft for example. Coded in Java, thus allowing a HUGE map size and an even more complicated map array, this using as much RAM as a game with over 5k vehicles in OpenTTD.
Oh really, please tell me how that is not possible in C++?

Just because something doesn't exist doesn't mean it's not possible.
Programming language is mostly irrelevant, you can express pretty much everything in any programming language you want.

Likely the real reason why it doesn't exist is that it is a huge undertaking, or it costs too much performance (Minecraft doesn't move 5K vehicles every few micro-seconds), or it would break many or all NewGRFs (Minecraft uses the GPU for rendering rather than the CPU, we can't break away from that without breaking NewGRFs).
So yes, there are likely good reasons why there is no better map array yet, but programming language isn't it.

Of course, feel free to proof me wrong, build openttd2 in Java, and show it can be done. I would honestly be very much impressed if you manage it.


By "you can't code in x or y language" i mean that it can be coded, but very differently.
Of course, Minecraft uses GPU and not CPU like OpenTTD. But what's about "breaking NewGRFs" ? You mean that every addition we make to the game needs to be compatible with stuff from 10 or 15 years ago like the Cargo Set ?

Also, in Minecraft, the only comparable thing to vehicles are mobs, in Minecraft they disappear out of the player's range. This cannot be done in OpenTTD. However, Minecraft can run redstone circuits and thousands of command blocks at the same time, while OpenTTD can't really handle thousands of console entries at the same time.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Sun Jul 08, 2018 3:44 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7121
acs121 wrote:
But what's about "breaking NewGRFs" ? You mean that every addition we make to the game needs to be compatible with stuff from 10 or 15 years ago like the Cargo Set?
yes. but not because there's anything special in those GRFs from 15 years ago. any change carelessly done in this regard would throw out ALL the GRFs from the past 15 years simultaneously, including those from yesterday. and that is just too huge of a content library to just throw away for a relatively minor feature.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Last edited by Eddi on Mon Jul 09, 2018 10:31 pm, edited 2 times in total.

Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Mon Jul 09, 2018 12:17 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2617
Location: Kent
lukasz1985 wrote:
CS did all this in Locomotion, so it's not impossible, so stop this hysteria. Only we need somebody smart to figure out all this.


You mean the game that was built from the ground up with a completely unrelated game engine adopted from RCT with absolutely no legacy or compatibility issues to contest with?

Not sure how this is at all relevant.

_________________
Image


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Mon Jul 09, 2018 2:58 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6165
Location: Eastern KY
Build a better OpenTTD and the world will beat a path to your door.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Thu Jul 12, 2018 12:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 15, 2003 5:32 pm
Posts: 1139
Location: Paris, France
Wow, really Strange conversation…

In fact "anything" an be done with "any" langage".

The problem isn't a matter of langage nor even a problem that writting and maintaining more complex code in a langage than with another one.

The problem is a matter of "how it's done now".

The core of OTTD is about it's way to store and manage the map.
We can change the way it's coded, but this implies many changed in all features of the program.

And for some benefits it may bring some enormous limitations.

You may have the same problems with any langage.


Top
   
 Post subject: Re: 90 degree tunnels
PostPosted: Thu Jul 12, 2018 1:21 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1540
Location: Courbevoie, near Paris, France
MagicBuzz wrote:
Wow, really Strange conversation…

In fact "anything" an be done with "any" langage".

The problem isn't a matter of langage nor even a problem that writting and maintaining more complex code in a langage than with another one.

The problem is a matter of "how it's done now".

The core of OTTD is about it's way to store and manage the map.
We can change the way it's coded, but this implies many changed in all features of the program.

And for some benefits it may bring some enormous limitations.

You may have the same problems with any langage.


Right now OpenTTD can't manage some few games, this due to their number of vehicles moving all at the same time, CargoDist (it does use RAM), constant pathfinding, etc.

Game Scripts or AIs will only slow down your game. And they are stored in the savegame as well as the NewGRFs.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 39 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.