Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu May 25, 2017 2:29 pm

All times are UTC




Post new topic  Reply to topic  [ 179 posts ]  Go to page 1 2 3 4 59 Next
Author Message
PostPosted: Sun Jan 12, 2014 10:19 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Renewed City Growth - a GameScript for OpenTTD


RCG is a GameScript that manages towns growth in a new and balanced way, making growth depend on varied cargo delivery (passengers, food, goods, ...). The script supports Baseset, FIRS and ECS industries. It is born as a fork of kormer's GS.


Attachment:
SwissTrans, 1937-06-27#4.png
SwissTrans, 1937-06-27#4.png [ 478.61 KiB | Viewed 13685 times ]



How this works:

The script only triggers growth in the towns which are already exchanging passengers. This is the condition for town growth. If a town supplies passengers in any way, the script starts calculating cargo requirements for this town. Its growth rate is calculated (non linearly) on the basis of the degree of achievement for cargo requirements. If there is more cargo than necessary, it is stockpiled for later use.

Cargo requirements are not defined for individual cargo types, but for cargo categories. Depending on the used industry set, there are 3 or 5 categories;
For Baseset industries, we use 3 categories:
  • Cat 1: Passengers and Mail
  • Cat 2: General goods (includes food and goods)
  • Cat 3: Industrial materials (includes coal, wood, grain...)
For FIRS and ECS, we use 5 categories (but they can be reduced to 3 or 4 categories):
  • Cat 1: Passengers and mail (includes also ECS' Tourists)
  • Cat 2: General food (includes: food, alcohol, fruit...)
  • Cat 3: General goods (includes: goods, petrol, building material...)
  • Cat 4: Raw industrial material (includes: coal, oil, wood...)
  • Cat 5: Transformed industrial material (includes: chemicals, lumber,
    manufacturing supplies, farm supplies...)

It doesn't matter which type of cargo you deliver to achieve category goals. To achieve requirements for Cat. 2 (general food), you can deliver food, alcohol or fruits. Requirements increases depending on town size, in two ways:
- each category starts being required only on a defined town size. Passengers and mail are required immediately, while General food cargos are required only for towns bigger 500 and General goods cargos, for towns bigger than 1500.
- for each cargo category, requirement increases linearly depending on town size.
Hence, little towns only need Cat.1 cargos (Passengers and mail) to grow. Cities with at least 500 habitants also need - increasingly - food. When cities grow more, other categories come in play. That means, that in the end, you can only expect to have a full - and long term - city growth when developing some local industry, to which deliver raw and transformed industrial materials.


The StoryBook gives detailed informations about cargo categories. Here an example, for FIRS (Firs economy):

Attachment:
RCG-StoryBook.png
RCG-StoryBook.png [ 43.25 KiB | Viewed 11582 times ]


Other features/things to know:
  • The town box gives information about cargos, in the form Category: requirement / supplied (last month) / stockpiled (last month).
  • The growth rate is calculated using an average over 8 months, to avoid big gaps and smoothen transitions. Growth rates only change progressively and exponentially, depending on cargo supply.
  • Data are saved: you can safely save and reload your games without losing the stockpiling datas, growth rates, and so on.
  • There is a difficulty setting (50 = easy, 100 = medium, 150 = hard). 100 is the normal level that I recommend in order to have a real challenge, yet not to hard. Other settings allow better tuning the script.
  • For a more detailed description, see the readme.txt file.

Requirements:
  • OpenTTD version 1.4
  • SuperLib v. 38

Download:
  • The last stable script version (which is now v5), hosted on BaNaNaS can be downloaded from this link.
  • A recent development revision (which is now r126) can also be downloaded here (see attachment below). This might contain bugs, which I wait you to report, so you help me to make the script better !
  • You can browse the code or get last revisions on http://dev.openttdcoop.org//projects/gs-rcg/.

Please report bugs, either here on forum's topic, either on repository's bugtracker. That will be *greatly* appreciated. Also, before reporting bugs, make sure you are using the last revision (see below).

Have fun !


Updates

06/01/2015: Revision 127
- fix: better handle the save process if towndata are being updated
- fix: remove old warning storybook pages in monthly update

31/12/2014: version 5
- new: add several expert settings to fine tune calculations
- new: add a setting to disable growth rate text under town names
- new: add a setting allowing to merge some categories
- new: add a StoryPage with cargo category informations
- new: add support for YETI - needs testing and feedback
- new: add a method for checking whether industry setting is consistent
- change: only display required categories in townboxes
- fix: disabling original arctic and tropical cargo requirements
- fix: unifying variables style

28/08/2014: version 4
- added support for baseset industries (temperate, arctic, tropical,
toyland), all FIRS' economies and ECS (all vectors)
- introducing GSText and lang files
- townboxes text formatting improved
- added a method to check savegame compatibility between revisions
- savegame code completely rewritten and simplified
- code cleanup and additional comments
- readme.txt completely rewritten
- updated to SuperLib v. 38
- setting up hg repository
- fix: game is no more crashing when new towns are founded. Thanks to
krinn.
- fix: game is no more crashing when saving immediately after loading
- fix: the script now correctly counts the deliveries from all
companies
- fix: lot of bugs; no more know bugs

25/07/2014: version 2
- some bug fixes
- some recalculations, specially on the scaling of city growth, depending on goal achievements.
- no more pausing each month

12/01/2014: version 1


Attachments:
Renewed_City_Growth-r127.tar [100 KiB]
Downloaded 383 times

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


Last edited by keoz on Tue Jan 06, 2015 9:51 pm, edited 102 times in total.
Top
   
PostPosted: Sun Jan 12, 2014 1:40 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 5563
Location: Eastern KY
keoz wrote:
Known bugs:
  • If cities are created in game, the script is gonna to crash. Should be easy to fix, but for the moment, it is a problem. That's true also for the scenario editor.


Does this mean if you're developing a scenario, you should add all your cities first, and then add this script last?

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Sun Jan 12, 2014 7:41 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4529
Location: /home/sweden
For uploading to bananas you can use either a) Bananas Web interface or b) musa. If you want to make FIRS a dependency, you must use musa. Otherwise I suggest starting with the web interface which probably is easier to get started with.

