[GS] RCG - A city growth GameScript for OTTD

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] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 15:42

aantono wrote:There you go.
Thanks. did you maybee open the game in game's scenario editor to change the GS's industry set setting ?

Looks like if it has been initialized for Baseset industries and then been changed to FIRS.
Last edited by keoz on 30 Aug 2014 15:58, edited 2 times in total.
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] RCG - A city growth GameScript for OTTD

Post by aantono » 30 Aug 2014 15:44

Yes, that's exactly what I did. Once I've opened it in game, it showed me the basic Arctic economy. So I changed it to FIRS, cause that is what I was using.

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 15:49

aantono wrote:Yes, that's exactly what I did. Once I've opened it in game, it showed me the basic Arctic economy. So I changed it to FIRS, cause that is what I was using.
Ok. It's normal, then. This setting is not intended to be changed while the game is running, but the scenario editor still allows it. I'll think to a proper solution...

Thanks for reporting, btw.

Edit. Problem has been corrected. You can now safely change permanent settings in scenario editor (-r85). Even if you weren't supposed to. :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.

aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: [GS] RCG - A city growth GameScript for OTTD

Post by aantono » 30 Aug 2014 16:45

Thanks, I'll give it a try later today.

P.S. I wasn't really trying to change the settings, I had them previously set to FIRS, but I guess since you've added more economy options, the index id for what used to be FIRS, has changed to the Basic Arctic economy.

P.S.S. As a feature request, how hard would it be to add support for YETI Town and Industry Set as well? (http://dev.openttdcoop.org/projects/yeti/wiki/Previews)

Here is the cargo table for YETI:

Code: Select all

cargotable {
GRVL,//1  c1A stone - raw
CLAY,//2  c1B clay - raw
WOOD,//3  c1C wood - raw
BDMT,//4  c1X building materials - processed

LVST,//5  c2A livestock - raw
GRAI,//6  c2B grain - raw
FRUT,//7  c2C fruit and vegetables - raw
FOOD,//8  c2X food - processed

IORE,//9  c3A iron ore - raw
OIL_,//10 c3B oil - raw
URAN,//11 c3C uranium - raw

STEL,//12 c3AA steel - processed
RFPR,//13 cargo_3BB refined products - processed
BATT,//14 c3CC batteries - processed

VEHI,//15 c3X machinery - processed
YETI //16 c4X workers - like passengers
}

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 16:58

aantono wrote:P.S. I wasn't really trying to change the settings, I had them previously set to FIRS, but I guess since you've added more economy options, the index id for what used to be FIRS, has changed to the Basic Arctic economy.
You're perfectly right. I didn't think to that.
aantono wrote:P.S.S. As a feature request, how hard would it be to add support for YETI Town and Industry Set as well? (http://dev.openttdcoop.org/projects/yeti/wiki/Previews)
That could be implemented quite fast. What takes time is to define categories accordingly to Yeti's cargo scheme - which I don't know.

Edit: I had a fast try based on what I see in YETI's cargo scheme. Someone will need to try it. It's in last r86.
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] RCG - A city growth GameScript for OTTD

Post by aantono » 30 Aug 2014 17:24

keoz wrote:Edit: I had a fast try based on what I see in YETI's cargo scheme. Someone will need to try it. It's in last r86.
The set also preserves the existanse of passengers and mail, (goods also appear in the in-game cargo list, but nothing produces them). I don't see the PaxMail group to have pass and mail in the cargo list.

Not sure what ID is being used in the game for Pax and Mail, but they do exist and I am able to transport them.
Here is the link to the YETI nml file, maybe the table I copied is not the right table? :( http://dev.openttdcoop.org/projects/yet ... y/YETI.nml

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 17:33

aantono wrote:
keoz wrote:Edit: I had a fast try based on what I see in YETI's cargo scheme. Someone will need to try it. It's in last r86.
The set also preserves the existanse of passengers and mail, (goods also appear in the in-game cargo list, but nothing produces them). I don't see the PaxMail group to have pass and mail in the cargo list.
I'm downloading it from hg repo but its extremely long.
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] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 17:52

aantono wrote:
keoz wrote:Edit: I had a fast try based on what I see in YETI's cargo scheme. Someone will need to try it. It's in last r86.
The set also preserves the existanse of passengers and mail, (goods also appear in the in-game cargo list, but nothing produces them). I don't see the PaxMail group to have pass and mail in the cargo list.

Not sure what ID is being used in the game for Pax and Mail, but they do exist and I am able to transport them.
Here is the link to the YETI nml file, maybe the table I copied is not the right table? :( http://dev.openttdcoop.org/projects/yet ... y/YETI.nml
I just tried with a cargo list from v5350 and well there's a problem then, because according to houses informations, they don't produce pax/mails. I anyway have not any cargoid, for them, only for workers.

It's probably way to fast to try this out.
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] RCG - A city growth GameScript for OTTD

Post by aantono » 30 Aug 2014 18:01

I'm attaching the screen capture that has the debug printout with all the cargo ids.
Unnamed, 1st Jan 1949.png
(390.29 KiB) Downloaded 7 times
So based on that list the mapping should be this:?

Code: Select all

::CargoListCat <- [[0,2,16],
					   [8],
					   [4,5],
					   [1,3,6,7,10,17,18,19],
					   [9,12,13,14,15]]
Also, not very sure why STEL cargo is listed twice, under 9 & 12.

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 18:21

aantono wrote:I'm attaching the screen capture that has the debug printout with all the cargo ids.
Unnamed, 1st Jan 1949.png
So based on that list the mapping should be this:?

Code: Select all

::CargoListCat <- [[0,2,16],
					   [8],
					   [4,5],
					   [1,3,6,7,10,17,18,19],
					   [9,12,13,14,15]]
Also, not very sure why STEL cargo is listed twice, under 9 & 12.
Yes, it would be something like that. But I don't understand how the hell you get pax/mails/goods, which I don't. Can I see the GRF's list you're using ? Looks like you're using more than one industry grf.
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] RCG - A city growth GameScript for OTTD

