advanced town handling

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

gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Shorty wrote:clik-drag functionality on buy land would be pretty cool.
lol no, not in multiplayer games. I will not implement that.
Shorty
Engineer
Engineer
Posts: 114
Joined: 18 Jul 2006 15:43

Post by Shorty »

ahh! i remember now. i found a couple of related bugs - bridges and tunnels have different costs depending on their starting point.
"And if i close my mind in fear, Please pry it open
And if my face becomes sincere, beware!
And if i start to come undone, Stitch me together
And if you see me strut, Remind me of what left this outlaw torn..."
-Metallica Lyrics
Electric Rails for all Tilesets
~A Talented Fool~
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Shorty wrote:ahh! i remember now. i found a couple of related bugs - bridges and tunnels have different costs depending on their starting point.
:shock: i'll look for that.
Shorty
Engineer
Engineer
Posts: 114
Joined: 18 Jul 2006 15:43

Post by Shorty »

retested it, the bridges issue no longer seems to be there.

tunnels, though, the cost is calculated from their placement point.
"And if i close my mind in fear, Please pry it open
And if my face becomes sincere, beware!
And if i start to come undone, Stitch me together
And if you see me strut, Remind me of what left this outlaw torn..."
-Metallica Lyrics
Electric Rails for all Tilesets
~A Talented Fool~
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

lol?

Did you switch the versions or what? if you have used the same version the bug is still there. I also noticed that there is something wrong with the calculation. I'll look for it, so give me time to do that. Or do it yourself and submit a bugfix :)

edit:
i found something in the code that i have commented out:

Code: Select all

//if(population <= 10) population = 100000; //to prevent wipe out towns try to increase land price extrem high
If the town population is less then or equal 10 the landprice gets extrem high, like the town hast a population of 100000.

Should i uncomment that line, to enable that feature? Maybe set the 10 to 100
Shorty
Engineer
Engineer
Posts: 114
Joined: 18 Jul 2006 15:43

Post by Shorty »

towns below 100 pop are quite frequent. you can even have population 10, if it has nothing but a church, still perfectly legit. id hate to be unable to grow a small town because it acted like a sprawling metropolis.

as to the bridge bug, i think i imagined it, because the slightest change in town population throws the cost out. i imagine there is a bug, though, if you build a bridge across the border of proximity between a large town and a small. might i suggest redoing the way the calculation works, so that it looks not at teh nearest city, but rather at teh city which will raise land value the highest? for example, if you have two towns 10 squares apart, one large one tiny, building proximate to the tiny town will cost relitively little compared to building next to the big one, but both will be very nearby.
"And if i close my mind in fear, Please pry it open
And if my face becomes sincere, beware!
And if i start to come undone, Stitch me together
And if you see me strut, Remind me of what left this outlaw torn..."
-Metallica Lyrics
Electric Rails for all Tilesets
~A Talented Fool~
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

The idea of that code, iirc, is to try to prevent (or make it harder) to destroy a town entirely because its in the way of the new mainline. :)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Shorty
Engineer
Engineer
Posts: 114
Joined: 18 Jul 2006 15:43

Post by Shorty »

tunnels are your friend, in that case. and if you want to keep town reputation while excavating their land, just have a subsidiary do it :)

i never bulldoze buildings unless its very advantaegous to do so, ie, the bus station i build there will catch a full 7 more houses than if i build it on the road next door.

perhaps scale the cost of construction compared to how many buildigns in that town you have demolished? make it so that land under bulldozed town houses costs 10x more to build on?
"And if i close my mind in fear, Please pry it open
And if my face becomes sincere, beware!
And if i start to come undone, Stitch me together
And if you see me strut, Remind me of what left this outlaw torn..."
-Metallica Lyrics
Electric Rails for all Tilesets
~A Talented Fool~
Shorty
Engineer
Engineer
Posts: 114
Joined: 18 Jul 2006 15:43

Post by Shorty »

another little thing; the town handling doesnt affect the cost of building canals.
"And if i close my mind in fear, Please pry it open
And if my face becomes sincere, beware!
And if i start to come undone, Stitch me together
And if you see me strut, Remind me of what left this outlaw torn..."
-Metallica Lyrics
Electric Rails for all Tilesets
~A Talented Fool~
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Shorty wrote:ahh! i remember now. i found a couple of related bugs - bridges and tunnels have different costs depending on their starting point.
OK that is a bug in trunk too.
If i build a bridge or a tunnel when i have a demolished starting tile, while the end tile is not demolished, the whole tunnel price is less then i have a non demolished tile and a demolished endtile.

Caused by adding the price for demolishing the starting tile to the cost variable, and then do bitshifting with it.

Code: Select all

ret = DoCommand(start_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) return ret;
cost = _price.build_tunnel + ret
...
cost += _price.build_tunnel;
cost += cost >> 3
see attached pictures:
Attachments
pic2.png
pic2.png (73.91 KiB) Viewed 2317 times
pic1.png
pic1.png (72.22 KiB) Viewed 2317 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 2 guests