[GS] Balanced City Growth: Version 3 Updated

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: [GS] Balanced City Growth: Version 3 Updated

Post by keoz »

I would appreciate some feedback from players on if the sign spam is too annoying or if you can live with it.
I'll tell you as soon as my current game ends and I start another one. :wink:

Btw, I have a suggestion (note: I speak about playing with FIRS).

It's about the different cargo types necessary for a city to grow up. Some of them cannot always be delivered to a city, because there is not a corresponding industry. In FIRS, it's the case for COAL, MILK, RCYC, ENSP and MNSP.

I know that you already discussed that point and you suggest playing with less towns to increase the territory size, but even like that, it's not easy to have the possibility to deliver each type of those cargos. Take the example of the MILK. It needs a dairy to process. At the moment, in my current game, I have 4 dairies on the whole map (1024*1024) :) In any case, dairy produces food, which is already in the list of necessary cargos for a city to grow, so I think this is redundant and especially difficult to achieve. So, the suggestion is to take out from the required cargos, all those that need processing, listed above.

I suppose you included those processable cargos (like milk and coal) to discourage from sending all the coal of a map to one only station and improve distribution, but maybee is there another way (eventually not based on city growth ?) to achieve this. Or maybee, just taking out some cargos would make the thing. In FIRS, for example, you could take out MILK, COAL, RCYC (which anyway is present only from 1997) leaving ENSP and MNSP in the list of necessary cargos, which would anyway encourage to develop industries all over the map.

Another interesting possibility could be to consider all the industry cargos which are not originally intended to be delivered to a city as one only category, a sort of industrial category (which includes all the aboves cargos, and also any other industrial cargo, like IRON, GRAI, and all others) and make of this category as a whole a requirement for growth. In that way, you make it necessary to distribute industrial production all over the map, but you get rid of the problem of the presence of a single particular industry in a particular city.

This is just a suggestion, and it is up to you to see what you think about it. I'm still testing version 2, anyway, and I'm still not sure I perfectly understand how all works. I don't know if I was completely clear in all...
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.
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: [GS] Balanced City Growth: Version 3 Updated

Post by kormer »

keoz wrote: It's about the different cargo types necessary for a city to grow up. Some of them cannot always be delivered to a city, because there is not a corresponding industry. In FIRS, it's the case for COAL, MILK, RCYC, ENSP and MNSP.

I know that you already discussed that point and you suggest playing with less towns to increase the territory size, but even like that, it's not easy to have the possibility to deliver each type of those cargos. Take the example of the MILK. It needs a dairy to process. At the moment, in my current game, I have 4 dairies on the whole map (1024*1024) :) In any case, dairy produces food, which is already in the list of necessary cargos for a city to grow, so I think this is redundant and especially difficult to achieve. So, the suggestion is to take out from the required cargos, all those that need processing, listed above.

I suppose you included those processable cargos (like milk and coal) to discourage from sending all the coal of a map to one only station and improve distribution, but maybee is there another way (eventually not based on city growth ?) to achieve this. Or maybee, just taking out some cargos would make the thing. In FIRS, for example, you could take out MILK, COAL, RCYC (which anyway is present only from 1997) leaving ENSP and MNSP in the list of necessary cargos, which would anyway encourage to develop industries all over the map.

Another interesting possibility could be to consider all the industry cargos which are not originally intended to be delivered to a city as one only category, a sort of industrial category (which includes all the aboves cargos, and also any other industrial cargo, like IRON, GRAI, and all others) and make of this category as a whole a requirement for growth. In that way, you make it necessary to distribute industrial production all over the map, but you get rid of the problem of the presence of a single particular industry in a particular city.