Post by aantono » 30 Aug 2014 18:23

I was testing it on an empty game, the only GRF was the YETI one.

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 30 Aug 2014 18:30

aantono wrote:I was testing it on an empty game, the only GRF was the YETI one.
In your game Baseset cargo types are still active and YETI ones come over them (maybee a different YETI version ?). That's why you have STEL twice. You can play with your own cargocategories reconfigured like the one you showed me, but I can't include those extra cargos.
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] RCG - A city growth GameScript for OTTD

Post by keoz » 07 Sep 2014 11:04

A recent OTTD trunk revision (r26785), which fixed a problem about reloading of values, brakes the RCG script (version 4).

Hence: people using trunk >= r26785, also should only use the RCG GameScript in version >= r109 (here a direct link to Renewed_City_Growth-r109). You can safely upgrade your actual script to this one, whatever version you are using. If you were using the version 4 of the script (or any revision >= r76), don't forget to remove it from your OTTD's content directory before installing the script (thus avoiding that OTTD loads the older version instead of the new one).

This last revision includes a lot of improvements, especially a bunch of new setting options, allowing a far better tweaking of GS' behaviour. That has not been tested extensively but, so far, I did not notice major problems using it. Please report bugs :) .
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] RCG - A city growth GameScript for OTTD

Post by keoz » 20 Sep 2014 09:09

Several bugs still fixed. Here a new revision-112.

Don't forget to remove your previous version of RCG before installing the new one in your content directory.

I'm not gonna make new substantial changes now, until the next version is released. So: hunt for bugs is opened. Please, report. :)

I'm especially interested in a (potential) bug which have been reported about the storybook (which sometime is not displayed). Unfortunately, I couldn't reproduce the bug, even with the savegame. Some modifications in storybook's code may have solved the problem, but I can't be sure. So, please, check if you have the storybook displayed and if you don't, report.
Last edited by keoz on 20 Sep 2014 19:21, edited 1 time in total.
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
MrZombie
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2011 00:58
Location: Mini......soda, USA

