BSPI.grf - Stockpiling Industries
Moderator: Graphics Moderators
BSPI.grf - Stockpiling Industries
Hello.
I want to announce a NewGRF Ive been working on: BSPI.grf (v3.21)
Its basically vanilla industries in stockpiling mode.
Download:
http://ds-1.ovh.uu3.net/ftp/home/borg/openttd/BSPI.grf
This GRF should be played with smooth economy disabled.
Especially, if you are using option where primaries have reserves.
It have few additional features that can be configured via Param1:
bit0 - extractive industries have reserves
bit1 - secondary industries need electric power (Town zones)
bit2 - primary industries need valuables to boost production (Town zones)
bit3 - organic industries have fertility
bit4 - secondary industries production ratio%: 80,70,60
Param2 is used for supply check for secondary industries.
Value is in Months and can be set in range of 1-240. 0 means industry will never close.
Param3 is for electricity supply check, so keep P3 < P2.
If bit0 is on, extractive industries have limited reservces. Once depleted,
industry will announce closure. Reserves are determinted on industry construction.
Its random, range: 24k - 286k units (tons, m³, etc).
If bit1 is on, secondary industries need electric power. So first, you need
to provide coal to Power Stations within town zone. Once Power Station
will produce some energy (Net power >0%) industries will be able to produce
goods.
If bit2 is on, primary industries max output is limited to 25%. It can go temporary
up by random production event, but will slowly return to 25%.
To boost production, u need to have Bank in Town and start transporting
valuables to that bank from other Bank. Every month, all primary industries
that production is above 25% will consume some valuables from Town.
If there is no valuables, production will start to decay to reach 25%.
if bit3 is on, organic industries have limited fertility. Its similar to reserves, but
they are drained on production (plants grow all the time, after all).
Additionaly, to boost production of any industry (except Bank) you need to have
good station rating:
80%+ : production can increase
85%+ : random event will always double production
Also, if your rating is bad, production will decrease slowly too:
<50% : production decreases
Bank production is affected by Town population.
All secondary industries now produce every production tick (2.5 game days).
So, you can overload industry with cargo (it will stop paying for transport).
Also, you need to have some stockpiled cargo so production can increase.
Its roughy 250 units per 4%.
Cargo consumption is standard, 10 units per tick.
Max storage capacity: 10000 units (15000 for Power Plant)
Extra GRF is X2025.grf (old name) with just adds 'X2025' (Electric).
It can additionally merge maglev into monorail via bit0 of Param1.
Param2 allow high construction costs multipler, range 1 (x2) to 6 (x64).
Download (v1.30):
http://ds-1.ovh.uu3.net/ftp/home/borg/openttd/X2025.grf
Here is also GameScript I use to play OpenTTD games.
It provides few extra features to fits nicely into BSPI.grf:
- Preseed Industries
- Regenerate Industries for limited time (10-30 years)
- Auto Loan system with higher interest rate (2-10%)
- Tax system (interest rate * 1.5)
I sugest to play new games with Industries: Found only.
http://ds-1.ovh.uu3.net/ftp/home/borg/o ... orgExt.zip
Create directory called BorgExt under game directory in OpenTTD and
extract that zip there. Be sure to include it in Game Scripts in OpenTTD settings.
Regards,
Borg
I want to announce a NewGRF Ive been working on: BSPI.grf (v3.21)
Its basically vanilla industries in stockpiling mode.
Download:
http://ds-1.ovh.uu3.net/ftp/home/borg/openttd/BSPI.grf
This GRF should be played with smooth economy disabled.
Especially, if you are using option where primaries have reserves.
It have few additional features that can be configured via Param1:
bit0 - extractive industries have reserves
bit1 - secondary industries need electric power (Town zones)
bit2 - primary industries need valuables to boost production (Town zones)
bit3 - organic industries have fertility
bit4 - secondary industries production ratio%: 80,70,60
Param2 is used for supply check for secondary industries.
Value is in Months and can be set in range of 1-240. 0 means industry will never close.
Param3 is for electricity supply check, so keep P3 < P2.
If bit0 is on, extractive industries have limited reservces. Once depleted,
industry will announce closure. Reserves are determinted on industry construction.
Its random, range: 24k - 286k units (tons, m³, etc).
If bit1 is on, secondary industries need electric power. So first, you need
to provide coal to Power Stations within town zone. Once Power Station
will produce some energy (Net power >0%) industries will be able to produce
goods.
If bit2 is on, primary industries max output is limited to 25%. It can go temporary
up by random production event, but will slowly return to 25%.
To boost production, u need to have Bank in Town and start transporting
valuables to that bank from other Bank. Every month, all primary industries
that production is above 25% will consume some valuables from Town.
If there is no valuables, production will start to decay to reach 25%.
if bit3 is on, organic industries have limited fertility. Its similar to reserves, but
they are drained on production (plants grow all the time, after all).
Additionaly, to boost production of any industry (except Bank) you need to have
good station rating:
80%+ : production can increase
85%+ : random event will always double production
Also, if your rating is bad, production will decrease slowly too:
<50% : production decreases
Bank production is affected by Town population.
All secondary industries now produce every production tick (2.5 game days).
So, you can overload industry with cargo (it will stop paying for transport).
Also, you need to have some stockpiled cargo so production can increase.
Its roughy 250 units per 4%.
Cargo consumption is standard, 10 units per tick.
Max storage capacity: 10000 units (15000 for Power Plant)
Extra GRF is X2025.grf (old name) with just adds 'X2025' (Electric).
It can additionally merge maglev into monorail via bit0 of Param1.
Param2 allow high construction costs multipler, range 1 (x2) to 6 (x64).
Download (v1.30):
http://ds-1.ovh.uu3.net/ftp/home/borg/openttd/X2025.grf
Here is also GameScript I use to play OpenTTD games.
It provides few extra features to fits nicely into BSPI.grf:
- Preseed Industries
- Regenerate Industries for limited time (10-30 years)
- Auto Loan system with higher interest rate (2-10%)
- Tax system (interest rate * 1.5)
I sugest to play new games with Industries: Found only.
http://ds-1.ovh.uu3.net/ftp/home/borg/o ... orgExt.zip
Create directory called BorgExt under game directory in OpenTTD and
extract that zip there. Be sure to include it in Game Scripts in OpenTTD settings.
Regards,
Borg
Last edited by Borg on 12 Mar 2025 09:28, edited 27 times in total.
-
- Engineer
- Posts: 65
- Joined: 19 Nov 2018 19:26
- Location: West Bengal,India
Re: X2025.grf - Stockpiling Industries
How do the industries know about power station production level?Borg wrote:If bit1 is on, secondary industries need electric power. So first, you need
to provide coal to Power Stations within town zone. Once Power Station
will produce some energy (Net power >0%) industries will be able to produce
goods.
Should be interesting to play. Similar idea I have with my SPI rework, with the difference that I plan to use town consumer industries to convert goods/food/petrol etc to valuables and send them back to primary industries.If bit3 is on, primary industries max output is limited to 25%. It can go temporary
up by random production event, but will slowly return to 25%.
To boost production, u need to have Bank in Town and start transporting
valuables to that bank from other Bank. Every month, all primary industries
that production is above 25% will consume some valuables from Town.
If there is no valuables, production will start to decay to reach 25%.
Doesn't look good to me, station rating can fluctuate too much with new vehicles becoming old, with difference between fast/slow vehicles etc, from my experience with ECS it makes production crazily unpredictable and production jumps annoying.Additionaly, to boost production of any industry (except Bank) you need to have
good station rating:
75%+ : production can increase
85%+ : random event will always double production
Also, if your rating is bad, production will decrease slowly too:
<50% : production decreases
A good reason to use town growth limiting game script.Bank production is affected by Town population.
Does it simply stop accepting cargo?So, you can overload industry with cargo (it will stop paying for transport).
Looks similar to SPI, should be interesting.Also, you need to have some stockpiled cargo so production can increase.
Its roughy 250 units per 4%.
Re: X2025.grf - Stockpiling Industries
The power station can set a flag in a persistent register of the town, which the other industries can read... hmm.sevenfm wrote:How do the industries know about power station production level?
That's pretty damn clever. I might have to find a way to use that.

