Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Dec 16, 2018 12:19 am

All times are UTC




Post new topic  Reply to topic  [ 51 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Sun Feb 24, 2013 3:02 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Balanced City Growth
A gamescript for OpenTTD

Balanced city growth is a game script which changes how cities grow in several ways outlined below. It is my goal with this script to challenge veteran players to diversify their networks across many different industries and move away from the mega-stations that process everything for the entire map. At the same time, I've implemented some features that I hope will make this journey a little less painful for newer players.

1. Cities now require cargo to be delivered each month. Which cargos are demanded depends heavily on if you're using the base industries, or if you're using an industry set such as ECS or FIRS. This script will work with any of those three, however you must set which one you're using in the settings first.

2. In addition to requiring cargo, cities can also stockpile cargo over an above the goal amount. The maximum amount is capped at ten times the required amount for that particular cargo. If nothing is supplied, the required amount will be deducted from the stockpile each month until the stockpile reaches zero.

3. Cargo does not need to be delivered directly to a town to count towards that town's requirements. Delivering cargo to any industry near a town will also count towards a town's requirements, and in fact this behavior is strongly encouraged. You can for example, deliver milk to a dairy outside of a town, and then deliver food from the dairy to the town. For that, you will get credit for both the food and the milk deliveries.

4. The first required cargo will always be passengers. Each month, the script will check to see if any passengers have been transported from a town, and will only procede with the rest of the calculations if this is true. This is intended to reduce the strain for larger maps where there would otherwise be lots of towns to calculate.

5. As a measure to improve performance on larger maps, the script will pause the game while processing the monthly calculations. The time this takes depends heavily on the number of towns with an active passenger network. Usually it will only be a fraction of a second, but on a 2048x2048 map with lots of towns and every single on of them connected to the network it could take several minutes. I recommend playing the game with build while paused allowed for all maps, as well as less towns if you're going to play on a large map.

6. The normal town GUI will not function anymore. Instead, a town's text box will be updated with the stockpile amount, the supplied amount(previous month), and the required amount for the next month. Below each town's name, you'll also see a sign indicating the number of days in between growths.

PERFORMANCE TIPS
* Enable build while paused at all times.
* On larger maps, select a lower setting for the number of towns.
* Balanced City Growth's main calculations take place on the first of each month, so it works well with the daylength patch.


---------------------------------------------------------------------------------------
Version 3 has been released on 3-3-2013 and can be downloaded from bananas.

Version 3 changes: viewtopic.php?f=65&t=64501&p=1068759#p1068759

TO-DO LIST:

* Implement a command queue to more efficiently use ticks. Primarily an issue for multiplayer maps where lots of cities are connected and the tick update is larger than 1-2.
* Implement a method to discourage players from using intra-city routes to meet the PAX requirements. I'd like to keep the PAX requirements fairly easy, but have them filled mostly from inter-city routes.
* le support de langue.
* Implement a save/load function. It is safe to save/load currently, however the script will take a few months to re-initialize after a load.
* Continue balancing cargo requirements.


Last edited by kormer on Mon Mar 04, 2013 4:04 am, edited 3 times in total.

Top
   
PostPosted: Sun Feb 24, 2013 1:55 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
This sounds like a very challenging and rewarding script, let's give it a try.

EDIT:

Your gamescript doesn't appear in the list and when I follow the link in Firefox it yields:
Code:
Error response

Error code 404.

Message: File Not Found.

Error code explanation: 404 = Nothing matches the given URI.

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
PostPosted: Sun Feb 24, 2013 2:15 pm 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Hyronymus wrote:
This sounds like a very challenging and rewarding script, let's give it a try.

EDIT:

Your gamescript doesn't appear in the list and when I follow the link in Firefox it yields:
Code:
Error response

Error code 404.

Message: File Not Found.

Error code explanation: 404 = Nothing matches the given URI.


Sorry, I forgot to mention I set the required version to a relatively recent nightly of 25001, which means it won't show up in the in-game list unless you're running that version or above. I have done some testing on earlier versions, but some of the functions used may not work properly depending on how far back you go.

You can always download it directly from the bananas website and drop it into the folder \OpenTTD\content_download\game

The bananas website the file can be found in is: http://bananas.openttd.org/en/gs/


Top
   
PostPosted: Sun Feb 24, 2013 3:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
kormer wrote:
You can always download it directly from the bananas website and drop it into the folder \OpenTTD\content_download\game

The bananas website the file can be found in is: http://bananas.openttd.org/en/gs/

Which gives me the 404 I mentioned ;).

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
PostPosted: Sun Feb 24, 2013 3:19 pm 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Hyronymus wrote:
kormer wrote:
You can always download it directly from the bananas website and drop it into the folder \OpenTTD\content_download\game

