show different age for tree objects January 03, 2010, 02:29:24 pm show different age for tree objects old: [age] months oldnew:age 0 months = 0 months oldage = 1 month = 1 month oldage 2 -11 months = x months oldage 12 - 23 months = 1 year oldage > 23 months = x years oldchanged translate string "Monate alt" to "months old"add translate strings "month old", "year old" and "years old"different_show_age_treeobjects.diff Quote Selected
Re: show different age for tree objects Reply #1 – 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. Quote Selected
Re: show different age for tree objects Reply #2 – January 03, 2010, 07:05:46 pm I do like this idea... Quote Selected
Re: show different age for tree objects Reply #3 – 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. Quote Selected
Re: show different age for tree objects Reply #4 – 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) ;-) Quote Selected
Re: show different age for tree objects Reply #5 – January 04, 2010, 09:04:45 pm Yeah. Tree ages are generally understood in years (if not centuries) IRL. Quote Selected
Re: show different age for tree objects Reply #6 – January 05, 2010, 07:51:24 am IMO, 0 months old is a bit lame... "just planted" would sound much better, wouldn't it? : Quote Selected
Re: show different age for tree objects Reply #7 – 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? ;-) Quote Selected
Re: show different age for tree objects Reply #8 – January 05, 2010, 10:42:03 am And is it growing on chalk or clay soil? Quote Selected
Re: show different age for tree objects Reply #9 – 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. Quote Selected
Re: show different age for tree objects Reply #10 – 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. Quote Selected
Re: show different age for tree objects Reply #11 – 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). Quote Selected
Re: show different age for tree objects Reply #12 – 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. Quote Selected
Re: show different age for tree objects Reply #13 – January 18, 2010, 09:50:44 am Quote from: prissi – on January 05, 2010, 09:23:51 pmI 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. Quote Selected
Re: show different age for tree objects Reply #14 – January 18, 2010, 10:00:03 pm Ok, the new translation has been added. Quote Selected
Re: show different age for tree objects Reply #15 – January 18, 2010, 10:27:59 pm Also: http://en.wikipedia.org/wiki/Flyweight_pattern Quote Selected
Re: show different age for tree objects Reply #16 – 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. Quote Selected
Re: show different age for tree objects Reply #17 – January 19, 2010, 07:30:20 am Quote from: prissi – on January 18, 2010, 10:49:34 pmThiis 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. Quote Selected
Re: show different age for tree objects Reply #18 – 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. Quote Selected
Re: show different age for tree objects Reply #19 – 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. Quote Selected
Re: show different age for tree objects Reply #20 – 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. Quote Selected
Re: show different age for tree objects Reply #21 – January 19, 2010, 06:42:05 pm yes, the create forest function do not scale right with map size. Quote Selected