Production of raw materials industries
Moderator: OpenTTD Developers
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Production of raw materials industries
A question about production of raw materials industries. OTTD modifies production change for raw materials industries, so they change production not only by /2 (-50%) or *2 (+100%), but also by 12% for example. It is fine for default industry, but it is also applied to new industries in ECS. Because I specify callbacks 29 and 35, this behaviour is unexpected, because callback 35 result is 00 80 and callback 29 returns only 02 80 and 01 80 (ECS Iron ore mine for example). That means we need to decide, how to support this situation. I think GRF has to have full control over its industries. So:
1) the result should be stored. I suppose we can use var 93, but put all 256 values (not only 00, 04, 08, 10, 20, 40, 80).
2) wee need two more returns for callbacks 29 and 35
0D decrease production by 1 (var 93 = var 93 - 1)
0E increase production by 1 (var 93 = var 93 + 1).
TTDP could recognise them as 00 (I suppose it is hard to have more values for var 93 in TTDP)
1) the result should be stored. I suppose we can use var 93, but put all 256 values (not only 00, 04, 08, 10, 20, 40, 80).
2) wee need two more returns for callbacks 29 and 35
0D decrease production by 1 (var 93 = var 93 - 1)
0E increase production by 1 (var 93 = var 93 + 1).
TTDP could recognise them as 00 (I suppose it is hard to have more values for var 93 in TTDP)
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Production of raw materials industries
I was watching over the code and it seems to be working along the specs. Can you point out which behaviours might not be adequate?George wrote:A question about production of raw materials industries. OTTD modifies production change for raw materials industries, so they change production not only by /2 (-50%) or *2 (+100%), but also by 12% for example. It is fine for default industry, but it is also applied to new industries in ECS.
According to waht i've seen, it is actually the case. There is no randomization nor some chance percentage, everything is performed from the callback results. I wonder what makes you think otherwise. Note that i do not doubt you, just that i lack the data to evaluate it.George wrote: Because I specify callbacks 29 and 35, this behaviour is unexpected, because callback 35 result is 00 80 and callback 29 returns only 02 80 and 01 80 (ECS Iron ore mine for example). That means we need to decide, how to support this situation. I think GRF has to have full control over its industries.
I understand. Yes, it would be relatively easy to do. I wonder how TTDPatch would react with that new return value.George wrote: 1) the result should be stored. I suppose we can use var 93, but put all 256 values (not only 00, 04, 08, 10, 20, 40, 80).
2) wee need two more returns for callbacks 29 and 35
0D decrease production by 1 (var 93 = var 93 - 1)
0E increase production by 1 (var 93 = var 93 + 1).
TTDP could recognise them as 00 (I suppose it is hard to have more values for var 93 in TTDP)
You could provide a test grf and we would be able to see how both systems would work.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Re: Production of raw materials industries
Iron ore mine, ECS machinery vector beta 2.belugas wrote:I was watching over the code and it seems to be working along the specs. Can you point out which behaviours might not be adequate?George wrote:A question about production of raw materials industries. OTTD modifies production change for raw materials industries, so they change production not only by /2 (-50%) or *2 (+100%), but also by 12% for example. It is fine for default industry, but it is also applied to new industries in ECS.
News message. It reports that iron ore mine XXX production +10% (screenshot)belugas wrote:According to waht i've seen, it is actually the case. There is no randomization nor some chance percentage, everything is performed from the callback results. I wonder what makes you think otherwise.George wrote:Because I specify callbacks 29 and 35, this behaviour is unexpected, because callback 35 result is 00 80 and callback 29 returns only 02 80 and 01 80 (ECS Iron ore mine for example). That means we need to decide, how to support this situation. I think GRF has to have full control over its industries.
Ignore?belugas wrote:I understand. Yes, it would be relatively easy to do. I wonder how TTDPatch would react with that new return value.George wrote:1) the result should be stored. I suppose we can use var 93, but put all 256 values (not only 00, 04, 08, 10, 20, 40, 80).
2) wee need two more returns for callbacks 29 and 35
0D decrease production by 1 (var 93 = var 93 - 1)
0E increase production by 1 (var 93 = var 93 + 1).
TTDP could recognise them as 00 (I suppose it is hard to have more values for var 93 in TTDP)
test GRF with callback values 0D and 0E for test issue only!belugas wrote:You could provide a test grf and we would be able to see how both systems would work.
- Attachments
-
- testw.rar
- (30.32 KiB) Downloaded 48 times
-
- Screenshot
- iore-10.png (203.61 KiB) Viewed 484 times
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Production of raw materials industries
Both values are indeed called, with the result of closure, ultimately.
System is working fine
Take note that i have not spend a lot of time on the production problem you raised earlier.
I'll try to give it more time on my next free-time session.
System is working fine

