Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Dec 12, 2018 1:21 pm

All times are UTC




Post new topic  Reply to topic  [ 29 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Mon Nov 04, 2013 10:01 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
Description
This game script requires FIRS industry replacement set.

The goal of this game script is to make cities growth dependent upon amount of cargos delivered to them.
This cargos are:
- passangers
- mail
- goods
And cargos introduced by FIRS:
- food
- fruits
- petrol
- building materials

It's easy to deliver passangers, mail and goods to the city, but problems start when you have to deliver
food, fruits and petrol, because default city buildings dont accept this cargos. In order to be able to deliver
them you have to find industry which accepts them or fund such an industry near the town you want to grow.

After its done and cargos has been delivered to city, the next month's first day they are summed up and the
impact on the population of the previous month is calculated. The city target population is calculated by taking the average of consecutive
last three months impacts on the city population. This informations are displayed in city window:

Image

The impact is calculated based on the amount of cargo transported and the settings of a game script.
The settings allow player to adjust percentage of how much an unit of a cargo will contribute to the total population impact each month.
If the value is set to 100 then one unit of a cargo delivered will result in one person in population. This settings are available in game script / ai configuration window:

Image

At the beginning of the next month, after the target population is calculated, the city is expanded if the target population is higher than current population.
The amount of expansion is counted in houses. The difference between the target population and current population is calculated, and basing on this difference
the amount of houses to expand is calculated. For every 1000 of this difference 10 houses are expanded, what means, again that if the difference between calculated target population and current population is 1000 - the city will expand 10 houses at the beginning of the month.


Other features:
Due to the fact that this script was intended to be kind of patch for OpenTTD things I dont like and to enhance some things there are other "side effect features" which you may or may not like.
1. A "manager" that works on beside of player company:
- Rebuilds crashed vehicles in the nearest depot.
- Refunds advertising camaigns every month. In order to use this feature, player has to put a sign in the city with text:
---"Advertising - small" for small advertising
---"Advertising - medium" for medium advertising
---"Advertising - large" for large advertising campaign

2. Signs over industries with their names. I made it accidentally for debugging purposes but I've found it really usefull during game play, especially with FIRS, where there are around 50 types of industries. So it's left there :)
It is possible to disable them before new game start in the settings of a game script.

Installation
If you are interested in using this gamescript, you must download it and unpack to the "game" folder of the OpenTTD "my documents" directory.
Download link for newest version: https://dl.dropboxusercontent.com/u/40322040/RealGrowth4.zip

Changelog

Version 6
Fixed a bug when deleting industry.

Version 5
Added french(by fabca2) and polish translation for town GUI.
Fixed a bug.
Moved to bananas.
Download link : https://dl.dropboxusercontent.com/u/40322040/RealGrowth5.zip


Version 4
Dropped dependency upon SuperLib library so user can just download, extract and play.

Download link (version4): https://dl.dropboxusercontent.com/u/40322040/RealGrowth4.zip

Version 3
Changes:
The target population is now calculated basing on three month of consecutive impact, the last month impact is shown among two previous months impact is now displayed in city GUI.

This solves issue with irregular deliveries, where one month the target pop would be 25000 and next only 2000, and smooths the city growth.

Download link (version3): https://dl.dropboxusercontent.com/u/40322040/RealGrowth3.zip

Version 2
Changes:
-Now the number of houses city grows every month is calculated basing on the difference between the target population and current population. The higher this difference is the more houses are grown. Per each thousand of this difference 10 houses are added which means if for example target population is 2500 and current population is 1000, the difference is 1500 - 15 houses are built.
-The town target population is colored in red if it's below current city population, and green if above.
- Settings are changed, see below

New:
- Settings: the settings for the game script are now giving player ability to select how much impact a certain cargo has on the final target population of the city. Settings are in form "XXX impact (%, def: YYY)" , where XXX is the name of the cargo and YYY is the default impact value.
The impact is set as a perentage of how much per unit of transported cargo, the target population is impacted, so for example if the value of a setting for a cargo XXX is 435, and the transpoted amount is 100 - the effect on the population is 435 people.
- Enable/disable creating signs over industries indicating their name at game start.

Download link (version2): https://dl.dropboxusercontent.com/u/40322040/RealGrowth2.zip


Version 1
The town target population is evaluated every month based on the amount of goods transported to the city. These goods are enumerated beneath with numbers indicating how much have been transported to the city/town last month (green number) and how much the impact the calculated target city population (yellow number). These cargos are:
- Passangers
- Mail
- Goods
- Food
- Fruits
- Building materials
- Petrol

After the target population is calculated, at the beginning of new month - if it is larger than the current city population, the city grows 5 houses, else nothing happens.

The goal is to keep the incoming cargos at high level. There are no such constraints as in other similar gamescripts where in order to grow city, player has to fullfill requirements for all cargos. Here, one cargo may cause city to grow if enough amount is delivered to it.

Download link (version1): https://dl.dropboxusercontent.com/u/40322040/RealGrowth.zip
Dependent on SuperLib v 26 library.

Have fun!


Last edited by lukasz1985 on Wed Jan 08, 2014 4:15 pm, edited 12 times in total.

Top
   
PostPosted: Mon Nov 04, 2013 10:26 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
lukasz1985 wrote:
If you are interested in using this gamescript, you must download it and unpack to the "game" folder of the OpenTTD "my documents" directory.
It also requirese SuperLib v 26 due to the fact that it is made on the GameScript template authored by Zuu.


From SuperLib.Helper, you only use "Helper.Max" which is an old helper that can be substituted with the internal "max" that has been available for ages. The next version of MinimalGS will use "max" instead of Helper.Max as it is a silly example.

The other class that you actually use is SuperLib.Log. However it looks like most of your logging is made using GSLog.Info instead of (SuperLib.)Log.Info, thus you could replace the few usages of Log with GSLog and drop the second log level parameter there.

After doing these changes you can drop importing of SuperLib altogether if you don't plan to use any of the many helpers available in SuperLib.


My MinimalGS do not require you to use SuperLib. If you don't need it, you can drop it and get free of that dependency. The library is a collection of helpers that I've written over the years and since I've maintained two AIs over some time I decided to put the common parts in a library instead of fixing the same bug in two scripts. The bonus is that others can use it too if they like, but I also understand that many will want to write there own code and that is fine too.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Mon Nov 04, 2013 10:29 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 14, 2004 3:18 pm
Posts: 312
Location: Fr
Hello,
Your script is really something I was looking for,
Thank you very much.

Do you plan to add settings for other cargo : food, fruit, BuildMat and petrol (and remove unsused coal one) ?

I have few remark if it's possible, to add a boolean setting to enable or disable :
- sign over industry -> it's true it can be usefull, but someone may not like it.
- take "fund new building" into account -> (funded) building does not have any impact anymore with your script, it can be interresting to enable default behavior.


What's your feeling about completeness of your dev ? Do you plan to add news feature/settings/changes ?
I made a translation file (that was easy, these is only one line) but I don't know if I must wait for a new version ?

I'm very interrested by your GS, and I have few idea to share with you, lets start with that one :
Figures in "target population" is always in red, can you change color like this : in green when it's lower that current city population (green=growing), and in red otherwise (red=not growing)

Thank you.
Best Regards


Top
   
PostPosted: Tue Nov 05, 2013 10:39 am 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
@Zuu

Thank you for that info. I will certainly look into this. Nevertheless thanks for the template you made :)

@fabca2

Nice to hear you liked this script.

Actually you pointed some things I've forgot about:
Currently the settings only work for passangers and mail, the coal is in the settings because I forgot to remove them from there.
And for settings for other kinds of materials - I will probably do this.

Other things are also possible.
Only the question I've got - I dont know what you mean by saying " (funded) building does not have any impact anymore with your script"