The bananas website the file can be found in is: http://bananas.openttd.org/en/gs/

Which gives me the 404 I mentioned ;).


Try this. If you're still having problems, it's probably something to do with your connection to bananas itself, in which case I probably can't help you there.

http://bananas.openttd.org/en/


Top
   
PostPosted: Sun Feb 24, 2013 3:33 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
kormer wrote:
Hyronymus wrote:
kormer wrote:
You can always download it directly from the bananas website and drop it into the folder \OpenTTD\content_download\game

The bananas website the file can be found in is: http://bananas.openttd.org/en/gs/

Which gives me the 404 I mentioned ;).


Try this. If you're still having problems, it's probably something to do with your connection to bananas itself, in which case I probably can't help you there.

http://bananas.openttd.org/en/

I'll try it. Too bad I just started a new game with Neighbours Are Important, from a small test game (I updated to r25039) it looks rather fun to use!

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
PostPosted: Sun Feb 24, 2013 8:29 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
In reply to Hyronymus (or any user of Game Scripts or AIs)
It takes some time before newly uploaded files become available for download from the bananas website. You see this if you hold the mouse cursor over the download link (the link that states # of dowloads), it will refer to a non-existent file saying "not yet available" or so. Give it some time, or download the GS via online content in the game.

For AIs and GSes I would strongly recommend against manually downloading unless you have to. If you download via the game, you will get the correct version of all dependencies, given that the uploader have correctly marked the dependencies. If some of the dependencies update after the AI or script, Bananas will still tell OpenTTD to get the older library version. While when downloading manually you will easily try to get the last version of all libraries which will be the wrong version in case any of the libraries have updated after the AI/GS.

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


Last edited by Zuu on Sun Feb 24, 2013 8:44 pm, edited 1 time in total.

Top
   
PostPosted: Sun Feb 24, 2013 8:43 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
To kormer (as GS author):
Your version 2 of Balanced City Growth import version 26 of SuperLib. However, the bananas web UI only allow specifying the currently last version of a library as dependency. Thus, I would recommend to update to version 27 of SuperLib in your import statement in main.nut and upload a new version of your GS.

The current situation is this:
  • Your bananas entry tells that your GS needs version 27 of SuperLib (given that you have selected SuperLib as dependency at all in the WebUI)
  • When a user downloads your script, it can add it to a game.
  • When a user starts the game, the script will try to import version 26 of SuperLib. If the user doesn't have exactly version 26 available, then the script will crash.

So users who have downloaded some other GS that uses SuperLib 26 will not see any problems, but new users who doesn't have v26 will get v27 when they download your GS and the script will fail to work. For the upgrade from 26 to 27 see this post: viewtopic.php?p=1054385#p1054385 (eg. there are nothing that should break your script in there)


In general there is no backward compatibility lost when updating an import to a newer version for SuperLib. If there are, I will announce that in its thread.

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


Top
   
PostPosted: Sun Feb 24, 2013 8:51 pm 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Zuu wrote:
To kormer (as GS author):
Your version 2 of Balanced City Growth import version 26 of SuperLib. However, the bananas web UI only allow specifying the currently last version of a library as dependency. Thus, I would recommend to update to version 27 of SuperLib in your import statement in main.nut and upload a new version of your GS.

The current situation is this:
  • Your bananas entry tells that your GS needs version 27 of SuperLib (given that you have selected SuperLib as dependency at all in the WebUI)
  • When a user downloads your script, it can add it to a game.
  • When a user starts the game, the script will try to import version 26 of SuperLib. If the user doesn't have exactly version 26 available, then the script will crash.

So users who have downloaded some other GS that uses SuperLib 26 will not see any problems, but new users who doesn't have v26 will get v27 when they download your GS and the script will fail to work. For the upgrade from 26 to 27 see this post: viewtopic.php?p=1054385#p1054385 (eg. there are nothing that should break your script in there)


In general there is no backward compatibility lost when updating an import to a newer version for SuperLib. If there are, I will announce that in its thread.


Thanks for this. I'll have a fix uploaded in a little bit.


Top
   
PostPosted: Mon Feb 25, 2013 12:28 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Sat Jun 25, 2005 10:44 am
Posts: 169
Location: The Netherlands
This looks very promising!

_________________
/r/OpenTTD
/r/tycoon


Top
   
PostPosted: Wed Feb 27, 2013 4:10 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
I spent way too long tonight figuring out how to convert this formula into squirrel code. The good news is I got it. You should all be excited, I still have plenty more big ideas planned for this.


Attachments:
math formula.JPG
math formula.JPG [ 22.56 KiB | Viewed 22589 times ]
Top
   
PostPosted: Wed Feb 27, 2013 7:44 am 
Offline
Engineer
Engineer

Joined: Thu Jun 02, 2005 7:28 am
Posts: 46
You can get rid of the sum, and just apply the formula

http://en.wikipedia.org/wiki/Geometric_series#Formula

(in case you did not know this)


Top
   
PostPosted: Wed Feb 27, 2013 2:22 pm 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Dwachs wrote:
You can get rid of the sum, and just apply the formula

http://en.wikipedia.org/wiki/Geometric_series#Formula

(in case you did not know this)


One thing I love about the Openttd community is how it attracts all different kinds of geeks, especially math geeks. It's been decades since I've been in a calculus classroom, but in this instance, I needed to calculate and store each of the values of X=1, X=2, X=3...up to X=sqrt(mapsize)/128, so just calculating the convergence alone wouldn't be enough if I'm reading the link right.


Top
   
PostPosted: Sat Mar 02, 2013 4:08 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 01, 2013 10:03 pm
Posts: 3
Hello! I'm trying to play with ESC industries. Can u tell me, please,
1) how can i deliver industrial goods such as coal, steal and glass to towns, do i need to build curtain industry building near towns (power station etc.)?
2) at the begining of the game towns larger then 1000 population needs food, but towns cannot receive it :(.
3) what is WDPR ?


Top
   
PostPosted: Sat Mar 02, 2013 4:34 pm 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Thor87 wrote:
Hello! I'm trying to play with ESC industries. Can u tell me, please,
1) how can i deliver industrial goods such as coal, steal and glass to towns, do i need to build curtain industry building near towns (power station etc.)?
2) at the begining of the game towns larger then 1000 population needs food, but towns cannot receive it :(.
3) what is WDPR ?



1) Deliveries to industry count towards the town's goals, so yes, finding an industry near the town that can accept those would be how to do it. I suggest playing with a very low number of towns, so the radius around each town will contain a larger number of accepting industries than usual.
2) Sorry about that, the next release should be out tomorrow night and contains a number of balancing improvements for ECS. The first few releases I only had time to playtest FIRS extensively.
3) Wood Products. That I know of, scripts do not have access to a grf's language files to give the full translated name for cargo types, instead I just get the short 4 character abbreviation. I'm considering a couple of possible fixes for this, including just ripping the language translations out of ECS and FIRS and just hardcoding them into my script, but that's clunky as clunky gets. If someone know's of a better solution, please share. In the meantime, you can check the link below for help translating the abbreviations.

http://newgrf-specs.tt-wiki.net/wiki/CargoTypes


Top
   
PostPosted: Sat Mar 02, 2013 6:11 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Thu Jul 16, 2009 10:04 am
Posts: 321
Hey !

Thank you for this Game-Script, I like a lot the way it changes the challenge. That gives a lot more sense to all the whole industrial infrastructure transportation.

I have a little question: are calculation made in the same way for town and cities ? (that means, there is no more difference between city and town growth ?)

_________________
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.


Top
   
PostPosted: Sat Mar 02, 2013 9:48 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 01, 2013 10:03 pm
Posts: 3
kormer wrote:
Thor87 wrote:
Hello! I'm trying to play with ESC industries. Can u tell me, please,
1) how can i deliver industrial goods such as coal, steal and glass to towns, do i need to build curtain industry building near towns (power station etc.)?
2) at the begining of the game towns larger then 1000 population needs food, but towns cannot receive it :(.
3) what is WDPR ?



1) Deliveries to industry count towards the town's goals, so yes, finding an industry near the town that can accept those would be how to do it. I suggest playing with a very low number of towns, so the radius around each town will contain a larger number of accepting industries than usual.
2) Sorry about that, the next release should be out tomorrow night and contains a number of balancing improvements for ECS. The first few releases I only had time to playtest FIRS extensively.
3) Wood Products. That I know of, scripts do not have access to a grf's language files to give the full translated name for cargo types, instead I just get the short 4 character abbreviation. I'm considering a couple of possible fixes for this, including just ripping the language translations out of ECS and FIRS and just hardcoding them into my script, but that's clunky as clunky gets. If someone know's of a better solution, please share. In the meantime, you can check the link below for help translating the abbreviations.

http://newgrf-specs.tt-wiki.net/wiki/CargoTypes


Thank you very much for your answers and script! Impatiently waiting for updates!


Top
   
PostPosted: Mon Mar 04, 2013 3:49 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
Thor87 wrote:
Hello! I'm trying to play with ESC industries. Can u tell me, please,
1) how can i deliver industrial goods such as coal, steal and glass to towns, do i need to build curtain industry building near towns (power station etc.)?
2) at the begining of the game towns larger then 1000 population needs food, but towns cannot receive it :(.
3) what is WDPR ?


I did a little bit more research on #2, and it appears the problem isn't with town size, but with the fact that in ECS food is demanded by special buildings that ECS will build automatically, but only after a year milestone has been reached. In FIRS you have the option of building cheap "industries" such as a hotel which will jumpstart the food demand for you, but no such option appears in ECS. As such, I've replaced the food requirement until I can get a better handle on how to get towns accepting it.


Top
   
PostPosted: Mon Mar 04, 2013 3:52 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
keoz wrote:
Hey !

Thank you for this Game-Script, I like a lot the way it changes the challenge. That gives a lot more sense to all the whole industrial infrastructure transportation.

I have a little question: are calculation made in the same way for town and cities ? (that means, there is no more difference between city and town growth ?)



Yes, there's currently no distinction made between a town and a city. I might add that back in at some point, but it seems so silly and arbitrary. If there were a way I could set all municipalities to a town at game start, and then selectively change some to towns based on players reaching certain goals, that might be interesting, but I don't see a way to do that right now.


Top
   
PostPosted: Mon Mar 04, 2013 4:00 am 
Offline
Engineer
Engineer

Joined: Sat Sep 11, 2004 5:05 pm
Posts: 39
I've just uploaded version 3. I did not get to do as much detailed playtesting other than bug hunting with this release as I would have wanted to. If you're running into any walls with growth, please let me know and maybe send a saved game. If someone can get this onto a multiplayer server with more than a few people, I'd love to join in and see how it runs there, please PM me the details.

There was one minor bug fix in this release, as well as two major changes.

Maps now have a target number of cities which fluctuates by map size. The formula for goal cities = sqrt(# of tiles in the map) / 128. Cities are grouped together into tiers according to population. For each city, the script will compare the number of cities in the same or higher tier and adjust the goal requirements up or down depending if there are less or more cities than the target amount. The intent of this feature is to encourage players to expand their networks to grow many different cities, rather than focus on one megapolis. Players who can successfully supply many more cities above the target amount will be rewarded with vastly reduced goal amounts, however passengers and mail will not be affected positively or negatively by this.

The second change is for very large cities, the goal amounts will now be shown as signs instead of within the town's text box. There is a bug with towns that are very close to the edge bottom left or right edges of the map, so try to give them at least 15-20 tiles for room. There are a couple of new features I'd like to roll out, but all of these will require more information feedback than the standard town GUI allows, which means I'd like to make more use of the signs. I would appreciate some feedback from players on if the sign spam is too annoying or if you can live with it.

Oh yes, and cargo requirements were rebalanced again, this should be a given for all releases though.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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.