News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Seasons for buildings

Started by Leartin, January 08, 2015, 01:23:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leartin

I can't be the first who thought about it, but I couldn't find a thread.

I'd like to have seasons for buildings, mainly for two reasons
[1] Buildings with a lot of greenery should be able to reflect spring, fall and a snowless winter (since trees lose their leaf even without snow)
[2] To be able to use a season-dependant frontimage-overlay to add details corresponding to several festivities, like christmas, easter, halloween. Basically, I could create some jack-o-lanterns and just spread them over many building in appropriate positions using image offset.


I'm not sure why buildings currently don't use seasons, I just found some snippets about fields not being buildings, thus having seasons but no rotations. This would mean adding seasons to building would allow for fields to be buildings and gain all their benefits as a side effect, but that's a digression.

I don't think it would be much of an issue regarding calculation power. Except for the season change, which already might freeze the game a bit, but that's not really influencing the gameplay itself (unless you play with really short years, I guess?)
The reason why I think it can't be that much is, simply put, that there are already so many different possible graphics. Each building object might have 16 different appearences - not counting animations which are basically infinite. So I don't think some more possibilities which won't even be used by most buildings (just like rotations, and even snow graphic) hurt too much.


Other than the snow graphics, seasons don't really need to be completely different to each other. The difference between a snow-image and a december-image might just be that one has extra light pixels on a fir tree. Of course, they can be completely different, but if they are not it's not as bad as having no snow image for a building. Therefore, using it won't result in all buildings needing to use it to fit together - except maybe for parks which are just too green.



That being said, I'd like seasons for buildings to be a bit different than usual. This is because I'd like to use the parameter currently used for "snow or not" in dats, and it should be backwards compatible.
First, if you want to use seasons, add a parameter (number_of_seasons?) to state how many there are (at least 2,4 and 12 should be possibilities)
Then, use
  • for "normal image" (eg. shown in building menu) and [1] for "snow image".
    Then, use any number from 1 to 1+number_of_seasons for the image of that season.
    Any season not specified falls back to image
  • (or [1])

    An additional parameter might state whether the snow-image overwrites seasons or the other way around. Admittedly, it would be even better to have snow completely seperated, but that too much I think


Ters

Seasons in Simutrans are climatic seasons, so using them for christmas and easter won't work, unless having the time for easter vary with elevation and the there isn't christmas in the tropics is acceptable. 4 seasons would probably be enough, to match trees. You can't have both winter/spring based seasons like Simutrans has now and calendar based images, without a significant increase in the number of images the poor artists must produce.

Leartin

Trees only have four seasons, 5 images, but Fields have up to 96, shown one after the other.
If nothing changed drastically since the stable, those seasons are not affected by the climate zone at all - except for the snow-graphics, since the snowline recedes gradually in spring and comes back to the valleys in fall. But when the time indicator changes from summer to fall, all trees turn yellow and red at once (except those in snowy area)

The "significant increase in the number of images" is only a potential. I would not even know what to draw most of the year if the building in question has no garden, hence my proposal made use of a default image for every time no other image is used. As I said, every building already has potentially an "infinite" number of images with animations, but you would not say "we can't have animations for buildings, poor artists would need to animate every building"
I already gave a simple example how multiple buildings could get the same jack-o-lantern frontimage overlay. This is a cheap and easy way to update many older buildings at once with small changes, which have an effect only while playing and seeing them everywhere. Or does your house really look that different just because it is easter? Nah, probably just an easter bunny hiding somewhere, or an easter basket half hidden behind a bush. Even different seasons are not that hard to do, spring and fall is mostly a palette swap for trees, maybe adding some bloom or apples depending on the season, but nothing is as drastic as adding snow. The hardest job for graphic artists is done already.

prissi

Season are not hard to implement, only CPU consuming for the change (because of the way of buildings, since some coudl have animation for certain seasons or not). makeobj would handle those extra images easily.

Sarlock

I've thought about this in the past as well.  It does add more work to create a building, but the artist is under no obligation to provide images for all seasons.  And, as you say, it only realistically impacts trees and shrubs, so it doesn't require a huge amount of work to provide 5 images instead of 2 (summer/snow).

