Page 6 of 9
Re: TARS Town Set [Progressing; coder found]
Posted: 20 Aug 2012 06:36
by Purno
SwissFan91 wrote:michael blunck wrote:Yikes! What sort of contagious disease did attack those poor houses?
regards
Michael
I'm addressing that. I guess it's better to draw big lumps of snow during the snow transition. Has anyone got any tips on doing so?
Shouldn't roofs have less snow than the landscape since houses have heating? Is a snow transition for roofs necessary?
Re: TARS Town Set [Progressing; coder found]
Posted: 20 Aug 2012 06:46
by Andrew350
Maybe just the edges of the roofs (above the overhangs) should have snow in the transitions. Only in full snow should the main (heated) part of the roof have any snow on it, otherwise it would usually just melt away (as Purno said).
Re: TARS Town Set [Progressing; coder found]
Posted: 20 Aug 2012 09:20
by michael blunck
Purno wrote:
Shouldn't roofs have less snow than the landscape since houses have heating?
I don´t think so. In older times, w/o thermal insulation (of the roof), thrifty heating was too marginal to melt snow on the roofs, especially in continental/alpine climate. In fact, the snow itself played an important role as thermal insulation. And with modern thermal insulation, the only source for melting snow on roofs are warmer temperatures from outside (mostly direct sun, but also warm air).
Purno wrote:
Is a snow transition for roofs necessary?
It´s not "necessary", but depends on the ideas of the artist.
In any way, the correct procedure to do it would be like this:
- when snow first starts to fall, it will cover the roof in full, not in "speckles" (s.a.), although as a very thin layer at first, but nevertheless, I´d make the full roof snow-covered,
- with more snow falling, one could try to draw the snow "thicker",
- when melting, snow usually slides down from the upper parts of the roof, with the last remnants usually hiding in some shady places (behind chimneys, dormers, roof edges, ...).
regards
Michael
Re: TARS Town Set [Progressing; coder found]
Posted: 20 Aug 2012 17:15
by SwissFan91
when snow first starts to fall, it will cover the roof in full, not in "speckles" (s.a.), although as a very thin layer at first, but nevertheless, I´d make the full roof snow-covered,
- with more snow falling, one could try to draw the snow "thicker",
- when melting, snow usually slides down from the upper parts of the roof, with the last remnants usually hiding in some shady places (behind chimneys, dormers, roof edges, ...).
This is my thinking, too. I may end up drawing all of my graphics having 'thick snow' in December/January.
[EDIT] Although, thinking about it, this approach may look odd in that, during the transition when first snow arrives, roofs will have a full covering while the ground tiles will only have a dusting..
Re: TARS Town Set [Progressing; coder found]
Posted: 20 Aug 2012 18:13
by planetmaker
SwissFan91 wrote: when snow first starts to fall, it will cover the roof in full, not in "speckles" (s.a.), although as a very thin layer at first, but nevertheless, I´d make the full roof snow-covered,
- with more snow falling, one could try to draw the snow "thicker",
- when melting, snow usually slides down from the upper parts of the roof, with the last remnants usually hiding in some shady places (behind chimneys, dormers, roof edges, ...).
This is my thinking, too. I may end up drawing all of my graphics having 'thick snow' in December/January.
[EDIT] Although, thinking about it, this approach may look odd in that, during the transition when first snow arrives, roofs will have a full covering while the ground tiles will only have a dusting..
I agree, that will look odd, if the gardens have no snow while the adjacent grass has some. Though I also agree that the very fine snow patches as shown in the screenshot look a bit funky, too
And as I didn't mention it yet: what I see so far looks tasty

Re: TARS Town Set [Progressing; coder found]
Posted: 21 Aug 2012 07:38
by Eddi
i have a feeling your snowline-transition detection is one level too low. there's partially snowed houses on the same level as green grass, and fully snowed houses on same level as partially snowed grass, etc.
Re: TARS Town Set [Progressing; coder found]
Posted: 21 Aug 2012 08:02
by Yoshi
Eddi wrote:i have a feeling your snowline-transition detection is one level too low. there's partially snowed houses on the same level as green grass, and fully snowed houses on same level as partially snowed grass, etc.
I'll look over the code

Re: TARS Town Set [Progressing; coder found]
Posted: 25 Aug 2012 16:48
by wallyweb
From my tile grid newobject grf:
Code: Select all
// Action 2 for object
// Ground sprite = bare ground 3929 = 0F59
// <Sprite-number> * <Length> 02 07/09 <set-id> 00 <groundsprite> <buildingsprite> <xoffset> <yoffset> <xextent> <yextent> <zextent>
// Flat
24 * 17 02 0F 00 00 8D 0F 00 00 00 80 00 80 00 00 0F 0F E5 // 00 FLAT grass 3981 0x0F8D
25 * 17 02 0F 01 00 C6 11 00 00 00 80 00 80 00 00 0F 0F E5 // 4550 desert 0x11C6
26 * 17 02 0F 02 00 8D 0F 00 00 00 80 00 80 00 00 0F 0F E5 // 3981 rainforest 0x0F8D
27 * 17 02 0F 03 00 C6 11 00 00 00 80 00 80 00 00 0F 0F E5 // 4550 snow 0x11C6
//=====================================================================================
// varAction 2 - Terrain Type check
// 0 normal, 1 desert, 2 rainforest, 4 on or above snowline
// Flat
158 * 26 02 0F 5F 81 41 00 FF 04 00 00 00 00 01 00 01 01 02 00 02 02 03 00 04 04 4C 00
This places the appropriate ground tile under the sprite.
It will also transition the ground tile for variable snow lines.
I can (and have done) add different sprites for each ground tile that also transition with the variable snow line. This is not an issue.
So the question remains ... How can we detect the 1/4, 1/2 and 3/4 snowed tiles?
Re: TARS Town Set [Progressing; coder found]
Posted: 25 Aug 2012 17:18
by planetmaker
wallyweb wrote:So the question remains ... How can we detect the 1/4, 1/2 and 3/4 snowed tiles?
Very simple, check for height differences, not for tile types:
* query the tile height and the snowline.
* calculculate the difference and
** height - snowline <= -2: no snow
** height - snowline = -1: 1/4 snow
** height - snowline = 0: 2/4 snow
** height - snowline = 1: 3/4 snow
** height - snowline >= 2: 4/4 snow
You only need the tiletype to check whether it is a ground tile.
See e.g.
http://dev.openttdcoop.org/projects/ope ... locks.pnml which makes mathematically slightly faster use of comparisons and creation of a properly crafted temporary register which then is used to decide on the snowyness of the sprites to show.
OpenGFX users can enjoy smooth transitions e.g. for rivers, locks and canals already since last Christmas
EDIT: Also mind that the definitions of the height variables differ in grf v7 and grf v8. The linked code is grf v8.
Re: TARS Town Set [Progressing; coder found]
Posted: 25 Aug 2012 19:38
by wallyweb
planetmaker wrote:Very simple, check for height differences, not for tile types:.
Should be easy enough.
... .pnml
Unfortunately I only code in the pure environment of NFO ...
which makes mathematically slightly faster use of comparisons and creation of a properly crafted temporary register which then is used to decide on the snowyness of the sprites to show.
which should be doable in nfo?
OpenGFX users can enjoy smooth transitions e.g. for rivers, locks and canals already since last Christmas

Is Saint Nicholas aware of this?
EDIT: Also mind that the definitions of the height variables differ in grf v7 and grf v8. The linked code is grf v8.
Good to know as I code for OTTD/TTDP compatibility.
Now all I have to do is find out in which variables snow line and tile height are hiding. I assume that GRFSpecs will have these ... It will, won't it ?
Thanks for this.
Re: TARS Town Set [Progressing; coder found]
Posted: 25 Aug 2012 19:47
by planetmaker
wallyweb wrote:planetmaker wrote:Very simple, check for height differences, not for tile types:.
Should be easy enough.
... .pnml
Unfortunately I only code in the pure environment of NFO ...
which makes mathematically slightly faster use of comparisons and creation of a properly crafted temporary register which then is used to decide on the snowyness of the sprites to show.
which should be doable in nfo?
OpenGFX users can enjoy smooth transitions e.g. for rivers, locks and canals already since last Christmas

Is Saint Nicholas aware of this?
Of course

The
changelog as of 24 Dec 2011 knows it
EDIT: Also mind that the definitions of the height variables differ in grf v7 and grf v8. The linked code is grf v8.
Good to know as I code for OTTD/TTDP compatibility.
Now all I have to do is find out in which variables snow line and tile height are hiding. I assume that GRFSpecs will have these ... It will, won't it ?
Thanks for this.
Of course all that can also be implemented in NFO; NML cannot do more than is feasible with NFO. But it might (or might not) turn out much more lengthy for cases like these (would take me hours to figure out these things in NFO - less test them). Tile height is
var 0x62 for objects, snowline is
global variable 0x20 for varaction2 usage.
Re: TARS Town Set [Progressing; coder found]
Posted: 25 Aug 2012 20:32
by wallyweb
planetmaker wrote:...
/me goes to play with his new toys.

Re: TARS Town Set [Progressing; coder found]
Posted: 27 Aug 2012 15:06
by SwissFan91
Here's something I finished off and added:

- dom both.png (2.38 KiB) Viewed 9222 times
From:
Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 09:56
by SwissFan91
Here's my brainstorm for how to draw snow transitions:
Code: Select all
0 (no snow) = no snow on roofs
no snow on edges
no snow on floor
1 = small lumps on edges of roofs
no snow on edges
snow only on floor where sheltered e.g. under overhanging areas and behind walls
2 = medium sized lumps on bottom half of roofs, less on sides facing 'sun' (light in TTD)
no snow on edges
snow in small lumps on floor
3 = snow on most of the roof bar any areas of heat (chimneys, etc.) or steep areas of roof. Partial melt on roofs facing the 'sun' (light in TTD)
snow on edges that are in shadow (protected from the 'sun' (light in TTD))
mainly snow on floor but pathways worn away
4 (full snow) = full snow on roofs
full snow on edges
full snow on floor
*edges = top of walls, fences, railings etc.
Here's an in-game screenshot for reference (with the
OLD method of snow on buildings):

- screenshot#7.png (43.36 KiB) Viewed 9114 times
What do people think? Advice would be very much appreciated.
Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 10:23
by planetmaker
Nice
I think at 1/4 snow the snow patches could be less but slightly larger
At the no-snow stage the grass could be like the surroundings - similar like for all the snow stages.
Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 10:26
by SwissFan91
Thanks for the feedback, PM. I hope you noted that the screenshot is with the
OLD version of doing snow transitions, not the outlined method above it
The grass below the buildings will be fixed, too. That is unintentional.
Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 10:50
by planetmaker
SwissFan91 wrote:Thanks for the feedback, PM. I hope you noted that the screenshot is with the
OLD version of doing snow transitions, not the outlined method above it
Sorry, no, I overlooked that

Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 10:56
by SwissFan91
I've stressed it a bit more now

Re: TARS Town Set [Progressing; coder found]
Posted: 02 Sep 2012 20:59
by SwissFan91
Here's something I did quickly:
OLD:

- for sac.png (3.24 KiB) Viewed 9046 times
NEW:

- new snow transitions.png (3.31 KiB) Viewed 9046 times
Done based on the criteria I outlined above. Thoughts?
Re: TARS Town Set [Progressing; coder found]
Posted: 03 Sep 2012 04:21
by Supercheese
Very nice, definite improvement.
