Moderator: OpenTTD Developers
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?
OpenGFX + Landscape has diagonally rivers. Regarding diagonally canals:
I haven't seen it anywhere, but I have pre-made such graphics. 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. 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.
These would be a great contribution to OpenGFX+ Landscapes.
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?
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.
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.
I assumed that the code for these rivers could be quite extensive. But I didn't think that is so much.
With these river templates ... this division is a bit scary. I have the impression that some of the graphics found there are not used at all. Template for others, however, I still can't find. There are only graphics of rivers running along the field lines: \ NE, / NW, / SE, \ SW. I don't see those that run diagonally across the fields: (N, S, | W, | E), or small pieces of land in the corners of the field.
The waterfeatures.png template scared me a bit again. I really don't know where that all sprites goes. Earlier I thought it will be simpler separated. For example, for the new canals graphics (straight and diagonal) I anticipated the creation of 25 graphics for each climate in the version with and without dividing lines. In total, 25x12 = 300 graphics would be created. The same amount of graphics would apply to rivers on a flat surface. A lot, but much less than around 1180, which would only apply to rivers. I assumed that the canals graphics would be created by superimposing layers of water + waterfront with ground. I didn't anticipate any additional overlays because I thought it would significantly complicate the code... Although in some places such overlays could be useful, but not so many.
I don't know if you would like my versions of rivers and canals at all, but even if yes, I am afraid I won't be able to divide them properly and assign them to these templates.
I also don't know what your opinion is about the canals and rivers near to the slopes - will anyone want to add such a possibility. I think it would be worth it.
This is how it would look in the game ... On the occasion a small sample of deep water
I hope that jfs will not abandon his project. Here I used an additional two shades from outside the palette.
Yes, indeed. Not each sprite in the png files is being used (anymore). Other sprites used are not found as png files in the repository at all. Most (all? I forgot) ground sprites are generated by exporting the appropriate layers during the build process from the Gimp files found in the repository in the gfx-source directory. You want to look at gfx-source/terrain.xcf. Then see the xcf2png files which layers are exported to create the png files requested by the templates in the code (for the rivers it's src/gfx/water/waterfeatures.xcf2png). Their structure is simple:LaChupacabra wrote: ↑24 May 2020 22:48I assumed that the code for these rivers could be quite extensive. But I didn't think that is so much.
With these river templates ... this division is a bit scary. I have the impression that some of the graphics found there are not used at all.
Template for others, however, I still can't find. There are only graphics of rivers running along the field lines: \ NE, / NW, / SE, \ SW. I don't see those that run diagonally across the fields: (N, S, | W, | E), or small pieces of land in the corners of the field.
Thus it is "generated png file (to be used/referenced by the nml)" (TAB) "file to read from" (TAB) "Names of the layers to be active during export"src/gfx/water/riverbank_grid_temperate_ne.gimp.png gfx-source/terrain.xcf White BlueForShore GroundTemperate GridTemperate RiverbankMask RiverbankNE
These xcf2png files are used to create gimp scripts which in turn are used to automatically export the proper layers. Using these layered files and scripted layer export allows a consistent look and ensures that bug fixes or changes are propagated to all sprites of similar type. That is especially important when it comes to changes at tile borders to make sure transitions look smooth in all cases and you avoid the need to fix all road and rail and river and coast sprites afterwards manually when you modify the way the grass looks.
If you want to go and add / modify terrain sprites I very strongly suggest you to use these Gimp GFX source files and do modifications therein or at least use another graphics programme which supports layers.
Even better, clone the whole repository to your computer. Get to build it unmodified initially (it needs a few dev tools... nml, make, awk, grep, python3, bash). Then you will see also all intermediate files generated during the build process.
I already know what these sprites are for ... I forgot that rivers can flow across the slopes... Logic
It all sounds very simple ... for someone who has already do it.
I looked at these xcf files a bit and it seemed sensible at first. Later I looked in the xcf2png file and broke down because it is not simpler at all ... or at least I think so at this moment.
I can manage the canals. Rivers maybe too. I didn't coding, except for minor script changes, so here I temporarily doubt that I will succeed.
Before I move anything, I would have a few questions:
1. How do you see the possibility for each river embankment to have two versions? The choice of graphics could depend on the field coordinates. I ask in theory.
2. Would you be able to smooth the river banks? This pretty badly spoils the end result. This could work so that the river corner graphics would only be displayed when the field is adjacent to 2 or 3 other water fields in the specified layout, otherwise the diagonally river graphic would be displayed. 3. Would you be able to add the possibility to change the graphics of the river or canal as it is in the case of objects? In the case of point 2, this would make it possible to change the corner canal or river into an diagonally one or vice versa (more important). In the case of point 1, this would allow the graphic version to be changed to a different one (less important).
4. And the question about canals and rivers near the slopes is still valid.
Users browsing this forum: No registered users and 7 guests