[GS] Simple City Builder game script

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

Lucas79
Engineer
Engineer
Posts: 4
Joined: 17 Nov 2012 15:26

Re: [GS] Simple City Builder game script

Post by Lucas79 »

Hi Honza,

Thanks for your reply and looking into this issue. Glad to read it wasn't something I was doing wrong. :D

Looking forward to your next update and kind regards.
There is no spoon...
iustinr
Engineer
Engineer
Posts: 2
Joined: 08 Aug 2021 14:05
Location: Suceava, Romania

Failed to compile 'simple_city_builder-2021.04.17/info.nut'

Post by iustinr »

Hi!

I'm trying to get the script working but no luck so far.

Image

This is what pops up in the command line when running OpenTTD. I tried looking through the script files and it might be due to these lines of code in the "info.nut" file, but I'm not 100% sure:

Image

Could you please look into it or help me fix it somehow? I would really appreciate it! :D
Summa sedes non capit duos.
Honza_
Engineer
Engineer
Posts: 120
Joined: 29 Aug 2010 10:29

Re: [GS] Simple City Builder game script

Post by Honza_ »

No idea. Perhaps you are running some strange OpenTTD version. Or you could try deleting the script and redownload it.
iustinr
Engineer
Engineer
Posts: 2
Joined: 08 Aug 2021 14:05
Location: Suceava, Romania

Re: [GS] Simple City Builder game script

Post by iustinr »

Hmmm... I already tried reinstalling the script multiple times and I'm running OpenTTD 1.10.3, but I'll try version 1.11.2. Thanks for the hint! :D
Summa sedes non capit duos.
DataSatan
Engineer
Engineer
Posts: 2
Joined: 14 Aug 2021 20:34

Re: [GS] Simple City Builder game script

Post by DataSatan »

Hi
I really appreciate the effort in this script! Would love to enjoy city building locally, and host games with friends.

I am unable to get it to work yet. My town just shrinks (or stagnates), instead of growing. Required cargo is supplied, and there is a transport service going to and from other towns/cities. It began at 700+pop, and at time of writing my town is now under 400 pop.

I have attached my savegame, and screenshots of my parameters and town.

My game version is latest (steam updated), and vanilla (no other mods).

Any help would be greatly appreciated!
parameters.png
(63.69 KiB) Not downloaded yet
town.png
town.png (112.61 KiB) Viewed 7093 times
Attachments
Datman Transport, Jun 6th, 1992 citybuilder test.sav
(235.97 KiB) Downloaded 147 times
_dp_
Transport Coordinator
Transport Coordinator
Posts: 276
Joined: 18 Dec 2013 12:32

Re: [GS] Simple City Builder game script

Post by _dp_ »

Population decrease is part of growing in OpenTTD. As long as your house count increases population will follow eventually.
DataSatan
Engineer
Engineer
Posts: 2
Joined: 14 Aug 2021 20:34

Re: [GS] Simple City Builder game script

Post by DataSatan »

Thank you for the reply. I started a single player game, so that I could fast forward and test some different setups.

It is working, it was just the growth values that surprised me compared to online games (BTPro, n-ice).

In this current implementation it takes more than six months for a single tick of growth in the early game. I can't tell how consistent you need to be throughout those 200+ days, but it's a long time with no progression. You can complete your entire cities logistic needs for the next three phases while waiting for a single tick of growth.

I've simply hard-tweaked the "Expand" growth mechanism values (which don't have a parameter except dynamic, which doesn't help the early game situation), directly in the town.nut file, to values that better suit my expectations and needs.

Thanks for the mod! Further testing ahead, but it seems to already be very playable with friends now.
Honza_
Engineer
Engineer
Posts: 120
Joined: 29 Aug 2010 10:29

Re: [GS] Simple City Builder game script

Post by Honza_ »

The reason growth is so slow is probably because in the save the town growth is set to Normal. All the CB servers use Very fast, so you might set it to that either.

And the town probably does not increase houses count because of poor location. It is blocked by water from one side and by train station from the other and the road design is not very growth supporting.

I would also suggest using Normal growth mechanism instead of Expand. The growth should be actually almost the same, as Normal is controled more by game while Expand is controled more by script but it just tries to simulate the game vanilla growth with maybe one detail that it is not possible using advanced technics like powerfunding.
Honza_
Engineer
Engineer
Posts: 120
Joined: 29 Aug 2010 10:29

Re: [GS] Simple City Builder game script

Post by Honza_ »

New version uploaded.
Few fixes and new features.

Unfortunately non-english languages may be broken, because the translator engine on openttdcoop has not been working for several months.


On 25.08.2021
Version 13
=FIXES=
- Prevent duplicate companies in scores. Could happen playing scenarios.

=CHANGES=
Town skrinking - new optional setting
- When town is not supplied properly, it has a chance of demolishing house and decreasing population
- town will shrink on condition any cargo is supplied less then 25% of requirement and population is less than 500

City Population Limit setting
- now cities can be limited by population percentage of biggest town instead of its multiplication. Range is 0 to 1000% instead of previous multiplier 1 to 10.

Changing settings in running game
- now you can change any setting in running game so no need to start from beggining when you are not happy with some setting.
- You can do this by changing setting in game (SHIFT+F12 or whatever hotkey you set), saving the game and on load the new settings will update.
thesasgeek
Engineer
Engineer
Posts: 2
Joined: 15 Dec 2021 17:59

Re: [GS] Simple City Builder game script

Post by thesasgeek »

Just trying this script for the first time.

Am I right in expecting other towns and cities to grow? I can’t seem to get the unclaimed to grow.
tho654
Engineer
Engineer
Posts: 2
Joined: 02 Jan 2023 11:33

Re: [GS] Simple City Builder game script