This is just a suggestion, and it is up to you to see what you think about it. I'm still testing version 2, anyway, and I'm still not sure I perfectly understand how all works. I don't know if I was completely clear in all...
In one of the next few updates I plan on introducing categories, and then the goal amounts will be set at the category level. For example, grain, fruit, milk, sugar beets, and fish would all be in the Raw Foods category. Cities will require x amount of raw foods of at least y types, with x and y increasing as the city grows. The specific cargo types won't be required, so you can choose any type from the category. Once a city grows large enough, you'll probably need to start funding industries to get the demand needed, but for my games I'm usually rolling in the cash by the time that's necessary anyways.

I also needed the signspam code to be in there first to make this happen, which is why I need feedback on that. I'm not sure yet if it'll be in the next update, but soon. The long term solution is probably the elusive story book patch which is still in development.
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: [GS] Balanced City Growth

Post by kormer »

Thor87 wrote: 2) at the begining of the game towns larger then 1000 population needs food, but towns cannot receive it :(.
This one has been bothering me a lot and I've made a little bit more progress on it. The ECS Houses Vector contains additional town buildings for hotels. Hotels will demand food, but aren't built until later in the game. For me, I could get them if I set the start date to 1935, but not 1925. You can't manually build them, and I suspect if you start the game earlier than they appear, they won't be built until the town expands, which won't happen if you don't have the requirements for town expansion. I also don't like the idea of not including food in the requirements as it's a fairly important cargo type.

I think the best possible solution might be for someone to fix ECS Houses Vector so at least a few buildings that demand food have a start date of 1800. I haven't been able to track down a contact for who maintains ECS, so if anyone else has any better ideas I'm all ears.
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: [GS] Balanced City Growth: Version 3 Updated

Post by keoz »

kormer wrote:In one of the next few updates I plan on introducing categories, and then the goal amounts will be set at the category level.
[...]
Good new :wink:

I'll give you feedback as soon I can !
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.
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: [GS] Balanced City Growth: Version 3 Updated

Post by keoz »

Hello,

I have been a little bit through the code today. It was not always easy for me to understand the calculations :wink: It's really a nice work.

While playing, I had sometimes the feeling that little cities were growing to fast and in particular, that there is a excessive growth difference between little and big cities. With a normal pax/mail connection, the cities under 1500 grow extremely fast (10 days/house) and beyond, they don't grow anymore absolutely. The solution in improving the connections and cargo supply would have as result that little cities grow still faster. So, the result is that cities tend, in short time, to have all exactly the same size.

I think it's interesting to make more scaling of the effect of cargo supply on city growth. I played a little bit with the code to change the behaviour and to have a smoother transition. Just changing a little bit the following lines made the trick:

Code: Select all

	if (goaldiffpercent < 0.95 && sumgoals > 0)
	{
		this.TownGrowthRate = (((1 / curpop.tofloat() ) * 10000)/(1-goaldiffpercent)).tointeger();
	}
Obviously, to give sense to the modification, it is coherent to play with a far larger goal_scale_factor. I'm trying to use 800 now. Maybee would it also be interesting to give more impact to goods/food in town growth. I still intend to make some tests.
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.
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: [GS] Balanced City Growth: Version 3 Updated

Post by kormer »

keoz wrote:Hello,

I have been a little bit through the code today. It was not always easy for me to understand the calculations :wink: It's really a nice work.

While playing, I had sometimes the feeling that little cities were growing to fast and in particular, that there is a excessive growth difference between little and big cities. With a normal pax/mail connection, the cities under 1500 grow extremely fast (10 days/house) and beyond, they don't grow anymore absolutely. The solution in improving the connections and cargo supply would have as result that little cities grow still faster. So, the result is that cities tend, in short time, to have all exactly the same size.

I think it's interesting to make more scaling of the effect of cargo supply on city growth. I played a little bit with the code to change the behaviour and to have a smoother transition. Just changing a little bit the following lines made the trick:

Code: Select all

	if (goaldiffpercent < 0.95 && sumgoals > 0)
	{
		this.TownGrowthRate = (((1 / curpop.tofloat() ) * 10000)/(1-goaldiffpercent)).tointeger();
	}
Obviously, to give sense to the modification, it is coherent to play with a far larger goal_scale_factor. I'm trying to use 800 now. Maybee would it also be interesting to give more impact to goods/food in town growth. I still intend to make some tests.

Thanks for the feedback. I'm playing through a big game with ECS right now and hope to release a bunch of balancing changes in the next few days. I'll do some testing with your suggestions and probably include them as well since that was also on my list of things to tweak.
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: [GS] Balanced City Growth: Version 3 Updated

Post by keoz »

kormer wrote:Thanks for the feedback. I'm playing through a big game with ECS right now and hope to release a bunch of balancing changes in the next few days. I'll do some testing with your suggestions and probably include them as well since that was also on my list of things to tweak.
The problem with my tweak, as i'm noticing, is that it reduces the importance of diversifying cargos. I'll still think about it.
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.
okdewit
Engineer
Engineer
Posts: 54
Joined: 30 Sep 2007 21:55

Re: [GS] Balanced City Growth: Version 3 Updated

Post by okdewit »

First of all, the idea of this script is awesome. :bow:

However, I can't seem to get cities to grow at all. First I thought it was because I played with the cargodest build, but I started a game in stable 1.3.0 with the same result: Cities never expand (played 25 in-game years). I do play with all ECS vectors enabled. I have tried setting the script difficulty on 50, 100, and on 150.

Here's a screenshot: http://i.imgur.com/ygVkxpp.png
You can see that I covered my whole city with trams and two badly designed but reasonably working railway stations.
There is 100% station coverage, and there is almost zero time where a station is not loading passengers. I even tried placing heliports in all neighboring towns, and using ships to get passengers to fishing boats, but I still barely get above 1000 in the city management GUI. I tried spending money on advertisement, and even founded my HQ in the city to squeeze out a little bit more passengers... The population has been the same since the start.

Could you tell me what I might be doing wrong?

EDIT: Nevermind, I think I figured it out: started a new game and edited the gamescript settings to use ECS before generating the game, instead of right after the game has started. Seems to work now, I get an amount of days left & a bunch of abbreviations in the GUI now after some passengers have been moved. :)
Image
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: [GS] Balanced City Growth: Version 3 Updated

