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)
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.
I do like this idea...
Not sure if this is such a good idea, given the speed of many translations. Apart from the plural issues.
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) ;-)
Yeah. Tree ages are generally understood in years (if not centuries) IRL.
IMO, 0 months old is a bit lame... "just planted" would sound much better, wouldn't it? :::)
It would, unless it causes too much havoc in the code. Except that also, was it planted? Or did it just germinate naturally? ;-)
And is it growing on chalk or clay soil?
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.
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.
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).
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.
A "flyweight" design pattern might help with this. And it's OOP.
Ok, the new translation has been added.
Also: http://en.wikipedia.org/wiki/Flyweight_pattern
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.
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.
One could also p**** the position as step() method, then the tree could do without. And we can remove x offset too. Hmm.
[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.
yes, the create forest function do not scale right with map size.