The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Frank on January 03, 2010, 02:29:24 pm

Title: show different age for tree objects
Post by: Frank on January 03, 2010, 02:29:24 pm
show different age for tree objects

old:

[age] months old

new:

age 0 months = 0 months old
age = 1 month = 1 month old
age 2 -11 months = x months old
age 12 - 23 months = 1 year old
age > 23 months = x years old

changed translate string "Monate alt" to "months old"
add translate strings "month old", "year old" and "years old"

different_show_age_treeobjects.diff (http://simutrans-germany.com/~patches/download.php?file=different_show_age_treeobjects.diff)
Title: Re: show different age for tree objects
Post by: VS on January 03, 2010, 03:52:42 pm
Good idea.



Actually... we might as well consider using gettext if we're going to dive into plurals. Czech has three forms (1, 2-4, 5+) and rules for some other languages are a lot more complicated.
Title: Re: show different age for tree objects
Post by: jamespetts on January 03, 2010, 07:05:46 pm
I do like this idea...
Title: Re: show different age for tree objects
Post by: prissi on January 03, 2010, 08:14:42 pm
Not sure if this is such a good idea, given the speed of many translations. Apart from the plural issues.
Title: Re: show different age for tree objects
Post by: MHD on January 03, 2010, 08:52:51 pm
At least the idea with years instead months is better than now. The numbers are big and noone will calculate the years from it (except he feels very very bored) ;-)
Title: Re: show different age for tree objects
Post by: skreyola on January 04, 2010, 09:04:45 pm
Yeah. Tree ages are generally understood in years (if not centuries) IRL.
Title: Re: show different age for tree objects
Post by: Fabio on January 05, 2010, 07:51:24 am
IMO, 0 months old is a bit lame... "just planted" would sound much better, wouldn't it? :::)
Title: Re: show different age for tree objects
Post by: Isaac Eiland-Hall on January 05, 2010, 08:11:02 am
It would, unless it causes too much havoc in the code. Except that also, was it planted? Or did it just germinate naturally? ;-)
Title: Re: show different age for tree objects
Post by: jamespetts on January 05, 2010, 10:42:03 am
And is it growing on chalk or clay soil?
Title: Re: show different age for tree objects
Post by: VS on January 05, 2010, 10:59:33 am
An useful addition would be one comprehensive info window for all trees on tile, instead of a score of these... Of course that is entirely different matter.
Title: Re: show different age for tree objects
Post by: prissi on January 05, 2010, 09:23:51 pm
I was also thinking of merging trees in a single structure to save memory (like TTD does), but then the "pure" OOP approach let me abstain from it.

However, it seems that tree age in years is a majority vote, so it will be done.
Title: Re: show different age for tree objects
Post by: skreyola on January 05, 2010, 09:47:39 pm
I think trees under 1month old should still say 1 month... perhaps tree ages should start counting at 1... or display in this fashion: 1 month (for 0-1) ... 12 months (for 11-12), then 1 year, etc.
I don't think it should ever give the age as 0 months... Maybe 'sapling' or 'new' or 'days old' (without specifying the number).
Title: Re: show different age for tree objects
Post by: prissi on January 05, 2010, 11:04:11 pm
I would think a string like "%i years %i months" will be added. And honestly, you will almost never ever find a zero aged tree, unless you planted it deliberately at zero age.
Title: Re: show different age for tree objects
Post by: Spike on January 18, 2010, 09:50:44 am
I was also thinking of merging trees in a single structure to save memory (like TTD does), but then the "pure" OOP approach let me abstain from it.

A "flyweight" design pattern might help with this. And it's OOP.
Title: Re: show different age for tree objects
Post by: prissi on January 18, 2010, 10:00:03 pm
Ok, the new translation has been added.
Title: Re: show different age for tree objects
Post by: Spike on January 18, 2010, 10:27:59 pm
Also: http://en.wikipedia.org/wiki/Flyweight_pattern
Title: Re: show different age for tree objects
Post by: prissi on January 18, 2010, 10:49:34 pm
Thiis is slowing going towards offtopic but:
Trees are already only 12bit references and the position and so one is needed, as a tree in simutrans is allowed to be anywhere on a tile.
The only way out I see would be forest tiles with a predefined pattern for the trees (maximum four or so) with individual type and age but fixed position and so on. But I am not sure how to handle loading, or I rather thing this is a lot of work with not so much gain, as memory is usually not the limit nowadays.
Title: Re: show different age for tree objects
Post by: Dwachs on January 19, 2010, 07:30:20 am
Thiis is slowing going towards offtopic but:
Trees are already only 12bit references and the position and so one is needed, as a tree in simutrans is allowed to be anywhere on a tile.
The only way out I see would be forest tiles with a predefined pattern for the trees (maximum four or so) with individual type and age but fixed position and so on. But I am not sure how to handle loading, or I rather thing this is a lot of work with not so much gain, as memory is usually not the limit nowadays.
Also the displaying of multi-tree tiles will become a problem, if multiple trees are organized in one instance.

One possible change could be to remove the position from the ding_t cl****, since many derived cl****es only need to know their position on the map if their image is to be calculated (almost everything in dings/*). Only vehicles/grounds/maybe ways need to know their position always. This could save 5 bytes per object.
Title: Re: show different age for tree objects
Post by: Spike on January 19, 2010, 09:16:20 am
I just thought, since a few times it was suggested to players to turn treees off, since they make up for 30% of mein memory apparently, that there must be quite an overhead. I didn't knwo that trees had been optimized this much already.

For me, the trees are something important, particularly that they age, seed new trees, basicially that they are a micro ecological simulation in the Simutrans world.
Title: Re: show different age for tree objects
Post by: prissi on January 19, 2010, 03:03:26 pm
One could also p**** the position as step() method, then the tree could do without. And we can remove x offset too. Hmm.
Title: Re: show different age for tree objects
Post by: z9999+ on January 19, 2010, 03:32:01 pm
[off-topic]
Rate of wood on rectangle map is very bad.
If we start a new game with rectangle map like 1024x256 or 256x1024, more than 80% of land is wood. I feel this is too much.
Title: Re: show different age for tree objects
Post by: Dwachs on January 19, 2010, 06:42:05 pm
yes, the create forest function do not scale right with map size.