Post by tho654 »

Hi,

I am trying to run this scrip with firs4 but i don't get storage in the city.
This means that the city stops growing at the beginning every month until the correct goods are deliverd.

Is this intended? Or am i doing somthing wrong?

kind regards
Honza_
Engineer
Engineer
Posts: 120
Joined: 29 Aug 2010 10:29

Re: [GS] Simple City Builder game script

Post by Honza_ »

thesasgeek wrote: 30 Dec 2022 13:02 Just trying this script for the first time.

Am I right in expecting other towns and cities to grow? I can’t seem to get the unclaimed to grow.
Only claimed town will grow and cities grow according to script options.
I am trying to run this scrip with firs4 but i don't get storage in the city.
This means that the city stops growing at the beginning every month until the correct goods are deliverd.
Hard to tell, you could check storage settings in script options.
tho654
Engineer
Engineer
Posts: 2
Joined: 02 Jan 2023 11:33

Re: [GS] Simple City Builder game script

Post by tho654 »

See in the attatchment the storage does not seem to be the same as in the parameter for some reason
Attachments
coal storage not working.JPG
coal storage not working.JPG (100.67 KiB) Viewed 5150 times
Honza_
Engineer
Engineer
Posts: 120
Joined: 29 Aug 2010 10:29

Re: [GS] Simple City Builder game script

Post by Honza_ »

I see.

Ok, the settings are a little bit misleading here.

What you need to do is change the
"City Builder Economy Preset" to CUSTOM.

Then the custom settings for storage and others will work.
KayakinC
Engineer
Engineer
Posts: 1
Joined: 29 Jun 2023 21:10

Re: [GS] Simple City Builder game script

Post by KayakinC »

Solved: I somehow did not realize the setting in the game script that limited the size of the other cities to a percentage of your claimed city.

Hi, I just started playing with this script. I noticed that the other "Cities" do not grow or only grow for a few years and then stop. They will not build new roads or building even if you fund new buildings. I have tested a few times on different saves and the Cities always say not growing even with five stop bus loops and train stations taking and leaving pax. Does not matter how many services I try it still says not growing. Even tried with a complete stock game with only the script running and same outcome. Any ideas what may be happening?

Edit: I used cheats to fund towns until I got a fresh city. Put a bus loop in it and it grows for a shot while and also stops growing. This happens every time I fund a new city, it grows and then stops. The cities will not build new building or roads ever again after it stops.
Nick_B
Engineer
Engineer
Posts: 11
Joined: 08 May 2021 22:56

Can this script be put in a scenario map?

Post by Nick_B »

I tried putting this in a custom scenario map, to which the script doesn't run properly at all. It doesn't update what is required and ultimately seems to either get disabled or doesn't function right at all. I'm not sure if this is due to how the script starts up at the beginning of a game or what, but the only way I can make it work properly is via generating a random map, not trying to insert it into an existing one. This is a giant bummer to me when I want to have a heightmap to play on vs a randomly generated thing. I get this script is rather old too, but it should make frequent checks on itself to ensure it is working properly as well as update the values within game. Changing anything in the game script's settings on a running game nowadays does NOTHING contrary to the last update that was put out saying it's now possible to do so.
The_Dude
Engineer
Engineer
Posts: 10
Joined: 11 Oct 2013 19:07
Contact:

Re: Can this script be put in a scenario map?

Post by The_Dude »

Nick_B wrote: 12 Aug 2023 00:51 I tried putting this in a custom scenario map ...
It worked for me. Maybe be more specific what you were doing and what was the problem.

Changing settings works, but you have to save game, and then reload it. It is only updated on reload. Also if you use preset economy, it wont change. You have to use Custom economy and then town requirements will be actually alterable.
AcidDotCom
Engineer
Engineer
Posts: 1
Joined: 05 Nov 2023 01:41

Re: [GS] Simple City Builder game script

Post by AcidDotCom »

Hi,
I've got a strange bug(?) where the script is not saving settings or more accurately, resetting some settings mostly in the custom economy.
I've set around 26 different products that must be delivered all the way up to 45k population. Worked fine till I have saved the game and reloaded it. Now I only have 5 random (maybe default) items with random quantities. Cannot restore the previous settings at all :(

EDIT:
Some more info.
I'm also using FIRS 4 mod and it is set to Steeltown (F4S) economy.
Started the game with:

Code: Select all

0 - Passengers - 150
1000 - Mail - 40
2000 - Food - 100
3000 - Cement - 25
4000 - Coal - 20
5000 - Glass - 20
6000 - Salt - 10
7000 - Paints and Coatings - 30
8000 - Rubber - 25
9000 - Plastics - 50
10000 - Aluminium - 30
12000 - Stainless Steel - 25
14000 - Cleaning Agents - 40
16000 - Vehicles - 20
18000 - Tyres - 10
20000 - Vehicle Parts - 25
22000 - Engineering Supplies - 15
24000 - Electrical Parts - 25
26000 - Sand - 10
28000 - Limestone - 10
30000 - Steel Sheet - 10
33000 - Pipe - 10
36000 - Cast Iron - 10
39000 - Oxygen - 10
42000 - Chlorine - 10
45000 - Pig Iron - 5
After save/load it's:
2023_11_05_13_11_31_OpenTTD_13.4.png
2023_11_05_13_11_31_OpenTTD_13.4.png (6.11 KiB) Viewed 2932 times
Storage is completely different (I had all on 10%). Also quantities on vehicles is 200 instead of 20. All of my other items are now set to 0 required.
McBorer
Engineer
Engineer
Posts: 3
Joined: 12 Mar 2022 10:18

Re: [GS] Simple City Builder game script

Post by McBorer »

Crashed every time on OpenTTD v. 14.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot], peter1138 and 10 guests