Yes, this GameScript can be viewed as work in progress, so I'm open to the suggestions.

Will try today to make some progress.

BTW: Does the translation work? When I was using polish version, the translation didn't appear.


Top
   
PostPosted: Tue Nov 05, 2013 11:04 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 14, 2004 3:18 pm
Posts: 312
Location: Fr
lukasz1985 wrote:
BTW: Does the translation work? When I was using polish version, the translation didn't appear.

Yes it does work perfectly,
you just need to give file name with .txt instead of .lang as you did.


lukasz1985 wrote:
Only the question I've got - I dont know what you mean by saying " (funded) building does not have any impact anymore with your script"

it's not important, it's in local authority, on the same list you have the Advertising campain, you can fund a new building, by doing that city temporary increase growing speed.
it's just the user still have the option in local authority but nothing happens, you don't need to spend too much time on this...


lukasz1985 wrote:
Yes, this GameScript can be viewed as work in progress, so I'm open to the suggestions.

I'm excited about that, can't wait for next version :D

Regards.


Last edited by fabca2 on Tue Nov 05, 2013 11:19 am, edited 1 time in total.

Top
   
PostPosted: Tue Nov 05, 2013 11:13 am 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
Oh .. I missed the file extension.

I still cant get what you mean with funding buildings :) but I guess that you suggest that placing sign over the city with "Fund buildings" text in it will make new buildings funded every month?
Or do you mean that funding new buildings in "local authority" window doesn't work?


Top
   
PostPosted: Tue Nov 05, 2013 11:19 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 14, 2004 3:18 pm
Posts: 312
Location: Fr
lukasz1985 wrote:
Or do you mean that funding new buildings in "local authority" window doesn't work?

Yes, that's it... but it's not important.


Top
   
PostPosted: Tue Nov 05, 2013 12:02 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
Well this topic need some clarification:

Actually funding new buildings works with the script but not the same way as in original game. In original game this works by building new building in the city after the option is activated and shortening times between town growths for some time.

Here, in this gamescript - the only thing that is done is that new building is funded after the "fund new building" is initiated.
If you or anybody want to test it do the following:
1. Start new game with a tiny map: 64x64
2. ALT + CTRL + C for cheat menu
3. Add yourself some money.
4. Fast forward the game
5. Fund buildings every 5-6 days
Note that the town must be able to build roads or houses - it has to have spare space around it.

I was looking at this, but this is hard thing to do to shorten the times between growths in cooperation with the script itself. But I will look at this in depth.


Top
   
PostPosted: Tue Nov 05, 2013 3:12 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
So the updated version (Version2) is here :) see the original post for more info


Top
   
PostPosted: Tue Nov 05, 2013 4:19 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
And version 3 with a quick fix.


Top
   
PostPosted: Tue Nov 05, 2013 7:55 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
If you keep SuperLib as a dependency, I recommend updating the import statement to the last version on bananas before you upload a new version and set SuperLib as dependency. In bananas you can only mark the last version of each library as dependency*. This is why I recommend you to change the import statement to import the last version (version 36). You can see what is the last version here: http://bananas.openttd.org/en/gslibrary/

Some people use different version in bananas and in the script because they want to use eg. 0.3.2 as version (which works in bananas but not in info.nut). I always keep the same version number in both places. So version 36 means it is the 36:th release of SuperLib as there is no minor version number.


* If you really want to set older versions of a library as dependency you must use musa as upload tool because for now the web upload interface does not support this.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Tue Nov 05, 2013 9:03 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
I dropped the dependency for now. So it's now smoother to install this script.

I was thinking about uploading to bananas but for now I have no real feedback if it is even worth doing so (maybe I should think the other way around).


Top
   
PostPosted: Tue Nov 05, 2013 11:14 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 14, 2004 3:18 pm
Posts: 312
Location: Fr
Hi,
I tested your recent version, that's very nice.