Some information about bananas can be read on the wiki

Worth to mention is to not edit bananas content via the bananas web interface if any of the dependencies that the content depends on has been updated. Doing this will remove the dependency.

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


Top
   
PostPosted: Sun Jan 12, 2014 8:17 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Zuu wrote:
For uploading to bananas you can use either a) Bananas Web interface or b) musa. If you want to make FIRS a dependency, you must use musa. Otherwise I suggest starting with the web interface which probably is easier to get started with.

Some information about bananas can be read on the wiki

Worth to mention is to not edit bananas content via the bananas web interface if any of the dependencies that the content depends on has been updated. Doing this will remove the dependency.


Already uploaded. Thank you for additional tips.

kamnet wrote:
keoz wrote:
Known bugs:
  • If cities are created in game, the script is gonna to crash. Should be easy to fix, but for the moment, it is a problem. That's true also for the scenario editor.


Does this mean if you're developing a scenario, you should add all your cities first, and then add this script last?


I just discover that you can add a new GS in the scenario editor, therefore I suppose it should work. It would be better trying first though. In any case, if the bug occurs, there is a simple hack to do: before loading the game, erase the "!" in the file town.nut, line 26 and when the game is loaded, put it back.

_________________
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: Tue Jan 21, 2014 5:01 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
This looks pretty cool, and I'm glad someone else was willing to take over my code. I've been way too busy with work lately.


Top
   
PostPosted: Fri Jan 24, 2014 7:06 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Quote:
The script only triggers growth in the cities which are exchanging passengers.


So ignored towns, without any passenger stations, have an unlimited growth rate?

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
PostPosted: Tue Feb 18, 2014 1:42 am 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 4:57 pm
Posts: 9
Location: Austria
keoz wrote:
Known bugs:
  • If cities are created in game, the script is gonna to crash. Should be easy to fix, but for the moment, it is a problem. That's true also for the scenario editor.


Hi keoz

Does this known bug not only apply to new cities, but to tiny cities at all? Else I may have encountered another bug.


I'm using your script since some few games over several ingame years without any problem. Now in my recent game, still in the early start, the script crashes very often.

It all started after attaching a tiny town, less than 100 inhabitants, into my passenger route. Since then the script crashed nearly every month. The debug log tells of "sumgoals" that are zero. Meanwhile, the inhabitants decreased to less than 50, but I don't know if this happend because of these crashes. I played on difficulty easy (50), but for testing I increased to medium (100) and hard (150) ... even tried 250: The script doesn't crash that often anymore, as sumgoals aren't zero anymore that often. But it still does and that's annoying.


I'm playing on Win64, OpenTTD 1.4.0-beta4 ('cause of passenger and wares distribution) with the banana-version of your script.


Of course, as a workaround, I simply could detach this town from route or start a new game. But I would be really happy if you could solve this problem, if the reason for this problem (if it's the same as the quoted bug info) is already known. If you don't have time to solve it, you may could point me to the right direction to try it myself? (just don't have any knowledge of OpenTTD scripting yet).


Attachments:
debug.png [221.92 KiB]
Downloaded 6 times
Top
   
PostPosted: Tue Feb 18, 2014 4:51 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Kogut wrote:
Quote:
The script only triggers growth in the cities which are exchanging passengers.


So ignored towns, without any passenger stations, have an unlimited growth rate?


Kogut, I only see your post now, sorry. Ignored towns will just have no growth at all.

Saetan wrote:
Now in my recent game, still in the early start, the script crashes very often. [...]


Saetan, I already have seen this bug here, though it only happened a few times, not so often as you. The problem should be solved in the actual development version. I attach it here, but i'm not sure it is compatible with the one you are using. Try it and let me know. If there is a problem, we should find a workaround.

If you find other bugs, I'm interested to see them.

As a note: I changed some calculations in the new version: not massively, but you may notice some changes in the goals and growth rates (basically, goals are a little bit easier to achieve).


Attachments:
Renewed_City_Growth-v1.4.tar.gz [13.31 KiB]
Downloaded 89 times

_________________
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: Tue Feb 18, 2014 5:44 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 4:57 pm
Posts: 9
Location: Austria
Hi keoz

Great there's already a fixed version to try, many thanks.


I may ask you for additional help? How to update banana-v1 to v1.4? ;-)

I don't get it, as the script seems to be embedded into the savegame. Or do I need to have to start a new game anyway?


edit:

I already tried to move the *.tar (unpacked *.gz first) into <username>\Document\OpenTTD\game directory, without success. Tried to rename it, so it fit's banana-v1 filename. At last attempt, I unpacked the *.tar so I got the four *.nut files and placed them in the directory. Anytime, the game seems to use banana ...


Top
   
PostPosted: Tue Feb 18, 2014 6:24 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4529
Location: /home/sweden
keoz has not increased the internal version number of this script. It is still at version 1. Thus while users can download and install this from bananas they will then have multiple versions of this script that all claim to be version '1'. If the script author want to be sure that OpenTTD will know which of these that are newer/later, he/she must increase the internal version number (as returned by GetVersion() in info.nut). In order to allow users of older versions to upgrade to the new one, the author must define and provide a response from GetMinVersionToLoad that is lower or equal to the version of the script recorded in the save game.


Saetan: To work around this issue you as user can make sure to remove all past versions of this script from the OpenTTD search path (see readme on where it looks for files) so that OpenTTD will only find this version of the script. As it claims to be the same version as the past versions, OpenTTD will happily use it to load your save game.

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


Top
   
PostPosted: Tue Feb 18, 2014 6:36 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Saetan wrote:
I may ask you for additional help? How to update banana-v1 to v1.4? ;-)


I will, when the actual changes are completely finished. Still some work before the next release (version 2).

Saetan wrote:
I don't get it, as the script seems to be embedded into the savegame. Or do I need to have to start a new game anyway?


Try the following:
1: Remove your version of the gamescript from the openttd content. Replace it with the new one and untar it.
2: Rename your savegame as a scenario (.sav -> .scn). Load it with the scenario editor.
3: Open the AI/gamescript configuration box and load the gamescript.

It should work.

Edit:

Saetan wrote:
To work around this issue you as user can make sure to remove all past versions of this script from the OpenTTD search path (see readme on where it looks for files) so that OpenTTD will only find this version of the script. As it claims to be the same version as the past versions, OpenTTD will happily use it to load your save game.


I just tried that but for whatever reason, the game refused to load the script again. I had to load it with the scenario editor.

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


Last edited by keoz on Tue Feb 18, 2014 6:44 pm, edited 2 times in total.

Top
   
PostPosted: Tue Feb 18, 2014 6:43 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Edit: double posting.

_________________
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: Tue Feb 18, 2014 7:26 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 4:57 pm
Posts: 9
Location: Austria
Thank you very much, keoz!

Btw., I didn't mean when you will update banana v1 to v1.4, but how to update from banana-v1 to dev-v1.4. ;-)

With your instruction I got it:

After replacing the old file with the new, untared one in the "content download" and "game" directories, I renamed the savegame as scenario file as you told me. Then I had to open it in the scenario editor, where I activated the script and saved again, just to play this scenario afterwards.

The ingame script information still tells of version 1, but after five years of fast-forwarding, no single crash happend (on difficulty easy, 50) again and the town grew to ~200 inhabitants. So everything seems to be fine now.

So, I say thank you again for your help. :-)

If I recognize any further problems, I'll tell you.


Top
   
PostPosted: Tue Feb 18, 2014 7:32 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Saetan wrote:
Btw., I didn't mean when you will update banana v1 to v1.4, but how to update from banana-v1 to dev-v1.4. ;-)


Please, don't. I'll have to do some additional works and I prefer do it myself.

Saetan wrote:
The ingame script information still tells of version 1, but after five years of fast-forwarding, no single crash happend (on difficulty easy, 50) again and the town grew to ~200 inhabitants. So everything seems to be fine now.


Great ! :D

_________________
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: Tue Feb 18, 2014 7:48 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 4:57 pm
Posts: 9
Location: Austria
keoz wrote:
Saetan wrote:
Btw., I didn't mean when you will update banana v1 to v1.4, but how to update from banana-v1 to dev-v1.4. ;-)


Please, don't. I'll have to do some additional works and I prefer do it myself.



*hehe* ... not updating the online distribution, I only meant, how to update my own game. Banana itself as distribution of your script, that part is completly your baby. ;-)


Top
   
PostPosted: Tue Feb 18, 2014 10:11 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Saetan wrote:
keoz wrote:
Saetan wrote:
Btw., I didn't mean when you will update banana v1 to v1.4, but how to update from banana-v1 to dev-v1.4. ;-)


Please, don't. I'll have to do some additional works and I prefer do it myself.



*hehe* ... not updating the online distribution, I only meant, how to update my own game. Banana itself as distribution of your script, that part is completly your baby. ;-)


Mmh ok, I completely misunderstood your point. Looks like I really played a little bit to much those days. :wink:

_________________
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: Sun Mar 09, 2014 10:42 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon Dec 23, 2013 4:33 pm
Posts: 664
Location: Bærum, Norway
This looks very interesting. I'd like to add a suggestion: Make city growth aware of the time period, such that pre c. 1850, growth should be very slow (1/8). From 1850-1900 a little quicker (1/4), then a new pace 1900-1950 (1/2), and "normal" (full) growth only from 1950. Some of us like to play with horses in the 18th century, but don't like megacities :)

_________________
My screenshots
The 1700-2050 Ships & RVs thread
Norwegian Alternate Town Names


Top
   
PostPosted: Mon Apr 07, 2014 3:57 pm 
Offline
Engineer
Engineer

Joined: Sun Aug 12, 2012 1:58 pm
Posts: 29
Hi Keoz/anyone reading,

Do you have any idea, why I experience the problem of not seeing the required cargo etc. for cities to grow, in the city screen? It's just a normal cityscreen like Always.

This is the same problem I've addressed with some other GS (except Neighbours Are Important). It may well be me, but I don't see what I'm doing wrong in that case...

Thanks for any clarification!


Top
   
PostPosted: Mon Apr 07, 2014 4:54 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
leifbk wrote:
This looks very interesting. I'd like to add a suggestion: Make city growth aware of the time period, such that pre c. 1850, growth should be very slow (1/8). From 1850-1900 a little quicker (1/4), then a new pace 1900-1950 (1/2), and "normal" (full) growth only from 1950. Some of us like to play with horses in the 18th century, but don't like megacities :)


Hi,

these is theorically possible, but it would need a lot of rewrite and it's not gonna be on the top-list, at least for now. As a workaround, you can change the settings to harder for the earlier time (which is possible on a running game). Set it 400, then 200, then 100. That would make the job.

MrRB wrote:
Do you have any idea, why I experience the problem of not seeing the required cargo etc. for cities to grow, in the city screen? It's just a normal cityscreen like Always.

This is the same problem I've addressed with some other GS (except Neighbours Are Important). It may well be me, but I don't see what I'm doing wrong in that case...


I absolutely don't know why. Could you post a screenshot of the problem and eventually, also a savegame ? Does the problem happens in all cities or only some of them ?

_________________
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: Mon Apr 07, 2014 8:40 pm 
Offline
Engineer
Engineer

Joined: Sun Aug 12, 2012 1:58 pm
Posts: 29
Hey Keoz,

Here are a screenshot and a savegame.

I've had to make one, because I didn't start an actual game yet with your GS, because I immediately stumbled onto this glitch.

Thanks for your time!


Attachments:
Screenshot - No Growth Goals.png [439.95 KiB]
Downloaded 2 times
Demonstration, 09-01-2000.sav [56.96 KiB]
Downloaded 109 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 179 posts ]  Go to page 1 2 3 4 59 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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-2017 phpBB Limited

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