Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri May 24, 2019 12:11 am

All times are UTC




Post new topic  Reply to topic  [ 16 posts ] 
Author Message
PostPosted: Tue Jan 22, 2019 4:04 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat May 21, 2005 6:45 am
Posts: 9
Hello.

I want to announce a NewGRF Ive been working on: BSPI.grf
Its basically vanilla industries in stockpiling mode.
Download:
ftp://ds-1.ovh.uu3.net/home/borg/openttd/BSPI.grf
ftp://ds-1.ovh.uu3.net/home/borg/openttd/X2025.grf

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)

If bit0 is on, extractive industries have limited reservces. Once depleted,
industry will announce closure.

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%.

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 except coal, 5 units.
Max storage capacity: 15000 units except coal, 10000 units.

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 Thu May 23, 2019 6:05 pm, edited 2 times in total.

Top
   
PostPosted: Sat Jan 26, 2019 5:24 pm 
Offline
Engineer
Engineer

Joined: Mon Nov 19, 2018 7:26 pm
Posts: 14
Location: Somewhere in India
Very good!

_________________
Nothing to put here!


Top
   
PostPosted: Sat Jan 26, 2019 5:44 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jul 25, 2016 11:44 pm
Posts: 67
Location: Soviet Russia
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?

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

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

Quote:
Bank production is affected by Town population.

A good reason to use town growth limiting game script.

Quote:
So, you can overload industry with cargo (it will stop paying for transport).

Does it simply stop accepting cargo?

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


Top
   
PostPosted: Sat Jan 26, 2019 6:18 pm 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5379
Location: The Moon
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

_________________
Pikkarail.com blog | Patreon
Current development: UKRS3 - Av9.8 - TaI32 - CivilAI
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAI API - NoGo API


Top
   
PostPosted: Sat Jan 26, 2019 8:20 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat May 21, 2005 6:45 am
Posts: 9
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:
Quote:
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:
Quote:
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:
Quote:
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).


Top
   
PostPosted: Sat Jan 26, 2019 8:34 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat May 21, 2005 6:45 am
Posts: 9
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.


Top
   
PostPosted: Sat Jan 26, 2019 10:21 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jul 25, 2016 11:44 pm
Posts: 67
Location: Soviet Russia
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.


Top
   
PostPosted: Sun Jan 27, 2019 3:07 am 
Offline
Graphics Moderator
Graphics Moderator
User avatar

Joined: Mon Sep 13, 2004 1:21 pm
Posts: 5379
Location: The Moon
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 .

_________________
Pikkarail.com blog | Patreon
Current development: UKRS3 - Av9.8 - TaI32 - CivilAI
Dev reference: NML Specs - NewGRF Specs - Savegame Internals - NoAI API - NoGo API


Top
   
PostPosted: Sun Jan 27, 2019 8:57 am 
Offline
Engineer
Engineer
User avatar

Joined: Sat May 21, 2005 6:45 am
Posts: 9
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.


Top
   
PostPosted: Sun Jan 27, 2019 10:38 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jul 25, 2016 11:44 pm
Posts: 67
Location: Soviet Russia
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:
Quote:
switch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}

it gives error
Quote:
←[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.


Top
   
PostPosted: Tue Apr 02, 2019 10:42 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
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:
Quote:
switch (FEAT_INDUSTRIES, PARENT, town_hall_extra_text, STORE_PERM(77, 0))
{
return string(STR_EXTRA_TOWN_HALL);
}

it gives error
Quote:
←[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

_________________
Image
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


Top
   
PostPosted: Tue Apr 02, 2019 10:58 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jul 25, 2016 11:44 pm
Posts: 67
Location: Soviet Russia
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.


Top
   
PostPosted: Tue Apr 02, 2019 11:21 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
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

_________________
Image
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


Top
   
PostPosted: Tue Apr 02, 2019 11:30 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jul 25, 2016 11:44 pm
Posts: 67
Location: Soviet Russia
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.


Top
   
PostPosted: Tue Apr 02, 2019 11:32 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9266
Location: Sol d
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.

_________________
Image
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


Top
   
PostPosted: Tue Apr 02, 2019 3:21 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat May 21, 2005 6:45 am
Posts: 9
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 16 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.