A Request

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

A Request

Post by Buggi »

I'm a programmer, so I don't request many things but I must make a couple now. I think these are do-able, I've looked through the source and hopefully these things won't consume much time.

My most prominent request is to disable some sounds. If I have an area with buses I'm bombarded with engine sounds. Any more sound just compounds the problem. Some sound effects are nice, but to many and it's not only annoying, the sound become staticy.

My other requests deal with towns more directly. If no further plans are set to fix town growth, I humbly request two options. Fund new housing (builds 1-rand()%10 new houses) @ ((rand()%10) * population * $10,000) and "Expand Town" taking a very drastic expansion of a city a la the editor. This I can see as (population * $100,000), VERY expensive but if you need a city that can handle goods, this will pay off.

Fund new housing is geared toward having the town itself grow on it's own and expand is more aggressive to grow a town, thus the factor of 10 in price.

I have YET to see the size of towns that some people show on the forums, and I believe it's due to the games inability to build its own houses.

I have $2 billion and nothing to do with it :)

Thanks all!!
-A wannabe member of your group...
-Buggi
Programmer and TTD fan...
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

Well, I'm deaf so I can't comment on the sounds.

But your idea about town growth is interesting. Certainly, I'd like to see it in action.
User avatar
orudge
Administrator
Administrator
Posts: 25226
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: A Request

Post by orudge »

Buggi wrote:My most prominent request is to disable some sounds. If I have an area with buses I'm bombarded with engine sounds. Any more sound just compounds the problem. Some sound effects are nice, but to many and it's not only annoying, the sound become staticy.
Well, you could change the sound multipliers for certain sounds down to zero.... there's a table of them somewhere, you just need to find the right one. ;)
Novatlan
Engineer
Engineer
Posts: 26
Joined: 18 Feb 2005 19:53

Post by Novatlan »

It will take an amount of time, but at the moment I'm working on new ingame sounds. My plan is to replace all sounds with new (and hopyfully better) ones. If the developers like my sounds, your sound problem should be solved then. But as I said, it will take some time until I have finished my work.
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

Okay... setting aside the need to recompile the code... what can be done?

(Hey owen!!)

I am ESPECIALLY concerned about the towns. I played all day yesterday using the tactics outlined on these forums for growning towns. One even shrunk.

Now I am using a 10x10 map, but I reduced the number of towns to a practical amount. I can attach the save game and let you all stone me.

OH and one thing I noticed, "fund new buildings" doesn't fund a NEW building, it seems to convert existing houses to larger buildings, which if left unfunded will simply revert back or disappear. Pretty useless.

I actually went in and modified the original scenario a bit ago reducting the number of towns so there are about the same as a normal 8x8 map. Haven't had a chance to test it yet.

Oh... and I LIKE sandbox play :P
Attachments
ParkerandCo.zip
Please, no comments on the income :P
(999.27 KiB) Downloaded 292 times
-Buggi
Programmer and TTD fan...
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

OKAY ALL!!!

Here it is... the un-offical test map :shock:

Okay, only a very small handful of towns, I've already put the bus stops in (its a save game) and even added a sign by each town to grow displaying its starting population. I also set the starting date to 1975. I included my cfg file to make sure we get a fair test.

Now, money is NOT an issue on this map, like I said, I don't play for money, I play for the challenge of networks and such. :D That's one reason my other game (above) has $3 billion or so.

Now, I ask that those who try this do NOT use "fund new buildings."

Last thing, I built this using the windows nightly from the 20th.
Attachments
MurphyStart.zip
A town growth testbed...
(172.29 KiB) Downloaded 219 times
-Buggi
Programmer and TTD fan...
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

And the results are?
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

I posted it so other people could test as well. It's going to take many hours to get accurate results.

So join me in putting town growth to the test :)
-Buggi
Programmer and TTD fan...
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

Okay, I've played the map for 20 game years or so and have a couple observations.

First it seems that intial town growth is mainly a "boom" sort of growth.
For example, I have a town with my bus stops for 5 years, without buses. Sure it grows by a dozen or so, but nothing major. Now, I put my buses to work and the town responds quickly. Going up rapidly in the first couple years. This seems to take place because of building changes mostly.

Now after that initial boost things seem to drop a bit. During this decline the growth actually includes new houses (the building block). I've had towns go from 400 to 1300 back down to 600 in a matter of 10 years. With this sort of "growth" it is very difficult to keep goods going to that city.

Now I've combed through the code and found that the "radius" of the city is also vital to growth. And the radii isn't always increased. More analysis will be needed.

Another suspect I have deals with water. I have one city "watertown" that I initally surrounded by sunken land, and the city refused to build on this land, and even when I "break the dam" and let the water in, growth seems to be hindered. This may have something to do with the radius of the town, but I'm not sure. I finally gave in and leveled the land to the top left of the city hoping to promote growth as the town has shrunk drastically for some reason.

