BSPI.grf - Stockpiling Industries

Find and discuss all the latest NewGRF releases for TTDPatch and OpenTTD here.

Moderator: Graphics Moderators

Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

BSPI.grf - Stockpiling Industries

Post by Borg »

Hello.

I want to announce a NewGRF Ive been working on: BSPI.grf (v2.12)
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

Param2 is used for more aggresive supply check for secondary industries.
Value is in Months and can be set in range of 1-60. 0 means default behaviour.

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:
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

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: 15000 units.

Extra GRF is X2025.grf (old name) with just adds 'X2025' (Electric).
It can additionally merge maglev into monorail via bit0 of Param1.
Download:
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 (5-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.tar

Thats it for now I think.
I run OpenTTD server w/ that GRF, so if someone want to take a look or play, go ahead.
Tag: Borg

Regards,
Borg
Last edited by Borg on 20 Aug 2022 16:45, edited 14 times in total.
SomeIndianGuy
Engineer
Engineer
Posts: 65
Joined: 19 Nov 2018 19:26
Location: West Bengal,India

Re: X2025.grf - Stockpiling Industries

Post by SomeIndianGuy »

Very good!
Nothing to put here!
User avatar
sevenfm
Engineer
Engineer
Posts: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: X2025.grf - Stockpiling Industries

Post by sevenfm »

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.
How do the industries know about power station production level?
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%.
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.
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
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.
Bank production is affected by Town population.
A good reason to use town growth limiting game script.
So, you can overload industry with cargo (it will stop paying for transport).
Does it simply stop accepting cargo?
Also, you need to have some stockpiled cargo so production can increase.
Its roughy 250 units per 4%.
Looks similar to SPI, should be interesting.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: X2025.grf - Stockpiling Industries

Post by PikkaBird »

sevenfm wrote:How do the industries know about power station production level?
The power station can set a flag in a persistent register of the town, which the other industries can read... hmm.

That's pretty damn clever. I might have to find a way to use that. :D
Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

Re: X2025.grf - Stockpiling Industries

Post by Borg »

sevenfm wrote: How do the industries know about power station production level?
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.
sevenfm wrote:
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
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.
Thats why my GRF provides custom station rating calculations. Im quite happy with the results.
sevenfm wrote:
Bank production is affected by Town population.
A good reason to use town growth limiting game script.
Yep, I use custom GS to handle few extra things :)
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.
sevenfm wrote:
So, you can overload industry with cargo (it will stop paying for transport).
Does it simply stop accepting cargo?
Well, cargo will be accepted (tile acceptance is not changed). I use Industry Opt Acceptance
callback, so industry will simply not pay for excees cargo (no profit).
Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

Re: X2025.grf - Stockpiling Industries

Post by Borg »

PikkaBird wrote:
sevenfm wrote:How do the industries know about power station production level?
The power station can set a flag in a persistent register of the town, which the other industries can read... hmm.

That's pretty damn clever. I might have to find a way to use that. :D
Its even more complicated :) There are counters, because Power station output
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.
User avatar
sevenfm
Engineer
Engineer
Posts: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: X2025.grf - Stockpiling Industries

Post by sevenfm »

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.
I would appreciate a more detailed explanation. Does it work with NML? Looking at NML documentation, I don't see anything related.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: X2025.grf - Stockpiling Industries

Post by PikkaBird »

sevenfm wrote:Does it work with NML? Looking at NML documentation, I don't see anything related.
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 .
Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

Re: X2025.grf - Stockpiling Industries

Post by Borg »

sevenfm wrote: I would appreciate a more detailed explanation. Does it work with NML? Looking at NML documentation, I don't see anything related.
Well, I dont use NML, so no clue here but it should.
Here is NFO info: https://newgrf-specs.tt-wiki.net/wiki/Storages
Look at Persistent storage accessed by GRFID.
Thats what I use.
User avatar
sevenfm
Engineer
Engineer
Posts: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: X2025.grf - Stockpiling Industries

Post by sevenfm »

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 .
Thank you!
Unfortunately, it seems STORE_PERM and LOAD_PERM don't work for towns, when using:
switch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}
it gives error
←[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
With SELF switch it compiles ok.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: X2025.grf - Stockpiling Industries

Post by planetmaker »

sevenfm wrote:
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 .
Thank you!
Unfortunately, it seems STORE_PERM and LOAD_PERM don't work for towns, when using:
switch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}
it gives error
←[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
With SELF switch it compiles ok.
Reads like a bug or omission. Can you please provide code which actually tests this?

Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
User avatar
sevenfm
Engineer
Engineer
Posts: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: X2025.grf - Stockpiling Industries

Post by sevenfm »

planetmaker wrote:Reads like a bug or omission. Can you please provide code which actually tests this?
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:Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
I can test it if someone uploads a compiled win32 NML with needed changes.
Latest NML pack in usual place http://bundles.openttdcoop.org/nml/push/LATEST/ is from 2019-Jan-09.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: X2025.grf - Stockpiling Industries

Post by planetmaker »

sevenfm wrote:
planetmaker wrote:Reads like a bug or omission. Can you please provide code which actually tests this?
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:Does this help and does the resulting NewGRF work as intended? https://github.com/OpenTTD/nml/pull/26
I can test it if someone uploads a compiled win32 NML with needed changes.
Latest NML pack in usual place http://bundles.openttdcoop.org/nml/push/LATEST/ is from 2019-Jan-09.
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 fine
User avatar
sevenfm
Engineer
Engineer
Posts: 117
Joined: 25 Jul 2016 23:44
Location: Soviet Russia

Re: X2025.grf - Stockpiling Industries

Post by sevenfm »

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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: X2025.grf - Stockpiling Industries

Post by planetmaker »

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.
Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

Re: BSPI.grf - Stockpiling Industries

Post by Borg »

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
User avatar
Hazzard
Engineer
Engineer
Posts: 52
Joined: 14 Apr 2012 13:24
Contact:

Re: BSPI.grf - Stockpiling Industries

Post by Hazzard »

Nice GRF, could you upload a copy of the source NML?
Borg
Engineer
Engineer
Posts: 33
Joined: 21 May 2005 06:45

Re: BSPI.grf - Stockpiling Industries

Post by Borg »

Its not written in NML.. I use NFO (nearly) directly.
So, not sure if you still want to see the code...
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: BSPI.grf - Stockpiling Industries

Post by 3iff »

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...
randomallfront
Engineer
Engineer
Posts: 5
Joined: 29 Jul 2018 17:39

Re: BSPI.grf - Stockpiling Industries

Post by randomallfront »

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.
Hi 3iff, I hope you'll update the SPI release if you manage to get this to work!
Post Reply

Return to “Graphics Releases”

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests