Neighbours are Important - playing query re types of cargo r

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

Post Reply
elricks
Engineer
Engineer
Posts: 21
Joined: 29 Jan 2013 03:01

Neighbours are Important - playing query re types of cargo r

Post by elricks »

Good afternoon. I am a long time lover of TTD through all it's iterations. On and off, as otherwise I would NEVER do anything else!!

I have just discovered Game Scripts, and I am currently playing through NAI, Temperate. I only have to supply Passengers, Mail and Petrol, BUT the town info shows stockpiles of Goods and Food. I would prefer a game with as wider a range of requirements as possible, so - my question is - is there something I have to tweak to get a requirement for Goods and Food? I have both industries active, and I sort of expected to the requirement to kick in at some point. Regulated by city size, or by date. My largest city is 11,000, and the date is 2006.

If I have posted this in the wrong place (Dev instead of simple user?) I apologize. Just tell me where it belongs and I will fix.

Thanks for a really great player experience.

I am using FIRS, nightly 26234 and NAI 15

SHIRLEY

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Neighbours are Important - playing query re types of car

Post by Zuu »

Which FIRS economy do you use?

Town goal cargoes are grouped by "town effect". The requirements are set by Town Effect. So if there are multiple cargoes for the same town effect, then supplying any of those will work. However, if that is the case for you I don't know.

As you play in nightly I suggest that you open the Story Book and look at the last page to find out if this is the case.

Also, in Neighbours are important, the number of town effect requirements that exist for a town depend on its own size and the size of the neighbouring towns. Large towns with small neighbours have the highest requirements.


If you cannot figure out, please post a save game and I can have a look.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

elricks
Engineer
Engineer
Posts: 21
Joined: 29 Jan 2013 03:01

Re: Neighbours are Important - playing query re types of car

Post by elricks »

Zuu, thank you for your reply.

I have opened the story book, and the only one of the 5 points to be disabled is the last - "Town growth can be manually toggled"

I have attached 2 save files. Frindworth was the game I was using when I sent off the first email. Getson is the one I am currently working through.

Frindworth was using FIRS, and I changed to ECS when I initialised Getson to see if this made a difference. In Getson I still only see 3 cargoes effecting my town growth.

I will try to explain what I am hoping for.

In my current game, in Pedworth Falls I see Pass, Mail, Goods needed for town growth. I have stockpiles showing for the above PLUS water and food.

I have recently (in game time) created and delivered food to this city. It made no change to the town report. Food did not become a requirement and the food I delivered did not appear in the stockpile.

Zuu, I am enjoying playing this as it is. If I can get the other 2 industries operational it will add to the enjoyment. I raise this issue ONLY to assist you with your development effort, so please do NOT give my request any priority. I am assuming you designed this to have all 5 'cargos' effect the town growth, and there is something I am not doing....

Thanks for your great work.

SHIRLEY
Attachments
Getston Transport, 13th Apr 1961.sav
(275.04 KiB) Downloaded 61 times
Frindworth Transport, 25th May 2013.sav
(276.07 KiB) Downloaded 63 times

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Neighbours are Important - playing query re types of car

Post by Zuu »

I had a look on your Frindworth save game.

I see that you play temperate and I also see in the code that for temperate it will never use anything more than TE_PASSENGERS, TE_MAIL and TE_GOODS as requirement.

It is this part of the code that define the requirements. As you see in temperate and tropic, only maximum three requirements will be set even if you use eg. FIRS or ECS that provide cargoes for TE_WATER or TE_FOOD.

Thus the short-term answer is, if you want most requirements, play in Sub-tropic which has a total of 5 requirements. A long-term answer is that it is possible to re-write this part of the code to take into account that NewGRFs could provide cargoes that have other town effects (added or removed) compared to the default landscapes.

Code: Select all

	switch (GSGame.GetLandscape()) {
		case GSGame.LT_TEMPERATE:
		case GSGame.LT_TOYLAND:
			this.SetCargoGoal(GSCargo.TE_PASSENGERS, MaxAsInt(((population / 10) - 5) * factor, 1));
			this.SetCargoGoal(GSCargo.TE_MAIL,       MaxAsInt(((population / 50) - 5) * factor, 0));
			this.SetCargoGoal(GSCargo.TE_GOODS,      MaxAsInt(((population / 100) - 5) * factor, 0));
			break;

		case GSGame.LT_ARCTIC:
			this.SetCargoGoal(GSCargo.TE_PASSENGERS, MaxAsInt(((population / 10) - 5) * factor, 1));
			this.SetCargoGoal(GSCargo.TE_FOOD,       MaxAsInt(((population / 20) - 5) * factor, 0));
			this.SetCargoGoal(GSCargo.TE_MAIL,       MaxAsInt(((population / 50) - 10) * factor, 0));
			this.SetCargoGoal(GSCargo.TE_GOODS,      MaxAsInt(((population / 100) - 200) * factor, 0));
			break;

		case GSGame.LT_TROPIC:
			// non-desert towns have the 'water' requirement added to the food requirement instead.
			// It will not make food requirement kick in earlier, but when it does it will grow quicker.
			local desert_town = Town.IsDesertTown(this.id);
			Log.Info(GSTown.GetName(this.id) + " at " + Tile.GetTileString(location) + " is desert: " + desert_town, Log.LVL_DEBUG);
			local water_requirement = MaxAsInt(((population / 50) - 2) * factor, 0);
			this.SetCargoGoal(GSCargo.TE_PASSENGERS, MaxAsInt(((population / 10) - 5) * factor, 1));
			this.SetCargoGoal(GSCargo.TE_FOOD,       MaxAsInt(((population / 20) - 5) * factor, 0) + (desert_town? 0 : water_requirement));
			this.SetCargoGoal(GSCargo.TE_WATER,      desert_town? water_requirement : 0);
			this.SetCargoGoal(GSCargo.TE_MAIL,       MaxAsInt(((population / 50) - 10) * factor, 0));
			this.SetCargoGoal(GSCargo.TE_GOODS,      MaxAsInt(((population / 100) - 20) * factor, 0));
			break;
	}
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

elricks
Engineer
Engineer
Posts: 21
Joined: 29 Jan 2013 03:01

Re: Neighbours are Important - playing query re types of car

Post by elricks »

Thanks for your very clear reply. I am off to start a new sub tropic game.

SHIRLEY

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Bing [Bot] and 10 guests