The International Simutrans Forum

PakSets and Customization => Pak128 => Pak128 Bug Reports => Topic started by: omoikane on January 09, 2013, 03:46:55 PM

Title: Too many tree plantations for single industry chain
Post by: omoikane on January 09, 2013, 03:46:55 PM
I'm using simutrans 112.1 with Pak128 version 2.2.0. but tree plantation's production rate is around 20-40. so even single wood-consuming factory chain creates lots of tree plantations (around 10-20). This makes currently playing region with full of tree plantations.

Is there a good solution for decrease number of tree plantations for future industry chains or I just have to delete existing tree plantations and add new ones with high production by using map editing tool?

Title: Re: Too many tree plantations for single industry chain
Post by: Zeno on January 09, 2013, 04:01:30 PM
On one hand, I also think they have a rather low production, but on the other hand you can fix that by providing enough electricity, passengers and mail to the sawmill. Its production will increase probably over your forests' production rate.
Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 09, 2013, 06:17:21 PM
Tree plantations should produce 10x or even more IMHO.
Oil fields and rigs should also produce 5x and coal mines 10-15x.
Title: Re: Too many tree plantations for single industry chain
Post by: VS on January 09, 2013, 10:14:35 PM
That's weird, usually there were about 2 forests per consumer and I can not remember changing the numbers. 10 forests per consumer is a bug.

I'll take a look in foreseeable future.
Title: Re: Too many tree plantations for single industry chain
Post by: Zeno on January 09, 2013, 10:42:36 PM
Oh, my... I thought it was a feature those forests producing 50 or 60 units/month!!!!  :o
Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 10, 2013, 06:00:35 PM
Even 2 seem a bit too many IMHO.
I would rather see one plantation serving 2-3 consumers, coal mines serving 5-10 consumers and oil fields serving 4-6 consumers.
Title: Re: Too many tree plantations for single industry chain
Post by: z9999+ on January 12, 2013, 10:49:34 AM
I may be wrong but I think this is the problem of simutrans code.


sint32 produktion = fab->get_base_production() * fb->get_produkt(gg)->get_faktor();
// the take care of how much this factorycould supply
verbrauch -= produktion;



Setting of ForestPlantation is...


name=ForestPlantation
Productivity=10
Range=10
min_fields=10
production_per_field=1


As this formula, production of new ForestPlantation will be 20-30. But simutrans calculates each one as 10.
As a result, ForestPlantation will be four times more  built.

Am I wrong ?
Title: Re: Too many tree plantations for single industry chain
Post by: Zeno on January 12, 2013, 12:48:30 PM
Uhm, then why that doesn't happen with other industries? Or does it happen?  ???
Title: Re: Too many tree plantations for single industry chain
Post by: VS on January 12, 2013, 01:06:52 PM
Maybe production_per_field=0 could help that?
Title: Re: Too many tree plantations for single industry chain
Post by: dennosius on January 12, 2013, 01:33:30 PM
That's really a problem. On a 1024² map, I had around 200 lines just for wood delivery (which usually requires to collect wood by road transport and get it to one common train station per chain) and it's not fun if you have to solve the same problem 50 times on a map.

Coal is fine IMHO. Probably in real life one coal mine serves several consumers (and not the other way round), but Simutrans is weak in using overcapacity in existing chains for building new chains (so if there was spare coal from a mine that only served one consumer, Simutrans would still build a new one when establishing a new industry chain that needs coal). Also, getting all load from ore mines (which produce around as much ore as proposed here for coal) is already painful even with modern vehicles.

Title: Re: Too many tree plantations for single industry chain
Post by: z9999+ on January 13, 2013, 01:38:48 PM
The first problem is what I wrote above. It needs to subtract start fields production, too.
The second problem is below.


else if(  build_fields  ) {
// make sure not to exceed initial prodbase too much
sint32 org_prodbase = prodbase;
// we will start with a minimum number and try to get closer to start_fields
const uint16 spawn_fields = besch->get_field_group()->get_min_fields() + simrand( besch->get_field_group()->get_start_fields()-besch->get_field_group()->get_min_fields() );
while(  fields.get_count() < spawn_fields  &&  add_random_field(10000u)  ) {
if (fields.get_count() > besch->get_field_group()->get_min_fields()  &&  prodbase >= 2*org_prodbase) {
// too much productivity, no more fields needed
break;
}
}
sint32 field_prod = prodbase - org_prodbase;
// adjust prodbase
set_base_production( max(field_prod, org_prodbase) );
}



This code is completely wrong. This always set only org_prodbase as production.
Base production must be multiplying number of fields by field production plus org_prodbase.
Title: Re: Too many tree plantations for single industry chain
Post by: Dwachs on January 13, 2013, 07:00:57 PM
Quote from: z9999+ on January 13, 2013, 01:38:48 PM
This code is completely wrong. This always set only org_prodbase as production.
Base production must be multiplying number of fields by field production plus org_prodbase.
Hm, it depends all on what the purpose of this piece of code is. As it is now, it ensures that (1) a prescribed production base is set (it could come from factory editor) and (2) that at least the minimal production from fields is there.

Quote from: z9999+ on January 12, 2013, 10:49:34 AM
I may be wrong but I think this is the problem of simutrans code.

sint32 produktion = fab->get_base_production() * fb->get_produkt(gg)->get_faktor();
// the take care of how much this factorycould supply
verbrauch -= produktion;

prodbase already includes production from fields.

The easiest (and most obvious) solution would be to increase forest base production (Productivity).