Post by aantono »

Can someone explain the three numbers following every cargo type in the city screen?
What does PASS:0/112/229 means?
User avatar
keoz
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 16 Jul 2009 10:04

Re: [GS] Balanced City Growth: Version 3 Updated

Post by keoz »

aantono wrote:Can someone explain the three numbers following every cargo type in the city screen?
What does PASS:0/112/229 means?
0 = stockpiled
112 = last month supplied
229 = how much you need to supply this month to achieve the goal for that cargo.
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.
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: [GS] Balanced City Growth

Post by aantono »

kormer wrote: I think the best possible solution might be for someone to fix ECS Houses Vector so at least a few buildings that demand food have a start date of 1800. I haven't been able to track down a contact for who maintains ECS, so if anyone else has any better ideas I'm all ears.
I believe ECS was originally written/maintained by George
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: [GS] Balanced City Growth: Version 3 Updated

Post by aantono »

Another question - how hard would it be to add better cargo required display in the city screen, something similar to what is done in http://www.tt-forums.net/viewtopic.php? ... 3&start=80 ?

Thanks!
User avatar
LittleBear
Engineer
Engineer
Posts: 67
Joined: 05 Oct 2011 15:21

Re: [GS] Balanced City Growth: Version 3 Updated

Post by LittleBear »