Take note that i have not spend a lot of time on the production problem you raised earlier.
I'll try to give it more time on my next free-time session.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
-
- Engineer
- Posts: 17
- Joined: 22 Sep 2005 18:53
- Location: Havana, Cuba
- Contact:
Re: Production of raw materials industries
Hello every body:
I'm going to use this post in order to expose another problem related with this topic (Production and Industries).
In OTTD maps and town are very large and there are a lots off industries. Some times its not enought time to suply all of these type off industries and they close.
The problem is when all industries of one tipe close. In my opinion the program should verify whena an industry is going to close that isn't the last industry of that type. Before to close a Farm the program should verify there are any other farm.
Sorry about my english. I hope do yo understand me.
Best regards,
Your friend Robert
I'm going to use this post in order to expose another problem related with this topic (Production and Industries).
In OTTD maps and town are very large and there are a lots off industries. Some times its not enought time to suply all of these type off industries and they close.
The problem is when all industries of one tipe close. In my opinion the program should verify whena an industry is going to close that isn't the last industry of that type. Before to close a Farm the program should verify there are any other farm.
Sorry about my english. I hope do yo understand me.
Best regards,
Your friend Robert
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Production of raw materials industries
George: I checked the code in detail regarding your 10% news message and it seems that the message in question can only be generated if the cd29 or cb35 failed and running with smooth industry (which is indeed enabled in your savegame you provided me).
So it might be interesting to see what are the conditions examined by the call back, and making it fail.
robertbeunes: There are some grf that are perfoming this check. It is not mandatory for all industries to do so. And some industries may close down (all of tis kind) in order for some other industries to take its place. What were the grfs you used?
So it might be interesting to see what are the conditions examined by the call back, and making it fail.
robertbeunes: There are some grf that are perfoming this check. It is not mandatory for all industries to do so. And some industries may close down (all of tis kind) in order for some other industries to take its place. What were the grfs you used?
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
-
- Engineer
- Posts: 17
- Joined: 22 Sep 2005 18:53
- Location: Havana, Cuba
- Contact:
Re: Production of raw materials industries
Wow!!!!
A rapid answer!!!!!
I use ECS in all there extension.This is all vectors for template.
LV4, Dbset, DbsetECS... what else???
A rapid answer!!!!!
I use ECS in all there extension.This is all vectors for template.
LV4, Dbset, DbsetECS... what else???
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Re: Production of raw materials industries
callback 35 can't fail because it is not defined in industry prop 21. Looks like this prop is ignored|redefined and callback 35 is used.belugas wrote:George: I checked the code in detail regarding your 10% news message and it seems that the message in question can only be generated if the cd29 or cb35 failed and running with smooth industry (which is indeed enabled in your savegame you provided me).
So it might be interesting to see what are the conditions examined by the call back, and making it fail.
Re: Production of raw materials industries
Indeed callback 35 doesn't fail (it is not called). But as CB35 flag is not set, smooth economy stuff is done each month as usual. If you want to totally disable it, you just need to enable CB35 and return 00.
Re: Production of raw materials industries
Unless I'm missing something here, the point is to have *control* over the smooth economy. Not to leave it up to the RNG to determine what happens.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Re: Production of raw materials industries
I think it should be documented in the wiki, section Action 0 for industries that in OTTD "smooth economy" switch activates it's own behaviour for callback 35 and ENABLES it by default. So the coder should control the callback 35 himself. (This behaviour is unexpected, at least it was for me).glx wrote:Indeed callback 35 doesn't fail (it is not called). But as CB35 flag is not set, smooth economy stuff is done each month as usual. If you want to totally disable it, you just need to enable CB35 and return 00.
Or
This behaviour should be applied to default industries only. New industries should enable callback 35 and make it fail to achieve the same behaviour.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Production of raw materials industries
glx just commited a fix for that. The idea is that smooth economy should not be used if ever the grf declares any kind of production callback, even if given callback fails. This is in accordance to what TTDP does, further more since smooth economy is not present in TTDP.
Hoping you will find this satisfactory
Hoping you will find this satisfactory

If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
Re: Production of raw materials industries
That is finebelugas wrote:glx just commited a fix for that. The idea is that smooth economy should not be used if ever the grf declares any kind of production callback, even if given callback fails. This is in accordance to what TTDP does, further more since smooth economy is not present in TTDP.
Hoping you will find this satisfactory
Who is online
Users browsing this forum: No registered users and 27 guests