Edit: The wrong part of the 'completely wrong' snippet of code is fixed in r6270. Now initial production is increased by initial fields too. For factories placed by map editor functions it is ensured that initial productivity is the same value as the value in the editor window.
Title: Re: Too many tree plantations for single industry chain
Post by: ronnie89b on January 19, 2015, 07:11:23 PM
Hi guys! I rarely create new maps (I've played my single map for 1,5 year).
I can see, this bug still appears in the game. Tree plantations monthly production is only 50-60 unit, (coal mines' productions should be higher, too) so I got dozens of them in a new map.
I tried some maps with same results: 100-120 tree plantations from 300 factory.

Quote from: Dwachs on January 13, 2013, 07:00:57 PM
The easiest (and most obvious) solution would be to increase forest base production (Productivity).
Why didn't somebody do it, or it's not the good solution?
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 19, 2015, 09:40:56 PM
Hi.

I will look further at this glitch in the next days and keep you informed if there are news. Right now, this week, I'm having a lot of tests at school so I can't take care of that immediatly.
Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 19, 2015, 10:28:31 PM
I personally support larger raw material suppliers, although I never involved myself in balancing.


Sent from my iPhone using Tapatalk
Title: Re: Too many tree plantations for single industry chain
Post by: DrSuperGood on January 20, 2015, 06:05:30 AM
I thought the small forests and coal mines was a deliberate act such to encourage the use of trucks/short trains and other small transport convoys. It also makes running such chains more tricky as you have lots of small suppliers to manage instead of a single large one.

That said I do feel that the open cast coal mine should have similar production to an open cast iron mine. I can understand the small mine shafts being numerous (as they were in real life) however big open cast mines produce on a much larger scale.

Also do be aware that plantations do grow over time. As long as you use them (they produce something) they will slowly add more fields until a maximum field number (defined by the pakset) is reached. As such a timber plantation with passenger supply and being allowed to grow can reach 200 units per standard month and possibly more.

Maybe a solution could be to make fewer base timber plantations but allow them to grow more fields? Having them with a sizable forest around and 400 or more per month production after some growing sounds like a reasonable compromise.
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 20, 2015, 04:34:26 PM
QuoteAlso do be aware that plantations do grow over time. As long as you use them (they produce something) they will slowly add more fields until a maximum field number (defined by the pakset) is reached. As such a timber plantation with passenger supply and being allowed to grow can reach 200 units per standard month and possibly more.

Maybe a solution could be to make fewer base timber plantations but allow them to grow more fields? Having them with a sizable forest around and 400 or more per month production after some growing sounds like a reasonable compromise.
This is exactly what we need, but I don't know if it is feasible by pak balancing or if a patch is needed to fix this.
Title: Re: Too many tree plantations for single industry chain
Post by: DrSuperGood on January 20, 2015, 06:18:04 PM
QuoteThis is exactly what we need, but I don't know if it is feasible by pak balancing or if a patch is needed to fix this.
All that you quoted is pakset related and already supported by the game. For example take a look at the pak64+food farms, they have large number of fields when fully developed, farm more than the forests end up with.
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 20, 2015, 06:58:14 PM
Nice. This will be done as soon as possible.
Title: Re: Too many tree plantations for single industry chain
Post by: DrSuperGood on January 20, 2015, 11:53:23 PM
I thought the pak128 farms also used field mechanics for most of their production with huge areas of fields? Again I wonder if the forests were purposely designed to produce so little.

In any case I would recommend something like an increase in field numbers of 50-100% (with appropriate reduction in numbers created). I imagine it would look quite pretty having a largish forest instead of small ones everywhere.
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 21, 2015, 04:27:01 PM
I disagree. Fields from forest plantations don't work the same as real forest, so having large fields of tree plantation would look weird with normal woods. In addition to that, forest plantation fields = same graphics on all tiles = ugly and boring.
Title: Re: Too many tree plantations for single industry chain
Post by: Vladki on January 21, 2015, 05:34:17 PM
Is there an option to have more types of fields for single industry? That way a forest plantation could get more variety

Sent using recycled electrons.

Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 21, 2015, 08:38:45 PM
Yes, it should be possible indeed.
I was planning to look into it at a certain point.... Maybe Sarlock would be the man for it...


Sent from my iPhone using Tapatalk
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 21, 2015, 10:15:40 PM
Well, it would be easy to make such graphics from existing trees.
Title: Re: Too many tree plantations for single industry chain
Post by: Sarlock on January 22, 2015, 12:16:51 AM
Absolutely... it's on my target list.  I have some pretty cool things under development, I am hoping to get some things assembled to meet the current SMSC (given the forest theme) deadline of Jan 27th and put them on display.  What I was thinking for plantation trees is to have 2-3 full grown images and then one half-grown tree image and one of freshly cut stumps.  This would give some nice variety to tree plantations - then we can consider increasing the number of fields.

Give me a week or two to present something.
Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 22, 2015, 01:41:24 PM
:thumbsup: Thank you!


Sent from my iPhone using Tapatalk
Title: Re: Too many tree plantations for single industry chain
Post by: tonu on January 22, 2015, 03:16:51 PM
Now fields grow at the same level the main "factory" is located, is it also possible that the fields grow in other levels? So the plantations spread about two levels over and two levels under the main.
Also, in cold climates pines are planted (mostly in northern hemisphere) but in tropical climates (as my province Entre Ríos, Uruguay and Southern Brazil) it is more common to plant eucaliptus (and it grows nine times faster because of the climate). Maybe in the future can be considered havind different plantations for different climates.
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on January 22, 2015, 04:46:54 PM
production of tree plantations increased (roughly doubled), now there are, on average, three plantations per sawmill.

commited r1560 (wait for it to be compiled on nightlies (http://nightly.simutrans-germany.com/), probably tonight).
Title: Re: Too many tree plantations for single industry chain
Post by: DrSuperGood on January 23, 2015, 12:46:21 AM
QuoteNow fields grow at the same level the main "factory" is located, is it also possible that the fields grow in other levels? So the plantations spread about two levels over and two levels under the main.
It is an issue with the field code. It also never makes terraces (artificial wall) preferring a far away remote field instead of a slope tile outside the backdoor. The result can be quite ugly if placement dictates the main building is placed in a non-flat area. An alternative would be sloped field support (e.g. sheep do not need flat land!) which would be used instead of terraces to get rid of ugly slopes resulting in open space inside fields.
Title: Re: Too many tree plantations for single industry chain
Post by: Leartin on January 23, 2015, 10:25:29 AM
Quote from: DrSuperGood on January 23, 2015, 12:46:21 AM
An alternative would be sloped field support (e.g. sheep do not need flat land!) which would be used instead of terraces to get rid of ugly slopes resulting in open space inside fields.

Do you propose sloped fields for "straight slopes" (those you can build ways on) only, or any slope? Since I don't think it makes any difference regarding the difficulty of programming, I'd really wish for the possibility to build every slope, but optionally so, similar to hard-slope-ways.

As a side-effect, one could give different slopes different kinds of productivity, so sloped fields are a bit inferior to flat fields. Or maybe sloped fields give more productivity if it's a vineyard ;)

As a very minor thing: Currently, fields are not buildings. I already proposed seasons for buildings, which seemed to be not too hard to do - but if buildings have seasons, fields could just be buildings, allowing them to get all the cool building features like animation and rotation. So, it might be feasable to think of these slope-located fields as something to integrate in the building features as well, since that was something wished long ago anyway.
Title: Re: Too many tree plantations for single industry chain
Post by: DrSuperGood on January 23, 2015, 04:35:36 PM
QuoteDo you propose sloped fields for "straight slopes" (those you can build ways on) only, or any slope? Since I don't think it makes any difference regarding the difficulty of programming, I'd really wish for the possibility to build every slope, but optionally so, similar to hard-slope-ways.
Would have to be any slope otherwise you will get ugly gaps in fields. Also if the field cannot be sloped (wheat farm not supporting double slope for example) then it should consider making a terrace instead using an artificial wall.
Title: Re: Too many tree plantations for single industry chain
Post by: tonu on January 24, 2015, 01:01:29 PM
The problem of having fields in slopes is that it increases the number of graphics needed. (If we don't consider slopes corners, we have four half slope views and maybe four full slope ones for each state of the fields for every factory that have fields), anyways, if someone paint that, the farms on slopes can be done with small terraces, like this:
http://guias-viajar.com/china/wp-content/uploads/2009/11/fotos-terrazas-arroz-longji-003.jpg (http://guias-viajar.com/china/wp-content/uploads/2009/11/fotos-terrazas-arroz-longji-003.jpg)
or this:
http://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Bancales_en_Bali.JPG/300px-Bancales_en_Bali.JPG (http://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Bancales_en_Bali.JPG/300px-Bancales_en_Bali.JPG)
Title: Re: Too many tree plantations for single industry chain
Post by: Fabio on January 24, 2015, 01:07:11 PM
Untainted slopes shouldn't of course be built, as a backward compatibility. But if an artist starts painting a new/upgraded industry with fields, he should be given full freedom to add slopes, rotations and the like.


Sent from my iPhone using Tapatalk
Title: Re: Too many tree plantations for single industry chain
Post by: ronnie89b on February 05, 2015, 02:01:18 PM
Thanks guys, the changes you did works fine. Tree plantations number reduced to normal.
Maybe the coal mines need a small increase, too?

Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on February 05, 2015, 06:36:01 PM
Coal mines look good to me, by how much would you like them to be increased ?
Title: Re: Too many tree plantations for single industry chain
Post by: ronnie89b on February 05, 2015, 09:24:32 PM
Quote from: gauthier on February 05, 2015, 06:36:01 PM
Coal mines look good to me, by how much would you like them to be increased ?

I think, I was a bit ambiguous.
Their number is ok, I thought their monthly production, it's a bit low.
Title: Re: Too many tree plantations for single industry chain
Post by: gauthier on February 06, 2015, 06:49:39 PM
Both values are bounded, if their production is increased, their number will decrease, since the game spawns enough of them to supply their clients.
Title: Re: Too many tree plantations for single industry chain
Post by: ABJ on February 16, 2015, 04:56:01 PM
Quote from: VS on January 09, 2013, 10:14:35 PM
That's weird, usually there were about 2 forests per consumer and I can not remember changing the numbers. 10 forests per consumer is a bug.

I'll take a look in foreseeable future.
I also sometimes get this problem. And in my case, (I don't know if it happens elsewhere also but I think it might; plz tell :D :) ) there are less of other industries. MUCH less. Forest, forest, forest everywhere with few other industry. And also (like this, ) only 1/2 sawmill (maybe because I play on very small maps :D but the effect is basically same.) Very woody.