Re: [GS] RCG - A city growth GameScript for OTTD

Post by MrZombie » 20 Sep 2014 18:41

I have a question: With this game script, will the towns get smaller if the requirements are not met, and if so, how small will they get?
You just lost The Game.

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 20 Sep 2014 19:04

MrZombie wrote:I have a question: With this game script, will the towns get smaller if the requirements are not met, and if so, how small will they get?
No. There is not a negative growing case. At worst, towns are not growing at all and in this case, they stay unchanged over time.

But there is a corner case: apart of growing, towns also replace buildings over time (it's the normal destroy/rebuild process, which allows building renewing). Hence, it can happen that a high population building is replaced by a low population building, which can result in an overall population decrease. The opposite is also true, though: town population can suddenly increase really fast because of building replacing.
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.

arikover
Route Supervisor
Route Supervisor
Posts: 399
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: [GS] RCG - A city growth GameScript for OTTD

Post by arikover » 22 Sep 2014 07:03

Quite an interesting script! I like the cargo category feature, and the fact that towns must have some industries in order to grow.

I tested it a little, and noticed that in sub-tropical climate, even small villages in the desert can't grow at all because of the 'food' and 'water' requirements. Is this intended ?
In the 'neighbours are important' GS, little villages in the desert can grow only with passenger service at first, then they require food and water that can be stockpiled, which helps a little.
Here, it is a bit hard to get small desert villages to grow.
I have not tried, but I guess it is the same with the 'food' requirement for towns above the snow line in the arctic climate.

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 23 Sep 2014 18:39

arikover wrote:Quite an interesting script! I like the cargo category feature, and the fact that towns must have some industries in order to grow.
I'm glad you enjoy. :)
arikover wrote:I tested it a little, and noticed that in sub-tropical climate, even small villages in the desert can't grow at all because of the 'food' and 'water' requirements. Is this intended ?
In the 'neighbours are important' GS, little villages in the desert can grow only with passenger service at first, then they require food and water that can be stockpiled, which helps a little.
Here, it is a bit hard to get small desert villages to grow.
I have not tried, but I guess it is the same with the 'food' requirement for towns above the snow line in the arctic climate.
Thank you for your feedback, arikover.

I have to say, I didn't test estensively other climates than temperate and I just notice this problem now. Gonna see what can be done. I think I have an idea about the way to disable this requirement. Let's see.
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.

McZapkie
Tycoon
Tycoon
Posts: 1176
Joined: 18 Jan 2014 18:10

Re: [GS] RCG - A city growth GameScript for OTTD

Post by McZapkie » 25 Sep 2014 23:40

keoz wrote: No. There is not a negative growing case. At worst, towns are not growing at all and in this case, they stay unchanged over time.
I observed decay of cities - small populations vanishes and all what I get were empty streets.
Or one/two houses without possibility to expand because no passengers are accepted.

Is it possible to implement protection against city decay below, let say, 50?

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

Re: [GS] RCG - A city growth GameScript for OTTD

Post by keoz » 26 Sep 2014 15:55

McZapkie wrote:
keoz wrote: No. There is not a negative growing case. At worst, towns are not growing at all and in this case, they stay unchanged over time.
I observed decay of cities - small populations vanishes and all what I get were empty streets.
Or one/two houses without possibility to expand because no passengers are accepted.

Is it possible to implement protection against city decay below, let say, 50?
That could be an interesting idea. I also already noticed some (other) problems with very little towns. In my case I didn't see a real decay, but that can come from the fact that on long term games, I only played with houses newGRF which doesn't behave exactly like vanilla houses.

As a matter of fact, establishing some sort of lower limit for population (or houses number) could be a interesting way to deal with all those problems together. It would also be very easy to implement (just call to a new town expansion when a town shrinks under some limit).

I will think further about that.

Also: McZapie, If you have a savegame where a such city-decay is observed I would be interested in having it. If possible, both the savegames of initial and ending situation.
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.

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests