Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Dec 12, 2018 1:25 pm

All times are UTC




Post new topic  Reply to topic  [ 208 posts ]  Go to page 1 2 3 4 511 Next
Author Message
PostPosted: Tue Dec 27, 2011 8:12 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
As there were no scripts uploaded yet that set town goals, I came up with the idea of uploading a variant of of the script that TrueBrain wrote for NoGo and was used on the #openttdcoop test server.

The basis is that towns has a requirement of passengers, mail, goods, food etc. When the town size grows, the requirement grows. Thus you have to deliver more and more in order to keep growing the town.

What this variant also adds is a neighbour factor. If a town is smaller than its closest neighbours, it will have a neighbour factor < 1. If the town on the other hand is larger than its neighbours the factor will be > 1. Thus, to grow a large town to become even larger, you might want to consider growing its neighbours too, especially if they are small.

Since the script has to find out the neighbours of all towns, it takes quite some opcodes to initialize. Thankfully OpenTTD gives GameScripts 2500 ticks in the map generation process which is enough for most maps. But if you play 1024x1024 or larger with high town density, you might need to run the game in fast forward before the goals are set up.

Download
Via online content or through the bananas website

Currently no libraries are required.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Fri Dec 30, 2011 7:56 am 
Offline
Engineer
Engineer

Joined: Fri Dec 30, 2011 7:49 am
Posts: 1
This script is a lot of fun to play with! Though I was wondering, is it possible to make the supply requirements lower, or set some sort of difficulty parameter? I'd like to be able to have my cities grow a little bit faster!


Top
   
PostPosted: Fri Dec 30, 2011 12:35 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Sure, I was also thinking about adding a parameter to disable the neighbours parameter, which will make it easier and allow playing that style too.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Fri Dec 30, 2011 2:08 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Mon May 31, 2004 9:21 am
Posts: 1303
How many ticks do you need in the generation to find out the neighbour graph? (the current value is set as a: this-should-never-be-reached-but-I-have-to-input-some-value)

_________________
The only thing necessary for the triumph of evil is for good men to do nothing.


Top
   
PostPosted: Thu Jan 05, 2012 7:18 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
With a 2048x2048 map that have high density the setup took 29510 ticks. On a different map of the size 2048x1024 it took 11079 ticks.

These measures were made with about the same amount of setup as in version 1. In version 2 there will be a new feature that will eat a few more ticks but it doesn't have any expansive neighbour lookup but a tile scanner so it is not completely free.

With the new features for version 2 enabled, the setup for a 2048x2048 map took 38863 ticks.


On IRC Eddi mentioned that the amount of towns possible is limited by the town generator. So for the record, I've used the Swedish town names that are included in OpenTTD.


Edit: And for comparison, a 512x512 with the version 2 features enabled took 156 ticks.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Thu Jan 05, 2012 7:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Update - Version 2

Changes:
  • Towns growth can get reduced/stopped when they get congested
  • When a town gets congested, a news message is sent to all companies with road vehicles in the town area that is tested for congestion. A sign is also placed on the town tile to note that the town is congested.
  • Global goals are created for each congested town to reduce the congestion there. At the moment there is no award, not even a news message for accomplished goals. Only way to tell is that the congestion sign in the town centre is removed.
  • Settings:
    • You can now disable that neighbours town sizes affect growth goals
    • The cargo delivery goals can now be scaled by a factor.
    • What happens with congested towns: [no effect, towns grow slower, towns stop grow]
    • A scale factor to scale the limit of number of vehicles in the town centre at which point the town is considered to be congested. The actual limit depends also on the town population.
    Attachment:
    Unnamed, 27th Apr 1950.png
    Unnamed, 27th Apr 1950.png [ 10.65 KiB | Viewed 26977 times ]

I would be happy if those of you who play with this GameScript reports back what kind of values on the two scale factors that you find good. That way I can see if I need to adjust the baseline or the recommended easy/medium/hard values.

I've not actually playtested the congestion feature, only by ether manually jamming towns with buses or using the TownCars AI.

The idea is that when you play against the cargo goals it can give some extra challenge on how you distribute your cargo from feeder stations to the towns. Currently it only consider road vehicles so I guess it could make for some interesting decisions if rail, ships and air is a bit expansive compared to road vehicles.

Attachment:
Oskarfors Transport, 12th Apr 1956.png
Oskarfors Transport, 12th Apr 1956.png [ 120.72 KiB | Viewed 26977 times ]

Attachment:
goal - neighbors-v2.tar [20 KiB]
Downloaded 272 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Fri Jan 06, 2012 11:16 pm 
Offline
Engineer
Engineer

Joined: Fri Jan 06, 2012 11:08 pm
Posts: 4
I am now playing this but after a while my town asks for water. The only problem is that the town has not build a watertower. and i can't fund one myself because when i try it says "can't construct this industry type here... ...can only be built in towns."

My parameters are set as followed:
Cargo req. depends on : Size of current town size
Cargo goal factor (in%): 150
Congested towns: disabled

2nd thing: Cargo goal is @ hard however my town has now a population of 3.626 Goal for cargo = 5 passengers, 1.000 liters of water and 2 tonnes of food i think those values are a bit low for the size of the town.

Edit 1: Now started at a town close to it that already had a watertower.


Top
   
PostPosted: Sat Jan 07, 2012 12:54 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 19, 2004 8:09 pm
Posts: 1732
Location: Sweden
nalyu wrote:
I am now playing this but after a while my town asks for water. The only problem is that the town has not build a watertower. and i can't fund one myself because when i try it says "can't construct this industry type here... ...can only be built in towns."


I believe the water towers must be built on top of a town house. Did you try that?

_________________
Image
Swedish trains * Swedish Town Names * BlockCAD * The GRFMaker Community Page


Top
   
PostPosted: Sat Jan 07, 2012 2:39 pm 
Offline
Engineer
Engineer

Joined: Fri Jan 06, 2012 11:08 pm
Posts: 4
AndersI wrote:
nalyu wrote:
I am now playing this but after a while my town asks for water. The only problem is that the town has not build a watertower. and i can't fund one myself because when i try it says "can't construct this industry type here... ...can only be built in towns."


I believe the water towers must be built on top of a town house. Did you try that?


That worked but it was not needed because started with a town close to it that had a watertower and that one is now much bigger.
Thanks anyway.


Top
   
PostPosted: Sat Jan 07, 2012 4:20 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
nalyu wrote:
My parameters are set as followed:
Cargo req. depends on : Size of current town size
Cargo goal factor (in%): 150
Congested towns: disabled

2nd thing: Cargo goal is @ hard however my town has now a population of 3.626 Goal for cargo = 5 passengers, 1.000 liters of water and 2 tonnes of food i think those values are a bit low for the size of the town.


Those low numbers are clearly a bug. I've confirmed that when you set cargo requirement to depend only on town size, you get the goals 1/100 compared to what they should be. Soon there will be a new version that fixes this issue.

Unfortunately the only way to fix your current game is to hack your version 2 of this game script so that it contains the fix that will be in version 3. For that purpose I've attached both a patch that can be applied to town.nut and a new town.nut that you can replace the old one with. To do so, find the tar file with this GameScript. Probably located in OpenTTD/content_download/game. Move that one up to OpenTTD/game. untar and preferable remove the tar file to not have two different version 2 in the search path. Then either replace town.nut or apply the attached patch.


Attachments:
File comment: Replacement town.nut for version 2. Only required if you need to apply the fix in a running game with version 2 of Neighbours are important. For all others, there will shortly be a version 3 that contains this fix.
town.nut [8.94 KiB]
Downloaded 239 times
File comment: Patch to fix bug in town.nut for version 2. Only required if you need to apply the fix in a running game with version 2 of Neighbours are important. For all others, there will shortly be a version 3 that contains this fix.
factor-fix.patch [3.58 KiB]
Downloaded 217 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
PostPosted: Sat Jan 07, 2012 4:56 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Update - Version 3

Changes:
  • Fixed bug that caused the goals to be 1/100 of the intended values when the neighbours factor was turned off.
  • Reduced the maximum neighbour factor from 800% to 500%. That is large towns with small neighbours can now at maximum get their goals raised by 500% compared to 800% before. Perhaps this will still give a high penalty if you don't also grow the neighbours, but not as extremely high
  • Added a readme.txt


Attachments:
goal - neighbors-v3.tar [22 KiB]
Downloaded 291 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
PostPosted: Sun Jan 08, 2012 5:07 am 
Offline
Engineer
Engineer

Joined: Fri Jan 06, 2012 11:08 pm
Posts: 4
Zuu wrote:
nalyu wrote:
My parameters are set as followed:
Cargo req. depends on : Size of current town size
Cargo goal factor (in%): 150
Congested towns: disabled

2nd thing: Cargo goal is @ hard however my town has now a population of 3.626 Goal for cargo = 5 passengers, 1.000 liters of water and 2 tonnes of food i think those values are a bit low for the size of the town.


Those low numbers are clearly a bug. I've confirmed that when you set cargo requirement to depend only on town size, you get the goals 1/100 compared to what they should be. Soon there will be a new version that fixes this issue.

Unfortunately the only way to fix your current game is to hack your version 2 of this game script so that it contains the fix that will be in version 3. For that purpose I've attached both a patch that can be applied to town.nut and a new town.nut that you can replace the old one with. To do so, find the tar file with this GameScript. Probably located in OpenTTD/content_download/game. Move that one up to OpenTTD/game. untar and preferable remove the tar file to not have two different version 2 in the search path. Then either replace town.nut or apply the attached patch.


As that town had only a population of about 4k it was easier for me to start over but thanks anyway.


Top
   
PostPosted: Sun Jan 08, 2012 10:42 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 02, 2007 8:45 pm
Posts: 8
Hello,

I am trying to run this script on a dedicated linux server with a certain scenario but i am having problems figuring out how to start.

My config has

Code:
[game_scripts]
"Neighbours are important" = enable_neighbours=0


I see it is running on my local windows machine when i generate a game but script is not running when i am loading this scenario.

Is there a trick for running the script with scenarios?

Thanks
Mihai


Top
   
PostPosted: Mon Jan 09, 2012 7:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
You will have the same problem trying to bind a save game to a Game Script after the game has been created. A scenario is basically a savegame with a different extension. To solve your problem without modifications to OpenTTD, you need create a new scenario where you set in your main menu to use this Game Script before clicking on the scenario editor button to create a new scenario.

If you find this too constraining, then that is a feature request for the NoGo framework and OpenTTD itself. For the development of the Tutorial I hope there will be a solution to be able to bind a scenario to a Game Script after the scenario has been created. But that is unfortunately not the case at the moment.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Thu Apr 19, 2012 10:33 am 
Offline
Engineer
Engineer

Joined: Tue Apr 17, 2012 9:18 am
Posts: 7
Aloha Zuu :)

As proclaimed in viewtopic.php?f=33&t=57431 i've extended your script a little bit and wanted to ask you if your interested in the changes. Some of your code still remains within so ofc i won't release it to the public without your review and permission. Anyway these are the changes i've implemented so far...

List o' changes

- Cities now show who their neighbouring cities are within the town GUI.

- Congestion now actually happens (rebalanced values to the point where "Hard" means hard and Easy means easy)

- Added lots of new Settings (and updated others with appropriate descriptions)

- Lots of Balancing for CargoGoals

- Implementing a CacheClass (Tables are great!) for reoccuring calculations all over the place

- Added Periodic Expansion of Cities even while their CargoGoals are not reached (very slow growth, but still ;P)

- Added Option to adjust the TimeSpan between each Periodic Expansion

- Added Option to have Cities benefit from Periodic Expansion more then Towns.

- Replaced integer (percentage) values for difficulties with named Settings. There are always quite a lot, but people wont tell the difference between 50 and 52 ingame anyway, so i think this is more intuitive.

- Added Option to switch between simple (Passengers/Mail) and complex cargoGoals.

- CargoGoals (except for Passengers) now have an offset within their calculation so they form a nice curve instead of a line ;P

- Added a small CargoGoal handicap for Cities without a neighbour if neighbours are enabled.

- Added a Compatiblity Mode for FIRS newGRF (as i love it!). Up to 5 different Goals in the normal Landscape (Passengers->Mail->CratesOfWarez->Food->Fuel)

- Added Translation for German

- Added an Option for changing the maximum amount of neighbours a town may have

- In lack of a better alternative introduced an ugly and primitive way to sort GSSettings into Categories


NextUp:

- Quality of Service: Have a town get a Expand()-boost if the Towns PercentageTransported Values stay above a certain value for at least X months.... for the perfectionist ;)

- Properly Save important values when the Game issues a save.

- Evolving Neighbourhood: Towns pick new neighbours as they grow in size.


Top
   
PostPosted: Thu Apr 19, 2012 7:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Looks good to me. I haven't been playing with the game script much since I created it. The reason why I had percetange settings and not a few labled values was that I didn't want to spend my time playing it through several times to figure out what settings to pick. Instead I opened it up for players to test and hopefully report back what they found as good settings.

Zuu wrote:
I would be happy if those of you who play with this GameScript reports back what kind of values on the two scale factors that you find good. That way I can see if I need to adjust the baseline or the recommended easy/medium/hard values.


So, I very much welcome that you have taken your time and refine the script based on your experience with it. If you look around, you'll see that I've created more AI/GS projects than that I can possible improve all of them to higher standard very quickly.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Sat Apr 21, 2012 9:52 pm 
Offline
Engineer
Engineer

Joined: Thu Feb 23, 2012 10:13 pm
Posts: 18
Very fun script, it certainly adds a certain sense of realism and challenge to the game.

Growing a town starts to become a challenge once it reaches a certain size. In my current game I have practically every large city on the map "feeding" my target city (it started as a size 75 and has grown into a size 10000+). The problem I have now is that I can't send anymore passengers and goods to my target city because the feeder cities are already at maximum production, thus the target city has stopped growing. And even if I managed to grow these feeder cities, I am already producing the maximum amount of goods possible on the map, so I have no extra goods to spare to send to extra cities.

Have I reached the "end game"?


Top
   
PostPosted: Mon Apr 23, 2012 3:00 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
If your advanced setting allows, you can fund new industries and also fund new towns.

You could possible also re-direct your passengers and cargo to another town B to grow that. Then when town B has grown you can go back to growing your original town and now have more passengers and mail from B to send.

Also, unless you have disabled the neighbours part of "neighbours are important", then it is beneficial to grow the 5 or so closest towns in relation to the town you try to grow. That will reduce the cargo requirements of your town.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Sat Jun 09, 2012 10:53 pm 
Offline
Engineer
Engineer

Joined: Sat Jun 09, 2012 10:49 pm
Posts: 1
Fanatik wrote:
Aloha Zuu :)

As proclaimed in viewtopic.php?f=33&t=57431 i've extended your script a little bit and wanted to ask you if your interested in the changes. Some of your code still remains within so ofc i won't release it to the public without your review and permission. Anyway these are the changes i've implemented so far...

List o' changes

- Cities now show who their neighbouring cities are within the town GUI.

- Congestion now actually happens (rebalanced values to the point where "Hard" means hard and Easy means easy)

- Added lots of new Settings (and updated others with appropriate descriptions)

- Lots of Balancing for CargoGoals

- Implementing a CacheClass (Tables are great!) for reoccuring calculations all over the place

- Added Periodic Expansion of Cities even while their CargoGoals are not reached (very slow growth, but still ;P)

- Added Option to adjust the TimeSpan between each Periodic Expansion

- Added Option to have Cities benefit from Periodic Expansion more then Towns.

- Replaced integer (percentage) values for difficulties with named Settings. There are always quite a lot, but people wont tell the difference between 50 and 52 ingame anyway, so i think this is more intuitive.

- Added Option to switch between simple (Passengers/Mail) and complex cargoGoals.

- CargoGoals (except for Passengers) now have an offset within their calculation so they form a nice curve instead of a line ;P

- Added a small CargoGoal handicap for Cities without a neighbour if neighbours are enabled.

- Added a Compatiblity Mode for FIRS newGRF (as i love it!). Up to 5 different Goals in the normal Landscape (Passengers->Mail->CratesOfWarez->Food->Fuel)

- Added Translation for German

- Added an Option for changing the maximum amount of neighbours a town may have

- In lack of a better alternative introduced an ugly and primitive way to sort GSSettings into Categories


NextUp:

- Quality of Service: Have a town get a Expand()-boost if the Towns PercentageTransported Values stay above a certain value for at least X months.... for the perfectionist ;)

- Properly Save important values when the Game issues a save.

- Evolving Neighbourhood: Towns pick new neighbours as they grow in size.
Zuu wrote:
Looks good to me. I haven't been playing with the game script much since I created it. The reason why I had percetange settings and not a few labled values was that I didn't want to spend my time playing it through several times to figure out what settings to pick. Instead I opened it up for players to test and hopefully report back what they found as good settings.

Zuu wrote:
I would be happy if those of you who play with this GameScript reports back what kind of values on the two scale factors that you find good. That way I can see if I need to adjust the baseline or the recommended easy/medium/hard values.


So, I very much welcome that you have taken your time and refine the script based on your experience with it. If you look around, you'll see that I've created more AI/GS projects than that I can possible improve all of them to higher standard very quickly.



Did you ever share this? ;)


Top
   
PostPosted: Sun Aug 12, 2012 1:32 pm 
Offline
President
President
User avatar

Joined: Tue Feb 01, 2011 11:22 am
Posts: 910
Location: Beer
The towns funded in game seem not influenced by this script. :)
[15:30] <Zuu_> V453000, IIRC it should handle that event but it might not be working. You could try to save + load. Also report it in the thread and I'll tke a look at he code when possible (at a train at the moment)
Here you go.

_________________
ImageImageImage


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 208 posts ]  Go to page 1 2 3 4 511 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.