Re: X2025.grf - Stockpiling Industries
As PikkaBird wrote, this is done by Persistent storage in Towns.sevenfm wrote: How do the industries know about power station production level?
You can access related object in GRF.. In case of Industry it is Town.
I can provide more technical details if you want.
Thats why my GRF provides custom station rating calculations. Im quite happy with the results.sevenfm wrote:Doesn't look good to me, station rating can fluctuate too much with new vehicles becoming old, with difference between fast/slow vehicles etc, from my experience with ECS it makes production crazily unpredictable and production jumps annoying.Additionaly, to boost production of any industry (except Bank) you need to have
good station rating:
75%+ : production can increase
85%+ : random event will always double production
Also, if your rating is bad, production will decrease slowly too:
<50% : production decreases
Yep, I use custom GS to handle few extra things :)sevenfm wrote:A good reason to use town growth limiting game script.Bank production is affected by Town population.
But its not that big problem, because Bank production is capped.
Max population is 10240 (currently hardcoded). Anything larger will
just dont affect Bank production.
Well, cargo will be accepted (tile acceptance is not changed). I use Industry Opt Acceptancesevenfm wrote:Does it simply stop accepting cargo?So, you can overload industry with cargo (it will stop paying for transport).
callback, so industry will simply not pay for excees cargo (no profit).
Re: X2025.grf - Stockpiling Industries
Its even more complicated :) There are counters, because Power station outputPikkaBird wrote:The power station can set a flag in a persistent register of the town, which the other industries can read... hmm.sevenfm wrote:How do the industries know about power station production level?
That's pretty damn clever. I might have to find a way to use that. :D
levels vary (based on layout). Additionally, when you provide more coal to power station
it increases Burn Rate and so, provide more power. Same with industry, when it idles
at 4% production rate.. it consumes 1 unit of power per tick, but when it goes 100%
it eats 24 units of power. So you need to scale your coal transport with production.
Re: X2025.grf - Stockpiling Industries
I would appreciate a more detailed explanation. Does it work with NML? Looking at NML documentation, I don't see anything related.Borg wrote:As PikkaBird wrote, this is done by Persistent storage in Towns.
You can access related object in GRF.. In case of Industry it is Town.
I can provide more technical details if you want.
Re: X2025.grf - Stockpiling Industries
You're looking for STORE_PERM and LOAD_PERM in https://newgrf-specs.tt-wiki.net/wiki/N ... _functions . Also read the last paragraph of https://newgrf-specs.tt-wiki.net/wiki/NML:Switch .sevenfm wrote:Does it work with NML? Looking at NML documentation, I don't see anything related.
Re: X2025.grf - Stockpiling Industries
Well, I dont use NML, so no clue here but it should.sevenfm wrote: I would appreciate a more detailed explanation. Does it work with NML? Looking at NML documentation, I don't see anything related.
Here is NFO info: https://newgrf-specs.tt-wiki.net/wiki/Storages
Look at Persistent storage accessed by GRFID.
Thats what I use.
Re: X2025.grf - Stockpiling Industries
Thank you!PikkaBird wrote:You're looking for STORE_PERM and LOAD_PERM in https://newgrf-specs.tt-wiki.net/wiki/N ... _functions . Also read the last paragraph of https://newgrf-specs.tt-wiki.net/wiki/NML:Switch .
Unfortunately, it seems STORE_PERM and LOAD_PERM don't work for towns, when using:
it gives errorswitch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}
With SELF switch it compiles ok.←[Knmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: 2019-01-09-g7b7fcaf5
Error: (AssertionError) "Invalid feature number".
Command: ['c:\\dev\\nml\\nmlc', '-c', '--grf', 'spi1.32a.grf',
Location: File "nml\ast\general.py", line 54, in feature_name
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: X2025.grf - Stockpiling Industries
Reads like a bug or omission. Can you please provide code which actually tests this?sevenfm wrote:Thank you!PikkaBird wrote:You're looking for STORE_PERM and LOAD_PERM in https://newgrf-specs.tt-wiki.net/wiki/N ... _functions . Also read the last paragraph of https://newgrf-specs.tt-wiki.net/wiki/NML:Switch .
Unfortunately, it seems STORE_PERM and LOAD_PERM don't work for towns, when using:it gives errorswitch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}With SELF switch it compiles ok.←[Knmlc ERROR: nmlc: An internal error has occurred:
nmlc-version: 2019-01-09-g7b7fcaf5
Error: (AssertionError) "Invalid feature number".
Command: ['c:\\dev\\nml\\nmlc', '-c', '--grf', 'spi1.32a.grf',
Location: File "nml\ast\general.py", line 54, in feature_name
Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: X2025.grf - Stockpiling Industries
I tested it with highly modified SPI 1.32 code, unfortunately I don't have a separate test grf for this bug/feature.planetmaker wrote:Reads like a bug or omission. Can you please provide code which actually tests this?
I can test it if someone uploads a compiled win32 NML with needed changes.planetmaker wrote:Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
Latest NML pack in usual place http://bundles.openttdcoop.org/nml/push/LATEST/ is from 2019-Jan-09.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: X2025.grf - Stockpiling Industries
It's all python. So all you need is a python 3.5+ (e.g. 3.6 or 3.7) install and a download of nml (e.g. the pull request I linked) and you can run nmlc just finesevenfm wrote:I tested it with highly modified SPI 1.32 code, unfortunately I don't have a separate test grf for this bug/feature.planetmaker wrote:Reads like a bug or omission. Can you please provide code which actually tests this?
I can test it if someone uploads a compiled win32 NML with needed changes.planetmaker wrote:Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
Latest NML pack in usual place http://bundles.openttdcoop.org/nml/push/LATEST/ is from 2019-Jan-09.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: X2025.grf - Stockpiling Industries
I only have Python 2.7 which was recommended by some NML install guide, and I don't have those files (nml/actions/action2var.py and nml/ast/general.py) you changed in that commit.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: X2025.grf - Stockpiling Industries
I suggest the install guide which comes with the nml you actually use... e.g. https://github.com/OpenTTD/nml/blob/master/README.md
We need your help to maintain nml.
We need your help to maintain nml.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: BSPI.grf - Stockpiling Industries
Okey, some people told me that having GRF that changes
both Industries and Vehicles is bad idea, so I decided to
split this GRF into 2 new GRFs.
First one is BSPI.grf - Stockpiling Industries.
I already updated first post.
Second is X2025.grf (old name) with just adds 'X2025' (Electric).
It can additionally merge maglev into monorail via bit0 of Param1.
Download: ftp://ds-1.ovh.uu3.net/home/borg/openttd/X2025.grf
both Industries and Vehicles is bad idea, so I decided to
split this GRF into 2 new GRFs.
First one is BSPI.grf - Stockpiling Industries.
I already updated first post.
Second is X2025.grf (old name) with just adds 'X2025' (Electric).
It can additionally merge maglev into monorail via bit0 of Param1.
Download: ftp://ds-1.ovh.uu3.net/home/borg/openttd/X2025.grf
Re: BSPI.grf - Stockpiling Industries
Nice GRF, could you upload a copy of the source NML?
Re: BSPI.grf - Stockpiling Industries
Its not written in NML.. I use NFO (nearly) directly.
So, not sure if you still want to see the code...
So, not sure if you still want to see the code...
Re: BSPI.grf - Stockpiling Industries
That's disappointing, I can't read nfo code. However, if the .nfo has lots of documentation it might be worth a look.
I did try it though and I'm quite impressed by it...so much so that I added something similar to my industry set (SPI) that provides a much smoother variation in production. I liked the different approach to production - I hadn't thought of doing it that way.
It seems that production increases in bands, whenever stocks reach a particular level. Could you let me know what the bands are? It's hard to work them out exactly...
I did try it though and I'm quite impressed by it...so much so that I added something similar to my industry set (SPI) that provides a much smoother variation in production. I liked the different approach to production - I hadn't thought of doing it that way.
It seems that production increases in bands, whenever stocks reach a particular level. Could you let me know what the bands are? It's hard to work them out exactly...
-
- Engineer
- Posts: 5
- Joined: 29 Jul 2018 17:39
Re: BSPI.grf - Stockpiling Industries
Hi 3iff, I hope you'll update the SPI release if you manage to get this to work!3iff wrote: 24 Sep 2019 09:10 I did try it though and I'm quite impressed by it...so much so that I added something similar to my industry set (SPI) that provides a much smoother variation in production. I liked the different approach to production - I hadn't thought of doing it that way.
Who is online
Users browsing this forum: Semrush [Bot], Welshmilla and 2 guests