Yet another key item are roads. Once I start bus service I try to lay the town out to allow growth, this seems to help. Placing no roads makes the engine build roads in odd places and housing in odd places as well.

Finally pathfinding. It seems if you watch the buses in a city going between two stations long enough, a bus will go "around the block" and delay servicing. This seems to be due to bad pathfinding, as it gets "lost" or it thinks going around the block is faster than across the street.

Even after 20+ years of constant servicing, none of my cities are above 2k people. I've been waiting to see how I've seen cities in the 10,000's or even 100,000's on some screenshots. Growth must be exponential once you hit a critical number of houses; as shown by the formula:

Code: Select all

t->growth_rate = m / (t->num_houses / 50 + 1);
in [i]UpdateTownGrowRate()[/i]
Where t is the town, and m is the growth counter. The max 'm' is 210, so if a city has 10 houses then the growth rate is 210 / (10/50+1) = 175

Now my request of Building houses could be accomplished like so:
Pseudocode style :)

Code: Select all

int numHouses = 0;
int numHousesAdded = 0;
numHouses = rand()%10+1; // 1 to 10 houses

while (numHousesAdded < numHouses)
{
     while (!AddHouseToTown(Town *t))
     {
           numHousesAdded++;
     }
}

HouseAddToTown() is a procedure to search and build a house to the town, returns false if the search couldn't find a suitable place for a house. 
Now to avoid an infinite loop, the existing proceedures should be used to extend roads or build bridges and expand the radii of the city. Obviously the code above isn't complete.

My suggestion to really boost city growth is to include *all* buildings in calculations, not just houses.

Save game attached.
[/code]
Attachments
Murphy25yr.zip
growth after 25 years.
(377.37 KiB) Downloaded 234 times
-Buggi
Programmer and TTD fan...
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

After 100 years I only got one city to 8000 people. This makes no sense. How on earth are you people seeing massive populations?

Also, another request... a setting to turn off the very annoying ticker beeping noise... holy moly!!

IMHO delivering goods (or food..whatever) to a city should give the growth a MAJOR boost... :)

Oh and what's the most $$ ever seen from one delivery? So far I'm at $1.8 million for one shipment of goods (18 cars of goods).
-Buggi
Programmer and TTD fan...
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

MUHAHAHAH!!

I edited and recompiled the latest source so when you click "fund new buildings" it does the same thing as "expand town" in the scenario editor...

^_^

And I have to say... HOLY CRAP!! to the event handling in the game... crikey it's buggered.

---------------------------------------edit----------------------------
Well I looked and worked and looked and debugged my way through the code only to find out there can be ONLY 8 options for the local authority menu. The available options are based on flags in a byte. Some major overhauling will need to be done.

-------------------------------------another edit----------------------
Attached a before and after shot of the effects of "Fund new buildings"
Attachments
City After
City After
after.png (138.51 KiB) Viewed 4933 times
City Before
City Before
before.png (88.69 KiB) Viewed 4932 times
-Buggi
Programmer and TTD fan...
MartinA
Engineer
Engineer
Posts: 58
Joined: 22 Nov 2002 00:18

Post by MartinA »

Does any one know when this "fix" can be added to the latest nightly?
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

For it to be added to the nightly it has to be released as a diff patch. If that's been done it's not in this thread. Though it may be on the sf.net patch tracker.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

if this "fix" is to be added it should only be added as a cheat, since it clearly changes the gameplay...

I have no problem building enormous towns with the current code, it just means you're not doing it right.
User avatar
Buggi
Engineer
Engineer
Posts: 124
Joined: 02 Feb 2005 19:03
Location: Now in North Dakota

Post by Buggi »

Oh contrare dude. I do everything to grow towns.

The town in that screen shot actually SHRUNK after about 10 years of 5 bus stations being serviced perfectly.

That town shrunk while another, seemingly not different in the least to it grew. That's why I did the code change.

I can make it a cheat, that's actually what my plan was...
"Make Funding Buildings Expand Town"

^_^
-Buggi
Programmer and TTD fan...
User avatar
StavrosG
Traffic Manager
Traffic Manager
Posts: 202
Joined: 13 Dec 2004 21:13
Location: Rodos, Greece
Contact:

Post by StavrosG »

Buggi wrote: I can make it a cheat, that's actually what my plan was...
"Make Funding Buildings Expand Town"

^_^
That would be nice - build the ultrastation without upsetting the local authority much, and use this to bring the station in the town instantly.

:p
MartinA
Engineer
Engineer
Posts: 58
Joined: 22 Nov 2002 00:18

Post by MartinA »

Yes make it a cheat. It´s so frustating to see your towns shrink into nothing!
Post Reply

Return to “OpenTTD Development”

Who is online

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