News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Texture-Shore Problems

Started by Carl, September 05, 2013, 11:01:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carl

I've been having some trouble with modifying texture-shore.png, which seems very counter-intuitive. I'm not sure whether this is a help request or an extension request, but since there may be an existing solution to this that I haven't figured out, I'll put it here.

For a while I've been using an alternative lightmap -- similar to the OTTD/pakTTD idea -- which allows for smoother hills in some settings. It's a matter of taste, but I'd like to make it work. Its main problem comes with the shore textures. Here's the shore source image I'm currently using, and the problems that arise.



Three main oddities here:

1. Despite the fact that all of the lines in the shore texture are straight, the shore at point 1 has a curve in it. This can't be remedied without messing things up elsewhere. Specifically, if you alter the curve to make this shore straight, it will mess up the NE and SW facing shores which are currently straight. It appears to be impossible to have both the SE/NW facing shores and the NE/SW facing shores straight at the same time.

2. Despite the fact that the downward-facing slopes are smooth, the corresponding shore has a small jutting-out bit (point 2). Can this be avoided?

3. Shore here doesn't match the contours of the land, and appears on the upper level. Is there a way to avoid this?

Now maybe I need to alter other files (e.g. texture-slope or borders?) in order to get rid of some of these issues. Any tips would be welcome.


I have broader questions here about why the system is the way it is. Why is the relationship between the images in texture-shore.png and the output on the map so opaque? Also, why are there only four input images in texture-shore.png, when there are quite a few more possible shore tiles than this? This might be more user-friendly if there was one image for each possible shore tile.


kierongreen

Why are there only four input images? So that people don't have to draw all the different ones used by simutrans. When climates were linked to height it meant that 8 transition images, 15 lightmap images and 8 textures could generate the 300 or so tiles used by Simutrans. Adding transition images for every slope would mean you'd need to draw 28 transitions. This seemed to work well at the time 7(!) years ago.

Now of course (in Standard at least, Experimental hasn't implemented this yet) with per tile climates and double heights the possible combinations you would need would be ridiculous (you'd need in the order of 512 transitions I think to cover slope and climate combinations).

Regarding distortion - the code maps the texture to the slope tile so that the centre of the texture is the centre of the slope tile. If you look at tiles where only the north-west or south-east corner are raised and the other ones all flat you will notice that the centre of the slope tile doesn't lie on the line joining the north-east and south-west corners. Whereas for tiles where it's the north-east or south-west corner raised the centre does lie on the line joining the north-west and south-east corners.

It would be possible to map the texture to slope separately for above and below the join for these cases (maybe only for certain slopes), but would add considerably to code and would also alter the appearance of current paksets. Code is in grund_besch.cc - create_textured_tile_mix if you want to look.

Carl

I can certainly appreicate that individual transitions for climate transitions, etc, would be ridiculous in number, esp with the new double height feature. I wonder whether there might be some happy middle ground which would at least allow us to specify different shore transitions (but not slope or lightmap or climate) for NE and SE-facing shores -- combining these two is severe texture austerity! :) But I also appreciate that this stuff is deeply baked into the code and very difficult to change.

I'll see whether it's possible to make something satisfactory-looking by playing with texture-shore some more.


Dwachs

I am afraid that there is no easy solution to this problem. Either supply these transitions for all possible slopes, or provide additional information height information for the slopes :(

The first one would be easier to implement, but then the pak-set needs to supply a lot of images.
Parsley, sage, rosemary, and maggikraut.

Fabio

what about pakset supplied transitions and fallback to the present system for those transitions not supplied? artists might need just a handful of manual transitions, leaving the other program calculated.

prissi

Actually there was already some discussion about using costal slopes from a file. But then, with the different climates and single and double heights, this would be really a very large number. So it died again.

But if there is a basic image, which has two special colors, which are overlaid with a ground and a water tile, you ould need only as much images as the lightmap. Still a lot, but not as bad as 500+.