[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

gravelpit
Traffic Manager
Traffic Manager
Posts: 201
Joined: 26 Feb 2015 14:49
Location: Poland

Re: [GS] Villages Is Villages

Post by gravelpit »

Allan & Co., 5 lis 2004.png
(1.56 MiB) Not downloaded yet
I have a problem that cities just disappear after about 100 years, I deliver passengers, mail, food, even building materials and alcohol and nothing either grows or disappears!

I have been playing OpenTTD for many years and I know how to deliver goods to cities.
The best part is that cities that are left alone do not end!

before;
allan.png
before
(477.86 KiB) Not downloaded yet
KeepinItRail
Engineer
Engineer
Posts: 18
Joined: 07 Sep 2020 15:14

Re: [GS] Villages Is Villages

Post by KeepinItRail »

Have you upgraded the roads to a type which does not permit buildings? Are you using Timberwolf’s Roads? I think only town roads from that grf permit buildings.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Exactly that - those are "A road", towns can't build houses alongside them. It's all in the README for Roads, which no-one ever reads ;)
gravelpit
Traffic Manager
Traffic Manager
Posts: 201
Joined: 26 Feb 2015 14:49
Location: Poland

Re: [GS] Villages Is Villages

Post by gravelpit »

Timberwolf wrote: 04 Apr 2016 22:16 That's interesting - looks like it's running into some problems with the language file. It's also not finding the compatibility script for API version 1.5 (AFAIK there haven't been any material changes 1.5 -> 1.6), I don't know if that would have an impact. I'll give that a try my end.

Which version of OpenTTD are you running?
Any chance I could get a screenshot of the folder you extracted the .tar file to?

The SuperLib for NoGo is a problem I ran into as well - there's a different version between AI and NoGo, I was convinced I'd downloaded version 39 until I realised I was looking at the AI version It's fine if you download from BaNaNaS, but of course I forgot about using the .tar directly. I'll make a note on the first post so nobody else gets caught out.
I guess it is somethhinng white youre roud set,i play on and citys make shorter(not grow) and i switch to RattroadsSet and everthings ok
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

Hi Timberwolf, I've got some towns refusing to grow, despite seeming to have everything they need. Can you provide any insight? (I don't know that it's a GS problem, but it's one candidate) viewtopic.php?f=31&t=88779
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Is the town set still providing buildings in the 2070s? It looks to me like the problem is upstream from the game script, the town is allowed to grow by the script but it's not doing anything.

Do those roads allow houses built alongside them? That's the new favourite for breaking town growth, upgrading to a road type that doesn't allow houses.
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

Timberwolf wrote: 21 Apr 2021 23:20 Is the town set still providing buildings in the 2070s? It looks to me like the problem is upstream from the game script, the town is allowed to grow by the script but it's not doing anything.
Other towns are growing though (generally lower-population towns)? and I managed to kick-start one town as described in the thread, not sure how, though, but it continues to grow when the gamescript allows it. And some towns haven't grown in 200 years, so they were failing on 1950s buildings equally.
Timberwolf wrote: 21 Apr 2021 23:20 Do those roads allow houses built alongside them? That's the new favourite for breaking town growth, upgrading to a road type that doesn't allow houses.
No NRT on this -- as you can see it's a game I've been working on a while...

Thanks for the replies, I think that confirms what I need to know, that it's not the GS... (though I'd be happy with any further ideas you might have!)
User avatar
JGR
Tycoon
Tycoon
Posts: 2590
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: [GS] Villages Is Villages

Post by JGR »

In the script, class town -> last_growth_state is never correctly initialised or saved/loaded.
If the game is ever saved/loaded, or if the script is reloaded, the script can subsequently fail to ever set the growth rate if the desired growth rate is the same the same as the default value, and this does not match the actual value.
Ex TTDPatch Coder
Patch Pack, Github
mrjack2
Engineer
Engineer
Posts: 74
Joined: 21 Jan 2016 23:04

Re: [GS] Villages Is Villages

Post by mrjack2 »

See JGR's reply on my thread.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

JGR wrote: 23 Apr 2021 21:14 In the script, class town -> last_growth_state is never correctly initialised or saved/loaded.
If the game is ever saved/loaded, or if the script is reloaded, the script can subsequently fail to ever set the growth rate if the desired growth rate is the same the same as the default value, and this does not match the actual value.
Yes - specifically, it's always set to GSTown.TOWN_GROWTH_NORMAL regardless of the last actual state. This causes a problem if the town has growth disabled in the save game, but after load Villages thinks it should be growing normally. In that instance, both the new and old state are "growing" so it never flips the actual switch.

I suspect most people never notice because you need a town to be eligible for a status change at the point the game is saved, then never have a passenger or mail shortfall after it is loaded (which would make Villages disable town growth, change the previous state flag, then correctly enable it when conditions are met again) Should be an easy change to make it always allow the first update on a newly loaded game.
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Version 23 of Villages Is Villages is now on BaNaNaS, fixing "stuck" town growth for towns due to their actual status not matching the script's assumed status after a save/load cycle.
sziha
Engineer
Engineer
Posts: 29
Joined: 30 Jul 2013 19:47
Location: Vancouver, BC, Canada

