What would take to implement diagonal rivers and canals on main trunk?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
speeder
Engineer
Engineer
Posts: 13
Joined: 16 Jul 2014 05:57

What would take to implement diagonal rivers and canals on main trunk?

Post by speeder »

So... I am making a map, possible because of the new height limits (I started it in 2014, before the height limit increase, result was super crappy and I gave up, now I am trying again).

One thing is bothering me is that my map to look good would require diagonal rivers... and seemly those doesn't exist (yet?).

I am a professional C++ coder, so if I decide to make a patch, would it be allowed? And what I would need to do?

LaChupacabra
Engineer
Engineer
Posts: 72
Joined: 08 Nov 2019 23:54

Re: What would take to implement diagonal rivers and canals on main trunk?

Post by LaChupacabra »

When it comes to graphics issues:
OpenGFX + Landscape has diagonally rivers.
OpenGFX+Landscape - diagonall rivers.PNG
OpenGFX+Landscape - diagonall rivers.PNG (282.23 KiB) Viewed 265 times
Regarding diagonally canals:
I haven't seen it anywhere, but I have pre-made such graphics.
Diagonally canals.gif
Diagonally canals.gif (375.85 KiB) Viewed 231 times
I could finish them, but I would need a template that I couldn't find. This is nothing special, it would certainly be more difficult to code it, although it might be possible to adapt the code for diagonally rivers from OpenGFX. This code is not perfect, not everything looks good (especially wider rivers and lakes) so it could be improved a bit. As for the river graphics themselves, I also have their improved version.
OpenGFX+Landscape - diagonall rivers + improvements.png
OpenGFX+Landscape - diagonall rivers + improvements.png (45.4 KiB) Viewed 265 times
They're not perfect, but at least you can't see those horns.

Regarding construction of diagonally rivers and canals:
I have graphics for the construction of such elements. This is also nothing special, but it might be useful (or maybe not). Most of the graphics I did about a year ago, when I was working on a map, where there were a lot of such diagonally rivers - building point by point was a arduous. I wanted to post a suggestion to improve the editor, which would be very useful...

Edit: I am not entirely convinced to change the graphics in the main version of the game. But it can always be an addon or even a new base graphics set.

User avatar
kamnet
Moderator
Moderator
Posts: 7157
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: What would take to implement diagonal rivers and canals on main trunk?

Post by kamnet »

LaChupacabra wrote:
19 May 2020 16:26
Edit: I am not entirely convinced to change the graphics in the main version of the game. But it can always be an addon or even a new base graphics set.
These would be a great contribution to OpenGFX+ Landscapes.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9404
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: What would take to implement diagonal rivers and canals on main trunk?

Post by planetmaker »

I always wondered whether that should be done - and it definitely is a good addition to OpenGFX+Landscape. And tbh, I forgot why I didn't include the diagonal rivers in the OpenGFX base set itself... or if it was just lazyness and/or a desire to keep one unique feature to OpenGFX+Landscape or some technical limitation for base sets.

Rivers and canals are technically the same and the only difference is the waterclass which is used to decide which sprites are being drawn. Thus technically the very same code could be duplicated and canals would have the same feature.

The source of OpenGFX+Landscape is freely available under GPL v2+. You find the river (and canal) code at https://kallithea.openttdcoop.org/ogfx- ... ivers.pnml - I might soonish migrate that to a GitHub repository.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5673
Joined: 27 Nov 2004 15:05
Location: Canada

Re: What would take to implement diagonal rivers and canals on main trunk?

Post by wallyweb »

I have been toying with diagonal rivers using newobjects since way back in TTDPatch days. One of the advantages of TDDPatch is that it used the same "water" for seas, rivers and canals. With this, one could use diagonal steep slope sea tiles as <groundsprite> and draw a diagonal half steep slope/half river tile as a <buildingsprite> for some interesting canyon/fjord effects. Unfortunately this is not currently possible with OpenTTD.

planetmaker has done some amazing Action5 work with OpenGFX+Landscape but to be honest, this should be generally available throughout the game (steep slope/water included). I took a look at his code a while ago and to be honest I found it to be quite complicated. Perhaps I need to take another look at it when I complete some of my current projects. The pity is that it is currently a GRF solution to add to an existing feature. Hopefully somebody can develop a way to expand the feature itself.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 5 guests