The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended future development discussion => Topic started by: Isaac Eiland-Hall on September 21, 2016, 03:26:21 AM

Title: Discussion on city mechanics
Post by: Isaac Eiland-Hall on September 21, 2016, 03:26:21 AM
mod note: splitted from the thread about swedish signals.
http://forum.simutrans.com/index.php?topic=14546.msg154655#msg154655 (http://forum.simutrans.com/index.php?topic=14546.msg154655#msg154655)
QuoteIncidentally, and slightly off-topic, a question to Isaac - you write that you would like Simutrans to have more "SimCity features"; can you elaborate? I ask because one of the planned major projects for Experimental is improving the town growth code, and I am considering options  to allow players to build city buildings much like real railway companies did in the 19th and early 20th centuries to stimulate demand for their own services, as well as earning rental income (based on demand, in turn based on transportation) from city buildings bought using the existing mechanism, so that transport networks can in part be funded by property rentals, as the privately run railways in Japan are. This may well be a few years off unless I can get some more developers on board, but I should be interested in your views all the same in light of your comment above.


"More SimCity features" is such a vague and wide-open thing. I have ideas from simple to complex; I'm surely not the only one with a ton of ideas. hehe. But some ideas I've had:

- On a more simple scale: Some sort of ability to protect road tiles in a city. Probably something only public_service could do. Having to protect a freeway using fencing means a minimum of a four-tile-wide freeway in the city, which is huge. Probably a tool like the bulldozer - or rather, dual tools, to mark or unmark tiles. Perhaps it could be justified as marking the tiles as state-maintained instead of city-maintained. Such road tiles would not count for city-building, either. They'd act like rails in that no houses would grow beside them.

- On a moderately complex scale: public_service could perhaps be more directly in charge of city growth, to the point of laying out zones for cities to grow. This could be optional if zoning tiles just created high demand - like you can tweak the scores so roads/rails will try to go around hills instead of up/down slopes, or tweak those scores for bridges; similarly, the map creator could perhaps determine how much weight to apply for a city to choose a zoned tile vs. unzoned tile when it wants to expand/upgrade. More complexity might happen if zoning could be changed - it would cost more to build a zone that allowed a higher density of building. So zoning would have to be, like in SimCity, a separate layer from the buildings. They'd not only be to designate empty land for purposes, but also as the city made money and could support higher densities, have to be upgraded for the higher densities to be built.

- It might be that cities must have power connected to them or they are very limited in growth. As in SC4k, power from a plant would have to be connected using powerlines; perhaps in this case a transformer built next to a tile in the city limits that had a building on it. That would represent bringing power to the entire city. Cities should have some sort of power usage dependent on size; larger cities need more power. Public_service should therefore be able to build power plants. The main conflict here is that public_service can't build more coal mines, for example; so I'm not sure how these power plants should be supplied. One possibility might be that a full power plant chain is built when a new powerplant is added.

I've actually got limited time. I'll try to see if I can find older discussions that might have other ideas upon which to draw or be inspired by :)
Title: Re: Discussion on city mechanics
Post by: jamespetts on September 21, 2016, 10:53:14 AM
Should we split this discussion, do you think? It may be better not to hijack the discussion about Swedish signals. I will defer to you on this, but reply in the meantime in the expectation that this may well be split from the Swedish signals thread.

I will number the replies to the feature suggestions.

1. Protecting roads: This may well be quite straightforward to implement. It would make sense, would it not, for private roads also to be able to have this designation (which could be set by the player(s) owning the roads), too, as player companies often want to be able to do this?

2. Zoning: This is definitely more complex. I think that one would have to be very clear about exactly what one is simulating with this feature: actual zoning would occur in cities with modern planning laws which would forbid construction except in zones, whereas in older times, no such restrictions existed. There would have to be a way of simulating which cities had these restrictions and which do not, perhaps by a toggle for each city. One would then have to think about how that would fit in with player buildings: ought players be able to put, e.g., a railway station in a residential area? An airport? The complexities of deciding how edge cases work would potentially be very great in this situation. Also, this would not be very useful on very large multi-player games, where it would be too difficult to maintain, and in which organic growth is more useful. For those reasons, this is not something that I am likely to add to Experimental in the near future, but I will not entirely rule it out, as it is difficult to predict where future development might take one, and there is also, of course, the prospect, albeit theoretical, of other developers taking an interest in working on this feature.

3. Electricity: Even in the current versions of Experimental, and a number of previous versions, being connected to electricity affects city growth after electricity starts to become important, and electricity can be supplied to cities more or less in the way that you suggest. This effect on growth is similar to the way in which goods, mail and passenger transport affects growth, and is actually based on code left over from Standard where it was evidently planned to do the same thing and the plan abandoned as no mechanism for supplying cities with electricity was ever implemented there. I plan in any event, when I get to rewriting city growth, to make the effect on growth where electricity is not present in modern times much more significant.
Title: Re: Discussion on city mechanics
Post by: Vladki on September 21, 2016, 06:12:25 PM
For protecting roads - I think there was somewhere a discussion about making a new special type of wayobject - similar to catenary - that will protect the road from city rebuilding it. And the graphics would usually display an anti-noise wall...
Title: Re: Discussion on city mechanics
Post by: Junna on September 21, 2016, 06:30:06 PM
Quote from: Vladki on September 21, 2016, 06:12:25 PM
For protecting roads - I think there was somewhere a discussion about making a new special type of wayobject - similar to catenary - that will protect the road from city rebuilding it. And the graphics would usually display an anti-noise wall...

There was. This was worked on some by the user Philippe, but he disappeared, and nothing more was made of the feature as yet.
Title: Re: Discussion on city mechanics
Post by: Ves on September 21, 2016, 06:40:20 PM
Regarding the zoning feature, would it not be possible use the land value? In reality (and i guess also in simutrans Ex) different segments of society would get attracted to different "land values". Meaning that residents wants a high value as possible, and industries as low as possible. To restrict players from building a train station in "high value areas" one could prohibit players to build on tiles above a certain value, or at least make it quite more expensive (as to reflect you have to pay the value decrease for the residents estates)
Title: Re: Discussion on city mechanics
Post by: Junna on September 22, 2016, 12:21:26 PM
Quote from: Ves on September 21, 2016, 06:40:20 PM
Regarding the zoning feature, would it not be possible use the land value? In reality (and i guess also in simutrans Ex) different segments of society would get attracted to different "land values". Meaning that residents wants a high value as possible, and industries as low as possible. To restrict players from building a train station in "high value areas" one could prohibit players to build on tiles above a certain value, or at least make it quite more expensive (as to reflect you have to pay the value decrease for the residents estates)

The transport connectivity of an area would surely be a driving factor in the high value in the first place, would it not? The cost of compensation for compulsory purchase would no doubt be higher, indeed; I assume however, that this was always part of the intention with the land value mechanic, that demolishing buildings with high land value would be more costly.

(As an historical aside, a large part of the Kokutetsu debt was accumulated in a programme of quadrupling and giving dedicated tracks to commuter services in the large Japanese metropolitan areas. The cost of land acquisitions in the 1970's as land values were exploding made it cost almost as much as the construction of the new high speed lines.)
Title: Re: Discussion on city mechanics
Post by: jamespetts on September 28, 2016, 12:35:14 PM
On the question of zoning, one thought that springs to mind that would be comparatively straightforward to implement at some stage (although I am not suggesting that this is likely to be done any time soon without significantly more in the way of developers) is the idea of tiles having, optionally, planning restrictions that could be imposed by the public authoirty. A tile might have a maximum density requirement, and/or a restriction allowing only commercial/residential/industrial buildings to be built on it. The town growth mechanism would work normally, save that buildings that do not conform to the planning restrictions would not be built on the tiles in question.

This is part of an idea to simulate town growth in layers: one layer simulating desirability and building occupancy (simulating the activities of the users of buildings), another layer dealing with where new buildings are built or buildings are upgraded (simulating the activities of property developers), and - possibly - a further layer simulating planning control in the way described. Each of the layers would function independently so that, for example, the player could build buildings, but they would only attract tenants in so far as they are desirable (and there are enough people who want to live there), and the rent would be based on the desirability. The building maintenance and construction costs, meanwhile, would be fixed.
Title: Re: Discussion on city mechanics
Post by: tubanonymous on October 25, 2016, 10:24:44 PM
Speaking of SimCity, one feature I thought was nice was terraforming multiple tiles at once. I can see how this contradicts a conservative style of gameplay, but it would be a great convenience when creating maps

I think the only other unmentioned features of simcity worth extracting are the public buildings concept. For instance, a town having a water waste treatment facility could stimulate city growth. In fact, sewer systems in general could operate on a similar basis to electricity. You could have some sort of "industry" that pumps water. Perhaps a desolation plant or similar. A fire department or a hospital would be more complicated. Perhaps they could work as tourist attractions, but have an unusual impact on city growth?

One other thought I had floating in my head...would it be possible to assign the same characteristics of signal boxes to power transformers, and then build smaller substations similar to signals next to them? Consider this: in real life, energy companies must "balance out" power across their grid to prevent fuses at substations or the power plant switchyard from blowing. In simutrans, for instance, factories could use most of their energy at a certain time interval--cities at another. A substation could control small transformers which would have timers similar to signals. This would also mean that in simutrans, you have to "step down" the power from high voltage lines.

A more realistic proposal would be to have different voltages of power lines, available on the timeline where appropriate
Title: Re: Discussion on city mechanics
Post by: jamespetts on October 26, 2016, 01:52:55 AM
Those are some interesting ideas, but they do digress somewhat from a transport focussed simulation. Terraforming multiple tiles at once is probably useful, though.
Title: Re: Discussion on city mechanics
Post by: Vladki on October 26, 2016, 06:50:21 AM
IIRC openttd had two modes: map creator and the game itself. There was a special tool for multi tile terraform in map mode. Map creator mode is replaced by switching to public player in simutrans. However you can level multiple tiles by dragging the terraform up or down tool. I would add to that a tool that when clicked would not do anything, but when dragged would level other tiles to the level where started the drag.

I think adding a city-growth-boost option to curiosities might be not too complicated. It would also provide freedom to pakset makers. However using it in game would require switching to public player, allowing other players to build these, or some improved algorithm for curiosity builder.
Title: Re: Discussion on city mechanics
Post by: tubanonymous on October 26, 2016, 10:23:23 PM
The public player has sort of always been a question mark, hasn't it? But I think leaning on its functionality could be a good way to improve city mechanics. Has the simutrans community mostly decided that despite being in the red nearly always, the public player performs its function just fine?

I'd love to play with the terraforming features you described.
Title: Re: Discussion on city mechanics
Post by: jamespetts on October 27, 2016, 12:13:19 AM
I don't think that there is unanimity about the public player: its function is a little confused, but I think that there needs to be more focus on the core mechanics before considering this in detail. However, allowing terraforming by the public player or equivalent before the start of the game proper is a good idea in principle, although quite how to implement it is another matter.
Title: Re: Discussion on city mechanics
Post by: AP on November 13, 2016, 09:19:38 AM
It's worth noting that UK planning law doesn't operate on the basis of 'zoning'. That's more seen in the USA.

For realism if suggest some consideration be given to stopping cities developing on a square grid block model.  Very few pre c20th European cities do that, unless they had deliberate re-planning.
Title: Re: Discussion on city mechanics
Post by: jamespetts on November 13, 2016, 11:24:36 AM
Quote from: AP on November 13, 2016, 09:19:38 AM
It's worth noting that UK planning law doesn't operate on the basis of 'zoning'. That's more seen in the USA.

The trouble is that the way that the way that the planning system actually works in the UK (based on having to obtain the state's permission to develop land, which permission is granted or refused on discretion, based on a complex amalgam of often changing policies) would be fantastically difficult to implement in the code.

QuoteFor realism if suggest some consideration be given to stopping cities developing on a square grid block model.  Very few pre c20th European cities do that, unless they had deliberate re-planning.

The trouble is that this is very difficult to achieve mathematically with only orthogonal roads. You can even now (and in Standard, too) edit cityrules.tab to affect the shape in which cities grow - you might want to have a go at doing that to see whether you can get anything less grid like out of it.
Title: Re: Discussion on city mechanics
Post by: AP on November 13, 2016, 05:04:42 PM
I don't have any coding knowledge, but my field of work and study means I know a good amount about city forms and urban settlement. If someone does tackle the code, they might want to consider some of the below.

Happy to discuss more if someone does take this topic up.
Title: Re: Discussion on city mechanics
Post by: jamespetts on November 13, 2016, 05:44:38 PM
There are a number of different issues here:

(1) town placement;
(2) town shape; and
(3) local town growth.

There are also subsidiary issues, such as city walls, which would require an entire new system of city wall simulation, no longer treating city walls as attractions (i.e. ruined fragments of city walls as are left in many places).

As to (1), there is already code for cities to prefer settling at lower altitude and near water (i.e. rivers or the sea). No. (2) is what I hope to work on eventually, but there are some economic balance things that will have to be done first, and those are likely to take a long time unless I get some assistance with coding. This should have the effect that a station can, in the right circumstances, move the centre of town, etc..

As to (3), that is a very complex subject (and will need to be considered alongside allowing city buildings to be more than 1x1 tiles - I have already dealt with about half, or perhaps more, of the things that formerly prevented this, but not the part of the code that actually places buildings, which is likely to be extremely difficult and complex). If any coders would like to work on a more realistic simulation of this, that would be most welcome.
Title: Re: Discussion on city mechanics
Post by: tubanonymous on November 15, 2016, 12:53:54 AM
Speaking of placement of buildings, I've noticed this. If you have a town with a population of 0, and build a 2+ track station adjacent to a city building, buildings will not spawn on the opposite side of the tracks nor will the city purchase that land. Am I being thick?
Title: Re: Discussion on city mechanics
Post by: jamespetts on November 15, 2016, 01:16:41 AM
This is an issue with automatic bridge building, I think. I thought that I had fixed this in a recent commit - are you using the latest devel-new-2 builds or the old 11.35 release build?