The most pleasing visual aspect would be winter images having trees that no longer have summer foliage.
Current projects: Pak128 Trees, blender graphics

Ters

Quote from: Leartin on January 08, 2015, 09:10:26 PM
Trees only have four seasons, 5 images, but Fields have up to 96, shown one after the other.
If nothing changed drastically since the stable, those seasons are not affected by the climate zone at all - except for the snow-graphics, since the snowline recedes gradually in spring and comes back to the valleys in fall. But when the time indicator changes from summer to fall, all trees turn yellow and red at once (except those in snowy area)

But adding snow to the building was one of the purposes you had for seasons. It's very strange that a building is suddenly covered in snow while the ground around it is still green, just because it's January. As far as I can see from the code, trees use the spring or autumn image when the snow line is at the next higher level and the global season is summer, so it's a bit of a strange hybrid. Tropical trees are maybe meant to go through a rain season cycle.

Leartin

Quote from: Ters on January 09, 2015, 06:13:45 AM
But adding snow to the building was one of the purposes you had for seasons.
Both trees and fields use the last index of their seasons as the snow image. The snow image "overwrites" all other images in case of snow. This is nothing I suggested, it's just the way it is now. If you think it's more feasable to add another variable, to devide snow from seasons, I'm actually all for it - I just thought it would be easier the way it is now.

What I suggested was to let the object designer decide whether snow-image beats season image or the other was around. If snow image would always beat season image, you would seldom get christmas images except maybe in the desert - not really christmassy there though. So I would create a front image that fits both, standard and snow backimage. But yeah, it's hack-ish, a clear devision is preferable (but results in double the amount of images - in theory)

QuoteSeason are not hard to implement, only CPU consuming for the change (because of the way of buildings, since some coudl have animation for certain seasons or not).
Would this occur only if there are season images defined, or all the time? What if you add a configuration button for the player, "turn off seasons", would it still affect cpu consumtion? I could live with some consumption for the change, but obviously it would be bad for pak64 players to need to wait without any change occuring.

TurfIt

Unless I'm really missing something, buildings already have season image capability...  ???


Quote from: Leartin on January 09, 2015, 11:01:13 AM
Would this occur only if there are season images defined, or all the time? What if you add a configuration button for the player, "turn off seasons", would it still affect cpu consumtion? I could live with some consumption for the change, but obviously it would be bad for pak64 players to need to wait without any change occuring.
'turn off seasons' could help, but that would need to be coupled with 'static forests'. The season change is the only time when trees spawn/die, and this tree processing is where most of the time is spent - other objects changing images is far less significant. Unless you covered the entire map in urban sprawl of course!

Also, you should find recent nighlies to be much much faster at snowline/season changes (and phase 2 of the speedup is still in progress), so I wouldn't really worry about the performance of this.

Ters

Quote from: TurfIt on January 09, 2015, 03:59:16 PM
Unless I'm really missing something, buildings already have season image capability...  ???

Yes, but actually only two seasons: with and without snow. And it's tied to the climate and climatic season, not the calendar.

TurfIt

Ah yes, it's passing only the snow flag as the season number. That would be relatively trivial to change I think... 1 bit short for the flag though - how many animation frames are needed? 256 seems overkill, would 32 do? (is there any pak out there with more?)


Quote from: Ters on January 09, 2015, 04:29:18 PM
And it's tied to the climate and climatic season, not the calendar.
What do you mean by this? climate has no bearing on the image, only where you're allowed to build it. Not sure what a climatic season is...  The season changes at 4 fixed times per year (tied to the calendar month). Then there's the snowline which generally forces the winter image regardless of the actual season. You could flip straight from the summer image to the winter/snow one depending on your snowline settings. Trees have some extra logic that allows them to show the spring/fall images for a week or so while the snowline passes through them, could be applied to buildings too.

Leartin

Quote from: TurfIt on January 09, 2015, 05:21:31 PM
Ah yes, it's passing only the snow flag as the season number. That would be relatively trivial to change I think... 1 bit short for the flag though - how many animation frames are needed? 256 seems overkill, would 32 do? (is there any pak out there with more?)

Flemmbrav made a building for pak192.comic, which shows a moving garden model train. It uses 140 Frames. He also wanted to do something similar for my monument in the pak, but did not commit it yet, I don't know how many frames that has, knowing him, he probably went straight for the upmost limit. Not to say animation limit can't be cut ;)

TurfIt

Oh my :o. Guess the 65534 limit really did need lifting!

Flemmbrav

no problem at all, leartin will just get about 200 images for his monument, and there is an plan to keep it down to ~150.
And futhermore in my opinion real climatic images are much more usefull than one or two buildings, so please keep on doing this, i really want to see an autumnal setting for my trains! :D

btw. at the 65.534-thread there is a post listing our set only with about 10.000 images (our new challange?), so there is by far no reason to worry about it...

Ters

Quote from: TurfIt on January 09, 2015, 05:21:31 PM
What do you mean by this? climate has no bearing on the image, only where you're allowed to build it. Not sure what a climatic season is...

Climate has a bearing on the image because calc_bild does welt->get_climate( get_pos().get_2d() ) == arctic_climate. That means that in the artic climate, buildings will show the snow image all year round. Climatic season is just a term I came up with for the seasons that follow the snow line, so that some tiles have winter from November to April, while other tiles will have winter only in January (haven't checked if those exact months are possible).

Václav

Quote from: Flemmbrav on January 09, 2015, 07:51:08 PM
no problem at all, leartin will just get about 200 images for his monument, and there is an plan to keep it down to ~150.
Ouch, 200 images for monument? I would like to see it.  :)

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

TurfIt

r7507 should now have building seasonal images behaving the same as the tree seasons.

Sarlock

Wow, wonderful!  More work for the pak artists  ;D
Current projects: Pak128 Trees, blender graphics

Leartin

Thank you very much :D
In dat files, is it the same postion as the snow-image was, just with up to 5 "seasons" instead of 2?

TurfIt

The dat syntax is unchanged with the season specifiers matching those for trees. Options are:
  1 image -back/frontimage[][][][][][0]=allseasons.  No snow image.  ([0] may be omitted)
  2 images -[0]=allseasons, [1]=snow.
  4 images -[0]=summer, [1]=fall, [2]=winter, [3]=spring.   Winter image is used for snow.
  5 images -[0]=summer, [1]=fall, [2]=winter, [3]=spring, [4]=snow.


Fabio

:thumbsup:


Sent from my iPhone using Tapatalk

Leartin

Just to let you know it will definitely be used :)


Although it will be a while until it can be seen in play.

Václav

It would be good if TileCutter would be updated to allow creation of multiseasoned buildings.



Leartin, that house is good - but why roof changes colour (like if it would be covered with moss - but then colour changing should be negligible)?

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Leartin

I'm actually not quite sure. It's supposed to be a straw roof, and for some reason I thought it would be nice if it changed colors - greenish in spring, darker in fall, greyish in winter. Now I'm not sure if that actually happens or is just a strange information my mind invented just to lead me astray, and even if it happens surely it wouldn't be that extreme - but I'm a lunatic anyway, since I plan to complete the wood chain with a log-throwing-competition, so some strange colors shouldn't be a problem

Sarlock

Very nice!

It would look odd if the roof stayed green in the winter, so whether it's realistic or not, it looks good :)
Current projects: Pak128 Trees, blender graphics

Ters

It could be a sod roof, but they don't have any grid pattern. Maybe have a goat up there in the summer. (Or even a cow according to a Norwegian fairy tale.)

Leartin

:o a goat on the roof, standing on the ridge right above the gable. Letting it's goatee wave in the wind. Does not fit this building, but it will happen. Probably. Maybe. If I can sneak it by more sane co-developer  ;D

Fabio

A goat on the roof is very Chagall-like... Next a fiddler? ?


Sent from my iPhone using Tapatalk

Sarlock

Current projects: Pak128 Trees, blender graphics