[GS] Villages Is Villages

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

Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

That's unexpected. I'll see if I can reproduce it. Didn't see it while testing but maybe I missed something.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Well, that turned out to be a nice little fix for a lunchtime. It wasn't a game-breaking issue but it is annoying when you see those warnings in the debug console. Updated the translation files and fixed - new versions on BaNaNaS and attached to the first post. Warnings are gone for me now, but shout up if there are still any lingering issues or if you see anything odd happening with the town text.

And now, back to the day job...
d0mi3l
Engineer
Engineer
Posts: 23
Joined: 16 Aug 2013 18:04
Location: Poland

Re: [GS] Villages Is Villages

Post by d0mi3l »

I dont have passengers shortfall in town window. No GRFs I use.
Attachments
Bez nazwy, 2000-01-01.png
(803.17 KiB) Not downloaded yet
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

My fault; when I was poking the language file I disturbed something which shouldn't have been working... and of course it stopped working. Corrected version uploaded to BaNaNaS, and I'll update the first post as well.
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

Fantastic GS. I love the industry controls, as I'm the sort of person who hates leaving industries unserviced, but they always just keep on popping up so fast! This way it keeps pace to me.

I reckon a setting for whether to treat cities according to the same rules as towns would be in order? You could mirror all the town parameters for cities, with cities having a higher population range and growing more easily when cargo is delivered at capacity?

And, I want to clarify -- if I reach my city limit, I can grow the limit by delivering any town cargo to it? Or do combinations all need to be delivered together? On an older version of the GS I worked hard to deliver all the town cargoes to a city -- once I did, it said "fund new buildings to grow town"! Which I could have done anyway, I know that works.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Thanks, glad to hear you're enjoying the script. Any cargo will work - the script tracks the amount delivered and grows the limit accordingly. So if you keep delivering goods, then the limit will keep going up (gradually if it's a small trickle of goods, quickly if it's a huge amount).

The reason you eventually get "Fund Buildings to grow town" is because it's the only option left if you're already transporting all passengers and mail, and delivering all types of town cargo, and the growth prospect is still "none". If your growth prospect is "Good" or better then usually you don't need to do anything more, though. Maybe there's an argument for not trying to display any hint when the town already has excellent growth prospects and all passengers/mail are being transported.

I'll have a think about the cities. I liked the idea that a city would still sprawl uncontrollably to keep some of that challenge from vanilla OpenTTD where your suburban train line is now surrounded by skyscrapers and desperately needs the expansion it's got no room for... but maybe there's a possibility for an interesting mechanic there that players can tune according to their preferences.
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

Thanks for the reply! I've just run into an issue on scenario editor -- with the script running I create towns, and there's no ViV stuff in the town window. The same when I then play the said scenario -- I've run it for a few months and it stays with the default town window. When I found new towns in an actual game they immediately go to the ViV window, but the ones I added in scenario editor don't work.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Out of interest, does this happen for towns created one by one, towns created using "many random towns", or both? It looks like the script isn't getting an ET_TOWN_FOUNDED event in the scenario editor, and so never adds them to its internal list. I could have sworn I had things working in the scenario editor before, but maybe there's been a regression since then. (I haven't yet tried to see what conditions I can reproduce this in.)

That said, I did run into a similar problem with industries: I couldn't find a set of events that was guaranteed to catch an industry opening (ET_INDUSTRY_OPEN doesn't fire for player-funded industries, if I recall) which is why the script ends up rebuilding its industry list every three months rather than trying to keep track of what's opening or closing. I could do something similar for towns, although that'll be a bit more complicated as we have to keep track of which ones we've already added so we don't wipe out the internal population counter. Or maybe detect when we're in the scenario editor and don't save the town array, so when you load the game for the first time it's treated the same as a new map. (I prefer this option if possible, because it means the population counters will respect towns you've expanded while creating the scenario. Not sure without investigating if the game script framework will let me do that, though.)
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

This bug should now be gone - both creating a new scenario, and also loading an existing game into the scenario editor, editing it, and saving. You may still not get the Villages is Villages text in the editor, but once you start a game it will begin updating the towns as with a normal game.

New version 9 uploaded to BaNaNaS and in the first post.
User avatar
GuilhermeJK
Engineer
Engineer
Posts: 55
Joined: 01 Nov 2014 05:24
Location: São José dos Campos, Brazil

Re: [GS] Villages Is Villages

Post by GuilhermeJK »

How does the "Manage industries (experimental): On" affect industry types that only become available after a certain time with sets like FIRS? Example: I start a game in 1850 and only on later decades oil rigs will be able to pop up. How would manage industries affect the oil rig appearance?
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

GuilhermeJK wrote:How does the "Manage industries (experimental): On" affect industry types that only become available after a certain time with sets like FIRS? Example: I start a game in 1850 and only on later decades oil rigs will be able to pop up. How would manage industries affect the oil rig appearance?
They won't appear except when they normally would.
ian9113
Engineer
Engineer
Posts: 5
Joined: 24 Feb 2017 18:27

Re: [GS] Villages Is Villages

Post by ian9113 »

Is there a way to control how quickly a city/town grows when it is actually growing? Like does the amount of cargo being delivered have an effect on how fast the town grows, or does the script only control whether it grows or not? Besides this question, I love the script! It really makes my game more challenging and easier to manage without unrealistic metropolises. Thanks :)
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

The script only affects whether towns are allowed to grow or not; once they're allowed to grow, they'll follow all the standard TTD rules - so you can influence the growth speed by the "Town Growth Speed" setting in the game settings. I think Desert/Snow towns will still need food/water in order to grow as well.

(For the technically inclined, I'm just flipping between GSTown.TOWN_GROWTH_NONE and GSTown.TOWN_GROWTH_NORMAL depending on whether the town's population is bigger than an internal "how big should this town be allowed to get?" value.)
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Nearly three years later... I was playing a game with some friends and had a couple of feature requests around stopping the first company to reach profitability and a large network racing away from all the other players.

Villages Is Villages 10 introduces a new class of settings, "Economic Settings" with two configurable options:
  • Corporation Tax applies a fixed rate of tax to the company's pre-tax profit for the previous year. When playing with this enabled you can expect a large tax bill every January! This significantly reduces the advantage for a player who leaves a profitable company running without continuing to invest in their network.
  • Infrastructure Cost Modifier increases the amount by which infrastructure costs scale by, where 100 is no change, and 200 is the original cost squared (which is a huge increase, and almost certainly impractical for gameplay). Values in the range 101 to 105 are recommended, where 105 is equal to (original infrastructure cost) ^ 1.05. This setting can be used to increase the challenge of operating a large network, and encourages careful usage of the existing routes over creating new ones. It can also be reduced below 100 for an easier game.
As these are new and haven't been used in enough test games to ascertain the (un)balancing effects, the default is set to off. However "manage industries" has now lost its experimental tag and the default is for it to be enabled.

Interested to hear how your games play out with the new settings, especially any unexpected balancing issues (I'm not certain whether the infrastructure cost modifier may simply prevent companies growing beyond a certain size, even at moderate settings).
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

A couple of new updates.

One simple one: I removed the dependency on SuperLib as I only used one simple function which was easy to re-implement. Missing Superlib dependencies is the #1 cause of installation failures relating to Villages so this is a major improvement for some people. (Note: I'm yet to update the BaNaNaS configuration to stop it downloading SuperLib. If anyone could point me to an easy way to do this, would be appreciated!)

The other, more major one is the introduction of dividends to make life a bit more painful for companies that build up large cash surpluses without spending them. This is quite a complex mechanic so I recommend a trip through the readme. At a high level: dividends work on a principle of avoiding large cash surpluses. When a company has built up enough money to pay for a few years of its expenses it will start to pay its surplus cash in the form of dividends, which will increase for each year the company operates a large cash surplus. The feature is quite configurable (and can be turned off completely if so desired) so hopefully you can find a setting which will encourage spending money rather than hoarding it.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Re: [GS] Villages Is Villages

Post by Korenn »

Timberwolf wrote: 09 Apr 2020 23:40 A couple of new updates.

One simple one: I removed the dependency on SuperLib as I only used one simple function which was easy to re-implement. Missing Superlib dependencies is the #1 cause of installation failures relating to Villages so this is a major improvement for some people. (Note: I'm yet to update the BaNaNaS configuration to stop it downloading SuperLib. If anyone could point me to an easy way to do this, would be appreciated!)

The other, more major one is the introduction of dividends to make life a bit more painful for companies that build up large cash surpluses without spending them. This is quite a complex mechanic so I recommend a trip through the readme. At a high level: dividends work on a principle of avoiding large cash surpluses. When a company has built up enough money to pay for a few years of its expenses it will start to pay its surplus cash in the form of dividends, which will increase for each year the company operates a large cash surplus. The feature is quite configurable (and can be turned off completely if so desired) so hopefully you can find a setting which will encourage spending money rather than hoarding it.
I'm looking for a town growth script for a hard multiplayer server, and this script sounds like fun, I'll give it a whirl. Though I'm worried the cargo requirements might be too lax (I like the demands for various cargo types, for possibly obvious reasons)

That dividends number sounds interesting, if you store those values and display them on the company overview window then it could become a multiplayer goal to generate as much personal wealth for your manager as possible. that becomes a trade-off between investing in the network to increase turnover and letting the company rake in the cash to bump the goal amount.
Stanley Cooper
Engineer
Engineer
Posts: 8
Joined: 15 Jul 2007 11:46
Location: Russia

Re: [GS] Villages Is Villages

Post by Stanley Cooper »

Hello Timberwolf. First of all thank you for the script you wrote.
I started a new game with your script and and after decades in game i noticed that after some grow period some towns and cities started to die slowly. But the information in the city window says it grows. But what is more strange that one city started dying immediately i reached the goal for grow, and the population reduced from 3500+ to 270 in around in 10 in-game years. I dont really know what the reason for this behavior, because some towns\cities grows normally. If you need i can attach some saves if it would be helpful.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

I think that might be OpenTTD's underlying town growth mechanisms causing the town to shrink, but if you have a save to post up I can take a look.
Stanley Cooper
Engineer
Engineer
Posts: 8
Joined: 15 Jul 2007 11:46
Location: Russia

Re: [GS] Villages Is Villages

Post by Stanley Cooper »

Timberwolf wrote: 08 May 2020 16:01 I think that might be OpenTTD's underlying town growth mechanisms causing the town to shrink, but if you have a save to post up I can take a look.
Hi Timberwolf, two saves in attachment, all grfs from bananas. If you find something i did wrong in game, let me know. Thank you!
Attachments
Panavy Transport, Aug 22nd, 1993.sav
(551.51 KiB) Downloaded 191 times
Panavy Transport, Jun 3rd, 2001.sav
(487.18 KiB) Downloaded 227 times
LaChupacabra
Route Supervisor
Route Supervisor
Posts: 385
Joined: 08 Nov 2019 23:54

Re: [GS] Villages Is Villages

Post by LaChupacabra »

Stanley Cooper wrote: 07 May 2020 19:22 ...and cities started to die slowly.
Without downloading Your saves, I guess You have rebuilt city roads into highways. :)
I am sorry for may English. I know is bed.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google [Bot], Michiel and 3 guests