Hi there, I really like the sound of this script, but (and I'm feeling pretty stupid here) I can't seem to get it to work. In the game I only get the standard window for cities, with no indication of other cargoes or requirements. I've used other scripts before and had no problems: downloaded from the game, set them in ai/script settings, and played. I've tried several things like using the standard release instead of nightly as well as manually downloading and installing from bananas to no avail. I've started a couple of test games, moved some cargo around and waited a few months, but I still see no change in the city screen. I'm at a loss...

Any suggestions, etc are greatly appreciated, thanks!
Just because I'm a girl doesn't mean my CC has to be pink! :p
akanshah
Engineer
Engineer
Posts: 1
Joined: 25 May 2013 06:21

Re: [GS] Balanced City Growth: Version 3 Updated

Post by akanshah »

Hi,Friends
The current situation is this:
Your bananas entry tells that your GS needs version 27 of SuperLib (given that you have selected SuperLib as dependency at all in the WebUI)
When a user downloads your script, it can add it to a game.
When a user starts the game, the script will try to import version 26 of SuperLib. If the user doesn't have exactly version 26 available, then the script will crash.

So users who have downloaded some other GS that uses SuperLib 26 will not see any problems, but new users who doesn't have v26 will get v27 when they download your GS and the script will fail to work.
User avatar
LittleBear
Engineer
Engineer
Posts: 67
Joined: 05 Oct 2011 15:21

Re: [GS] Balanced City Growth: Version 3 Updated

Post by LittleBear »

Please forgive my ignorance, but I looked through my files and found superlib 27 and superlib 26 both. So I removed superlib 27 and ran the game. Only then did I get a script crash error, saying it was looking for superlib 27. (I can reproduce and furnish screenshots if that is useful.) But either way I still do not appear to have the script working. I must not be understanding akanshah's post?
Just because I'm a girl doesn't mean my CC has to be pink! :p
Gothvan
Engineer
Engineer
Posts: 6
Joined: 09 Jun 2013 20:24

Re: [GS] Balanced City Growth: Version 3 Updated

Post by Gothvan »

Hello and first of all thank you for this script.

I'm very very new to this game but i find interesting to set up more goals and objectives with your balanced growth script. However I have a few questions and I'd really appreciate if you could answer me.

1) As much as I tried I can't find the place where i can see what the city need to grow. When I click on the name of a city I can see the population, the number of passangers and mail this month (and max number) I can see the number of house, if the city is growing or not (and in my case it never grow up) but I can't see what it needs to grow! Is that on this screen or somewhere else? If it is supposed to be here why it's not there. I selected Balanced Growth in the script and I chose Base in the setting of it.

2) As I can understand after my readings, the ressource can be around town. What is the radius of the territory of a city? Can we see it? Also, how can the ressource be "enabled"? Do i only have to bring what it needs (exemple coal for powerplan)?

Sorry for all these questions. I tried to read on it, i tried google (thats where i found this post) but I can't see to find any answer to my questions!

Also english is not my first language so sorry if its not very clear.

thank you!
Cambrion74
Engineer
Engineer
Posts: 1
Joined: 01 Aug 2013 09:01

Re: [GS] Balanced City Growth: Version 3 Updated

Post by Cambrion74 »

Hi,

I used to play TTD ages ago and loved it. I've just recently come across this again and was really interested in your GS. I'm having real difficulty in getting it to work though. I tried with FIRS and ECS(all vectors) and I'm still getting a basic town GUI. I loaded the GS and GRFs outside the game before starting a new game. Am I still doing something wrong?

I mean before generating a new game, not starting
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] Balanced City Growth: Version 3 Updated

Post by andythenorth »

Kormer - I haven't tried this yet, but will in my next game.

How does it handle FIRS economies? Do you have to keep track of all of them? Or does it figure out which cargos are available in current game?

I am open to discussion about making FIRS better support this kind of GS. Either directly, or via add-ons. For example, an add-on grf with power stations has often been suggested for FIRS, so that GS can require coal delivery for towns (could also have town gas works for 19th century).

More interestingly FIRS build has each industry and cargo in scope as a python object, then uses a template engine to generate the nml and the html docs etc. http://bundles.openttdcoop.org/firs/rel ... arted.html

