Page 1 of 1

action 0 general variable ID 16

Posted: 13 Sep 2005 17:12
by hovering teacup
This variable ID (cost of dynamiting an empty grass tile) causes a strange bug; if you set its property 08 to 03 then towns build almost no buildings. The same (or similar) thing happens with some other nombers like 40 if I remember well.

Posted: 13 Sep 2005 18:35
by Patchman
I think it's intentional. Towns have limited funds for their expansion, so if you make it too expensive, they won't be able to expand.

Posted: 13 Sep 2005 18:37
by DaleStan
But setting prop 08 to 03 should scale the cost *down* by a factor of 32, should it not?

Posted: 13 Sep 2005 18:46
by Patchman
Oh, hmm, yes you're right.

In that case I can't explain this behaviour and will require the appropriate tools to investigate (configs, a grf file displaying the bug, and a scenario or savegame just before the town builds a building without the grf, but doesn't with the grf).

Posted: 13 Sep 2005 19:34
by hovering teacup
here's the grf and the cfg. but i tryed with a newly created cfg and the result was no different. also the grf contains only one significative line (the action 0 in question here).

this bug is reproduceable at will---just use the scenario editor or start a new random map to see a bunch of ghost towns.

thanks

Posted: 13 Sep 2005 20:15
by DaleStan
I can confirm; highly reproducable, but not with my newgrfw.cfg; I had to remove all the other grf files first. I'm not sure which GRF file is suppressing the bug, but I can try to figure that out, if it's useful.

Posted: 14 Sep 2005 00:39
by Patchman
Very odd. TTD has the following code in the house construction action:

Code: Select all

if (!NewHouseAllowedOnBareLand)
    if (CostToClearWasZero)  // zero cost implies it was bare land
        fail_construction;
NewHouseAllowedOnBareLand is set to 1 only briefly while periodically replacing old buildings with new ones. I'm not sure I understand what this code is really supposed to do, so I don't know how to fix it.

The problem at hand, then, is that the given change sets the cost to clear an empty tile to zero, so that this can never succeed. But as I said, it's not obvious to me what the fix should be, until I understand why TTD does not normally build houses on bare (already cleared) land.

Posted: 14 Sep 2005 01:56
by krtaylor
Patchman wrote:But as I said, it's not obvious to me what the fix should be, until I understand why TTD does not normally build houses on bare (already cleared) land.
Tweak it so it does, and then watch what happens! Houses everywhere, I bet! :lol:

Posted: 14 Sep 2005 03:14
by Patchman
I did, and I couldn't detect an immediate effect.

It may perhaps only be to stop towns from building on a tile that the player has just cleared for himself. But I'm not sure if that's the only reason.

Posted: 14 Sep 2005 06:30
by Szappy
Just a random idea, but the 'buy land' symbol has a cleared tile underneath it. I never understood, why. Maybe TTD towns determine occupancy by the 'tile clear' status...
It should be easy for you to test it, just buy the land around a town, and hack it to build on cleared tiles.

Posted: 14 Sep 2005 07:09
by Csaboka
No, the "owned land" sign is different from a bare land tile, the fact that it has bare land for ground sprite doesn't mean anything internally. (Bare land is class 0, owned land is class A, so they are handled differently)