Page 9 of 12

Re: CityBuilder Release Topic

Posted: 14 Sep 2014 07:39
by Aphid
The actual problem is that this variable appears to be missing, it's from the setting that dictates 'below this size all towns grow'. It seems logical that would include cities. I've just moved the variable scope one level up the class hierarchy so City also has access to it.

That should fix the problem.

Re: CityBuilder Release Topic

Posted: 14 Sep 2014 12:01
by mw48620
Hello,
I have a noob question, my city require Rubber 0/17 | Storage: 0 - to grow, but I don't know how to get it.
The city doesn't have any factory that produce rubber and city doesn't accept rubber :(

I don't understand what to do :D

Thanks!

Re: CityBuilder Release Topic

Posted: 14 Sep 2014 14:04
by Aphid
Okay, so the first thing you should do is read the readme file included with the script. As you can read there, the script has a separate setting for each of the 32 possible cargoes in the game to determine whether/how much a town demans to be delivered 'to' it. There are also two settings for how much you have to deliver 'away from' a town.
The default settings assume you're playing on the temperate climate. You're trying to play with the 'tropical' climate so you should change the cargo requirements.

The relevant cargoes are;
00: Passengers
02: Mail
05: Goods
09: Water
10: Diamonds
11: Food

Now in order to have a pleasant game experience, you should tailor your relative cargo requirements to the relative density of industries on the map. So you should have a small amount of diamonds required (one industry type, and it's usually low production). After that comes water (only one type but more production and more common). Then food (two types, medium production), and a lot of goods (four types of industries, and oil has high production). I would recommend relative values of about 8:13:25:50. And however much passengers you want. So an example would be (per 1000 people):
150 passengers,
30 mail,
20 diamonds
32 water
65 food
130 goods

You should also set a minimum town size for passengers of at least 100 (4 houses), food at least 250 (8 houses), for mail at least 1000 (4 big houses), diamonds at at least 1200 (a bank), and for goods at least 2000 (4 offices), to prevent getting towns that don't accept these cargoes and still need it to grow. Novapolis used 1500 for goods but I feel that's still a bit too soon; you may get unlucky with low values in the 1000-2000 range.

There's some extra cargoes that can't be taken directly to the town:
01: Rubber
03: Oil
04: Fruit
06: Maize
07: Wood
08: Copper

Now suppose that you configured one of these cargoes. It seems a bit silly to do so because they're raw materials, not finished goods. If you still want to deliver these to a town, you need to construct the relevant industry for that town. So for your case, rubber, build a factory in the town.

Re: CityBuilder Release Topic

Posted: 18 Sep 2014 22:54
by Hobbyte
Hey, Seems like in the recent versions, .:CITY:. refuse to grow. Towns seem to grow fine however. I have them set to grow above MTR, and the info window says they're growing, but even after 10 years the population doesn't change.

Re: CityBuilder Release Topic

Posted: 25 Sep 2014 21:27
by Hobbyte
Update: .:CITY:. still refuse to grow, but towns grow uncontrollably whether you meet the growth requirements or not.

Re: CityBuilder Release Topic

Posted: 01 Jan 2015 23:21
by wil32
Hi... How I can write the commands? :/
I dont know!! xD

Re: CityBuilder Release Topic

Posted: 02 Jan 2015 13:32
by Brumi
What do you mean by writing commands?

Do you want to write your own gamescript or modify the CityBuilder? Or you just want to modify the text appearing on the screen?

Re: CityBuilder Release Topic

Posted: 13 Jan 2015 04:01
by spm
Image
my city need food,but not enough building to accept food,what should i need to do?and how about rubber?thx!

Re: CityBuilder Release Topic

Posted: 20 Jan 2015 20:44
by Aphid
You should look at my post in this topic from Sep. 14. 2014. It applies almost word-for-word here.

Due to the nature of the game, and me wanting you to be able to require 'specific' cargoes and not just the categories the GS designer set up to allow GS authors for towns to require, I had to circumvent part of that logic and make my own. However, there's no easy way for me to figure out what exactly each cargo is when still at the settings screen, because the script at that point isn't aware of any newGRFs. In fact it can't actually be aware of those later on either, only of certain consequences (e.g. engine stats for example) of the player using these.

So I can't actually tell what cargo #05 is, so it's simply labelled cargo #05. You could write a simple script that output each cargo type to the console using a for loop. In fact, I think that if you turn the debug setting on, my script will actually tell you what cargoes there are when it's first fired up at the initialization phase so you can see which number corresponds to what. The work's already been done for the default desert climate, see my post above.

Re: CityBuilder Release Topic

Posted: 06 Apr 2015 11:36
by Wahazar
How PTR and TTR requirements are evaluated?
Is it recommended to apply them in CityBuilder mode?

EDIT: in freebuilder mode, strange negative points value was computed:
cbbug.png
cbbug.png (5.39 KiB) Viewed 6603 times
Additionally, <invalid cargo> is requested from small towns.
Any idea of cause of such bug?

Here is GS configuration:

Code: Select all

[game_scripts]
CityBuilder = Industry_Density=63,Industry_S_Density=63,Industry_Town=100,Town_Labels=1,cargo0=150,cargo1=10,cargo10=0,cargo11=100,cargo12=10,cargo16=15,cargo17=5,cargo2=40,cargo7=20,
  cargo9=0,cargo_sigma=10,cities_setting=1,debug_level=3,decay1=6,decay10=2,decay12=5,decay16=4,decay17=1,decay2=500,decay5=20,decay7=10,gamegoal=100000,gametime=201,gametype=0,
  growascity=0,maxclaimsize=300,metro_cgg=60,metro_mod=25,mgrpct=600,min_size_tr=100,paxTR=60,size0=200,size1=15000,size11=1500,size12=20000,size16=35000,size17=60000,size2=600,
  size5=4000,size7=8000,town_regrow=130
and appropriate manpower industry grf configuration (maybe there are cargo Id issues?):

Code: Select all

4D634D69|C80506F46F922D4C9D1FE78C7A6E8AFC|manpower_ogfxindustries-2.1\manpower-ogfx-industries.grf = 
0 1 3 2 0 0 0 1 1 0 3 1 0 0 7 0 10 50 100 1000 2 0 0 1 1 1

Re: CityBuilder Release Topic

Posted: 08 Apr 2015 20:56
by Aphid
That's an interesting value, seems to be -MAX_INT (-2^63+1).

I don't currently have that newGRF, but I'd hazard a guess that you are correct; one of the requirements you put up likely does not exist

Re: CityBuilder Release Topic

Posted: 14 May 2015 17:39
by Aphid
I Should have fixed these issues. Also, It shouldn't be giving you '3' for every requirement, instead some random amount between the required and max growth amount for some random town that isn't getting the required amount.

OpenTTD 1.5.1 Crash Report Citybuilder V113

Posted: 23 Jun 2015 13:11
by Minion
Here's my capture screen for a game script crash I encountered on 23rd June 2015.



Don't know if I'm missing out on more info to pass on. Don't know if it's an error in the script or error in the new updated version of this game which is v1.5.1.
Perhaps even an error in the installation path now that I've transfered my hard disk to different sequence. I've updated this game just then using the ottd manager. Hope the attached pic's clear enough to read here.
Help required guys. Can't even run a new game. It freezes at 95% world generation and I have to keep closing the program.

Re: CityBuilder Release Topic

Posted: 23 Jun 2015 16:55
by Zuu
If the CityBuilder crash happen each time you load a particular save game, it may be useful to upload it here.

Re: CityBuilder Release Topic

Posted: 25 Jun 2015 08:06
by Aphid
You may have found a bug in my Qsort implementation that depends on the amount of stuff being sorted. I'll try sorting anywhere from 1 to 512 things and see if it fails somewhere.

Code: Select all

function QSortTest() {
	GSLog.Info("Qsort Tests");
	local indexes = [];
	local items = [];
	// Sort anywhere from 0 to 512 elements
	for(local i = 0; i < 513; ++i) {
		GSLog.Info("Qsort with '"+i+"' elements");
		indexes.append(i);
		items.append(GSBase.Rand());
		items = QSort(items, items);
		foreach(i in items) {
			GSLog.Info("i: "+i);
		}
	}
}
I ran this a few times and it came up without errors or crashes. Can you try running that on your config? (Just make an empty GS and include that & QSort.nut or add that function to QSort.nut and call it from main.nut)

Re: CityBuilder Release Topic

Posted: 26 Jun 2015 19:56
by Minion
Zuu, my saved game is broken now. Here's the screen capture of it.
Savegamebroken270615.JPG
Savegamebroken270615.JPG (1.26 MiB) Viewed 1671 times

Re: CityBuilder Release Topic

Posted: 26 Jun 2015 20:54
by Alberth
Game scripts don't mess with chunk types.

Are you sure you made the save game with a compatible openttd version (ie not trying to load a save game of a newer openttd into an older one, or trying to load a savegame from a patched openttd version (typically a patchpack) into unpatched openttd)?

Re: CityBuilder Release Topic

Posted: 01 Jul 2015 06:54
by Minion
I used the Open TTD manager to update the game and the openttd.exe is now at version 1.5.0.27217 .
Am i on the right to use the openttd manager to update then? ?(
OpenTTD1.50_Startscreen.jpg
OpenTTD1.50_Startscreen.jpg (1.41 MiB) Viewed 1668 times

Re: CityBuilder Release Topic

Posted: 01 Jul 2015 10:48
by Alberth
How you update to another version of openttd doesn't seem very relevant to me (assuming the updater doesn't do any magic, I don't know the program).

The question imho is what version of openttd did you use to create the save game.

Re: CityBuilder Release Topic

Posted: 01 Jul 2015 14:50
by planetmaker
Alberth wrote:How you update to another version of openttd doesn't seem very relevant to me (assuming the updater doesn't do any magic, I don't know the program).

The question imho is what version of openttd did you use to create the save game.
And possibly where from you got that (old) OpenTTD version (link)?.