So if you want extra info about FIRS, the build could also output cargo or industry properties into text files, formatted appropriately for squirrel - which you might be able to copy and paste into the GS. I could add additional flags to cargos if that's useful (for example, is the cargo useful for towns, or is it a 'supplies' cargo etc). None of that would be seen by openttd, but might help GS authoring?
OpenAutisTTD
Engineer
Engineer
Posts: 4
Joined: 31 Aug 2013 14:23

Re: [GS] Balanced City Growth: Version 3 Updated

Post by OpenAutisTTD »

Hello there, I'm trying with a fresh install of 1.3.2, then check online content, download the game script, select it, start a new game.
Doesn't work. :(

Tried even with 1.3.1, same result.

I started OpenTTD in debug mode, configured the script to be verbose, but I can not see any relevant output.
Anyway the script is loaded, but I don't see any UI difference and my cities are stuck.

Am I doing something wrong?

Thanks.
Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: [GS] Balanced City Growth: Version 3 Updated

Post by Yajna »

I like this idea and decided to give it a spin.

First map was a temperate region with FIRS. The debug populated all the cargos and after passengers were delivered I saw the updated town GUI with all the cargos and their requirements. I also saw that the town was growing once every 9,999 days. At that point I decided to go for something a little less daunting.

I switched back to basic cargo, re-set the parameters in the GS, and opened a sub-tropical map. All of the cargos were recognized according to the debug and monthly calculations started. The town I chose was in the forest so it required neither food nor water for growth. I supplied it with inter-city passengers via bus and train. I gave it mail. I gave it goods. I gave it diamonds. I gave the town it was sharing passengers and mail with water and food. And the town GUI never updated with the GS cargos and no city would grow. At all. The debug was humming along doing it's monthly calculations. I have no idea where things went wrong. (Cargo requirements were set at 50%, btw, and from what I saw on the town GUI passengers and mail were above that threshold--though not for extended periods of time.) At nearly seven years, I stopped and tried again.

Third map. Temperate again. Basic cargo. Debug populated 0-10 with the cargos (11-31 were null). I delivered some coal to a power plant. Established an intra-city bus line and as soon as the passengers were delivered the town GUI populated with cargos but most of them were null values. I'm guessing this is because, it turns out, FIRS was still selected in the parameters. I ended the map.

Fourth map. Sub-tropical. Basic cargo. Checked, double-checked, triple-checked that basic cargo was selected in the GS parameters. Started the map. The town has inter-city passengers and mail via train. It is regularly supplied with water and food. The town GUI has never populated with the GS cargos, and the town GUI always says, "Town is not growing." The debug is humming along doing it's monthly calculations and it definitely shows basic cargo in the parameters.

I'm left wondering if this GS works on sub-tropical maps. I'm running OTTD 1.3.2. The GS was downloaded via OTTD online content download screen. NewGRFs running (also via OTTD online content download) are US Town Names 1.0, Beul's Mono&Maglev Conversion, Industrial Stations Renewal v0.9.1, American Road Replacement Set, and Total Town Replacement Set 3.14. I've gone through this thread and I've read the GS readme and saw nothing to help me resolve my problem. Would you please advise?

Continued with edit:
Played with base cargo, temperate region. No updated town GUI, no town growth. Started again in temperate with FIRS, and FIRS selected in GS. Town GUI updated as anticipated with GS cargos shortly after passengers delivered. Started again in sub-tropical with FIRS and FIRS selected in GS. Town GUI updated as anticipated with GS cargos shortly after passengers. So it seems it's not the region that is giving me the problem but instead the usage of base cargo. The script appears to work as expected with FIRS, but it does not work for me with base cargo. And to clarify what I mean by base cargo, I mean the standard, basic cargo with no NewGRF enhancements running.

I was really hoping to see how this played "by itself" if you will before I added in the additional complexity of FIRS cargo. So hoping someone might still advise. But now I'm wondering if I've narrowed this down correctly and the standard, basic cargos in OTTD don't work with the script. Sorry I didn't narrow it down further before making my original post. Lesson learned.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 11 guests