Just a question, did you notified that passengers and mail figures are not the same as the one in town screen ?
For example, in your printscreen (firs post), you compute 1046 passengers and few line before ottd compute 1601.
Do you know where does come from this difference ?
I made a test with delivering only one bus (35 passangers) to a city, your script was correct, ottd was wrong by displaying 112 !

Do you know if it's possible to hide (wrong) passangers and mail lines from town screen ? (not the lines from your screen, the ones from ottd) because it's wrong, and disturbing to have different numbers.


Here is the french language file (for when you got to bananas)

Thank you.


Attachments:
french.txt [733 Bytes]
Downloaded 103 times
Top
   
PostPosted: Wed Nov 06, 2013 5:51 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
fabca2 wrote:
Just a question, did you notified that passengers and mail figures are not the same as the one in town screen ?
For example, in your printscreen (firs post), you compute 1046 passengers and few line before ottd compute 1601.
Do you know where does come from this difference ?


That's normal. The town screen doesn't show pax/mails delivered to the city, but pax/mails delivered by the city to the stations. It becomes more clear if you check cities which have not any station.

_________________
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.


Top
   
PostPosted: Wed Nov 06, 2013 11:27 am 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
Yes that is correct, in the current screenshot the value 925 , max 2,324 are values that the city supplies. It means that the city last month supplied 925 passangers, and could maximally supply 2,324 passangers. This values show how much passangers were generated. The value 1816 is the value indicating how many passangers were accepted by the city, and upon this value the impact is calculated (5448). The amount accepted is the sum of the cargo that was delivered to the city.

This script works that only cargos transported(delivered/accepted) to city are counted.

Thanks for the translation, now the script is in bananas.


Top
   
PostPosted: Sat Nov 16, 2013 11:00 am 
Offline
Engineer
Engineer

Joined: Sat Nov 09, 2013 12:19 am
Posts: 41
Hi,
I noticed that you have a small glitch on Petrol line, you have a ":" just before the word "Petrol".
it's not important, just to make it nicer.
Regards.


Top
   
PostPosted: Sun Nov 17, 2013 12:50 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Perhaps add a Story Page which documents inside the game what the different numbers in the town window are for?

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Sun Nov 17, 2013 11:00 am 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
I can't solve the glitch, somehow the ":" just appears there.


Top
   
PostPosted: Mon Dec 30, 2013 2:52 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Jun 20, 2010 11:16 pm
Posts: 1255
This script keep crashing in my game, so here is the screenshot with the hope you can do something about it ;)
i remember having an instant crash after i demolished some FIRS farm, but usually the crash happens for no apparent reason.

I use a patchpack, so i m sorry in advance if that make that report useless...if u want/need the savegame, i ll post it.

now i like a lot your script, it makes city growth really more interesting and challenging, and it allow to keep some town relatively small.

but on the matter of keeping small town, i m wondering if my small town don t stay small cause the script crashed in my game, or only cause a kind of natural growth is still active behind the script ?

also i know NAI script allow to change some settings while the game run, would it be possible too with your script ?


Attachments:
St. Malo Transport, 24 Jan 1995#1.png [144.73 KiB]
Downloaded 4 times
Top
   
PostPosted: Tue Jan 07, 2014 8:11 pm 
Online
Route Supervisor
Route Supervisor

Joined: Wed Mar 27, 2013 8:58 am
Posts: 407
Sorry for the delay I should have mark this thread to folow.

Actually I've fixed that bug for myself a long time ago :P and it was waiting for upload. Yes, unfortunately this was happening when industries were deleted. You can grab the fixed version from bananas.

About the small towns - if a script crashes - it stops working and no longer is considered in the game - so if you played after that happened - your small cities didnt grow because of settings that the script initialized at the beginning of the month your game crashed (as far as I remember it sets the steps between growths to 999999 days for cities and towns that didn't achieved any growth).

Generaly speaking if a script crashed things are not really predictable.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 29 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 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:  
Powered by phpBB © 2000-2018 phpBB Limited

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