Re: [GS] Villages Is Villages

Post by sziha »

Hi Timberwolf, firstly thank you so much for creating this script, I have played many amazing games with it!

Recently with the release of FIRS 4 I found the Steeltown economy which does not include some goods required by your script for town growth (specifically goods, building materials and alcohol). I know it is impossible to support all the combinations of the goods in all the NewGRFs out there however I wanted to ask if you are considering an option for a user to substitute or change some of the goods not supported by the economy? In the FIRS 4 Steeltown specific example I could think of cement, glass or paints and coatings to be used in growing towns as well.

Looking forward to your thoughts, thank you!
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

Matching with the spirit of Steeltown, the town growth cargo in that case is vehicles. Yes, this is a little evil. But why would you play Steeltown if not to complete the greatest industry chain there has ever been?

On configurability, I've looked at some of the scripts which started down this road and the configuration window inevitably ends up looking like the user interface of a 1990s mod tracker, with huge lists of switches determining what each type of cargo is and does. So I'd rather leave it with an opinionated, "this will work with certain industry sets in a particular way, which may or may not be balanced sympathetically with the gameplay approaches of those sets". (And ignore the fact that really, it should be enumerating by town cargo effect and not looking for individual labels)
sziha
Engineer
Engineer
Posts: 29
Joined: 30 Jul 2013 19:47
Location: Vancouver, BC, Canada

Re: [GS] Villages Is Villages

Post by sziha »

Thank you for getting back go me! For me, a map is never complete without some passenger trains that cargo trains have to negotiate the space with :) I totally agree with keeping the menu simple. I will adjust the significance of cargo that exist in Steeltown and go for it.
SirArag
Engineer
Engineer
Posts: 2
Joined: 15 May 2021 10:28

Re: [GS] Villages Is Villages

Post by SirArag »

Hello Timberwolf, could you please clarify to me how the Infrastructure Cost Modifier works?

I tried it on vanilla and on JGRPP. First I tried changing it in existing game and then I created two new saves. One with modifier set to 100 from the beginning and the other with it set to 200. But I never noticed any difference.
Is it something that changes as the game progresses (I waited only few years)?

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

Re: [GS] Villages Is Villages

Post by Timberwolf »

It's a limitation of GS that it can't modify the infrastructure costs directly, but you should see a larger bill in the "Other" section of games where you have that enabled. (Assuming you also have the game setting for infrastructure costs enabled, otherwise it will be trying to scale up a cost of 0 and you won't see any difference)
SirArag
Engineer
Engineer
Posts: 2
Joined: 15 May 2021 10:28

Re: [GS] Villages Is Villages

Post by SirArag »

Ah, that explains it. It didn't occur to me to look at that section.
Thanks for clarification and for the script. It adds so much fun to the game for me :)

Have a nice day.
Reedtanguerra
Engineer
Engineer
Posts: 6
Joined: 31 May 2021 17:11

Re: [GS] Villages Is Villages

Post by Reedtanguerra »

Hello! As a real life financial professional, I'm delighted to play with increased financial difficulty. However, much like an earlier poster on this thread, I cannot get the dividends to start paying out. I've reduced the settings down to a $2 million cash float and zero quarters of running costs, and still nothing is paying out. I have $3.7 million on hand, so I'm really not sure what I'm doing wrong. Please advise?

Edit: The dividend finally kicked in 1751 when I reached $4 million the bank. I don't get it, but never mind script works as advertised!

Second edit: I have my dividends set to increase 1%. It appears to be taking 4 years to increase 1%. Perhaps something went haywire when you altered the code to change years into quarters, and the settings now translate to 4x what it says in the parameters?
Attachments
Winterrose Logistics, 1701-04-09.sav
(2.08 MiB) Downloaded 142 times
Timberwolf
Transport Coordinator
Transport Coordinator
Posts: 321
Joined: 22 May 2006 18:25
Location: London-ish.
Contact:

Re: [GS] Villages Is Villages

Post by Timberwolf »

This is something a little bit confusing between the internal calculation and the newspaper message.

The internal calculation works out how big a "spare cash pile" you have, then takes a % of it. That % increases each year you pay a dividend, until hitting the maximum. This will increase consistently on an annual basis, providing you continue to have a large pile of spare cash.

The newspaper message publishes the dividend as a % of the current company value, which is inevitably lower than the % of spare cash that dividend represents. (As the company value will include all cash on hand, plus the value of vehicles, routes and buildings). With sprawling networks and players reinvesting most of their profits in building the company, it is quite common to see 80% of the spare cash result in only a 9-10% dividend with respect to company value.

As to $, I think the values use the internal OpenTTD currency which is £, so it's before exchange rate and IIRC 1£ = 2$ in game.
Reedtanguerra
Engineer
Engineer
Posts: 6
Joined: 31 May 2021 17:11

Re: [GS] Villages Is Villages

Post by Reedtanguerra »

BAH! I doth protest having to do math and deal with currency conversion while playing a game in my free time. :lol:

Thanks for the explanation and the wonderful game mod. There is a Youtuber of similar name, with a very entertaining Let's Play involving an early year start and a hysterical penchant for silly horse names. If that is also you, keep up the excellent work all around good sir! :D
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests