Author Topic: Alternative cityrules for better City growth  (Read 5589 times)

0 Members and 1 Guest are viewing this topic.

Offline gfurst

Alternative cityrules for better City growth
« on: February 06, 2014, 12:33:24 AM »
Hey folks, So I've been playing around with the cityrules file, to try and get better looking and more organized cities( lets be real here, cities in simutrans are terrible).
I know this is sort of pak set specific but, it seems most paks use similar, not to say exactly same cityrule files.
So sorry if this is wrong of me to suggest or in the wrong place.

So my main aim here was to enable bigger blocks, more straighter roads, 2x2 roads were easy to do but looked very ugly and crummy ( I'll try to do them again and pictures later).
I was able to get some 3x3 blocks more or less with straight roads, and some small variations.
3x3 straight blocks I think would be easy, however I tried to add some variation by creating round-abouts in between blocks, these however rarely work, but at least give some diagonal variations.
Its kind of impossible to get exact blocks, the cityrules system is quite limited and allow for very complex hard to predict scenarios, also monument placement simply ruin any predictability, building roads all around it.

Description of the pictures:
1Somewhat performed with a very specific rules for the round about, works all right but still has lots of unpredictability, nice variations though.
2With the current set of rules creates nice blocks with good predictability, needed a helping hand on the round-about though.
3This is also nice and almost worked, but still needed a helping hand.
4This finally was all natural,  and is the perfect example on how the monuments( cathedrals) borked the whole system. But still looks nice

This still definitely needs some working, what you guys think?
Personally I will only make something simpler for myself since I tend to build cities myself.
Do you guys think this could be used a default in some pakset?

The actual cityrules.dat (also annexed)
Code: [Select]
# cityrules.tab
#
###############################################
##   C I T Y   B U I L D I N G   R U L E S   ##
###############################################
#
# ver. 0.3
# More or less done settings for avarage 3x3 blocks with some variation.
# Still needs work, takes forever to initialize map with cities.
#
# author: Gfurst

#
# relative affinities for certain building types which can lead to clustering of certain building types
#

# avoid building next to industry
res_start_score = 8
res_near_ind = -8
res_near_com = 0
res_near_res = 8

# everywhere is good, next to com best
com_start_score = 0
com_near_ind = 0
com_near_com = 8
com_near_res = 2

# next to res means expensive filters and no truck after 10 pm => avoid this ...
ind_start_score = 0
ind_near_ind = 8
ind_near_com = 2
ind_near_res = -8


#
# now the actual building rules. They can be up to 7x7.
# allowed sizes are 3x3 5x5 and 7x7!
#

#
# Symbols in rules:
# S = must not be road
# s = must be road
# n = must be bare land
# H = must not be house
# h = must be house
# T = must not be a stop
# t = must be a stop
# . = anything matches
# SPACE = next row
#
# Each row must have EXACTLY the same number of members!
#

#
## HOUSES
#


## Block corner house
# . . . . .
# . . S s .
# . S n s S
# . s s s .
# . . S . .
house_1 = ..... ..Ss. .SnsS .sss. ..S..
house_1.chance = -4


## One tile from corner house
# . . . . .
# . . . . .
# s S n S s
# s s s s s
# . . S . .
house_2 = ..... ..... .SnS. .sss. ..S..
house_2.chance = -4

## House on diagonal
# . . . . .
# . . . . .
# . . n s s
# . s s s S
# . . . . .
house_3 = ..... ..... ..nss .sssS .....
house_4 = ..... ..... ssnss Ssss. .....
house_3.chance = 0
house_4.chance = 0


#
## Block 3x3 set
#

## Straigh road with at least 2 spacing
# . . . . . . .
# . . . H . . .
# . . S H S . .
# . S S n S S .
# . . S s S . .
# . . . s . . .
# . . . . . . .
road_1 = ..H.. .SHS. SSnSS .SsS. ..s..
road_1.chance = 0


## turning after block complete
# . . . . . . .
# . . . . . . .
# . S . S S . .
# . . s n H H .
# . S s S S . .
# . S s S . . .
# . S s S . . .
road_2 = ....... ....... .S.SS.. ..snHH. .SsSS.. .SsS... .SsS...
road_3 = ....... ....... ..SS.S. .HHns.. ..SSsS. ...SsS. ...SsS.
road_2.chance = -4
road_3.chance = -4


## forking off a corner
# . . . . . . .
# . . . H . . .
# . . S H S . .
# . . S n S S S
# . . . s s s s
# . . S s S S S
# . . S s S . .
# technically same as the previous, higher chance
road_4 = ....... ...H... ..SHS.. ..SnSSS ...ssss ..SsSSS ..SsS..
road_5 = ....... ...H... ..SHS.. SSSnS.. ssss... SSSsS.. ..SsS..
road_4.chance = -4
road_5.chance = -4


## forking off a crossing
# . . . . . . .
# . . . H . . .
# . . S H S . .
# . S S n S S .
# s s s s s s s
# . S S s S S .
# . . S s S . .
# not needed, same as above

#
## Connecting roads
#

## connecting corners
# . . . . . . .
# . . . . . . .
# . S S . . . .
# s s s n . . .
# . S S s S . .
# . . S s S . .
# . . . s . . .
road_6 = ....... ....... .SS.... sssn... .SSsS.. ..SsS.. ...s...
road_6.chance = -6


## connecting multiple corners
# . . . . . . .
# . . . . . . .
# S S S . S S S
# s s s n s s s
# S S S s S S S
# . . S s S . .
# . . S s S . .
# not needed same as above


## connecting midblock
# . . . . . . .
# . . . . . . .
# . . S S S . .
# . s s n s s .
# . s S S S s .
# . s S . S s .
# . s . . . s .
road_7 = ....... ....... ..SSS.. .ssnss. .sSSSs. .sS.Ss. .s...s.
road_7.chance = -6


## connecting near crossing
# . . . . . . .
# S S S . . . .
# s s s H . . .
# S S S n S . .
# . . S s S . .
# . . S s S . .
# . . . s . . .
road_8 = ....... SSS.... sssH... SSSnS.. ..SsS.. ..SsS.. ...s...
road_9 = ....... ....SSS ...Hsss ..SnSSS ..SsS.. ..SsS.. ...s...
road_8.chance = -6
road_9.chance = -6

## diagonal connecting
# . . . . s . .
# . . . . s . .
# . . S S s S .
# . . S n H S .
# . . S s S S .
# . . . s . . .
# . . . s . . .
# in the rare case non straight roads meet
road_10 = ....s.. ....s.. ..SSsS. ..SnHS. ..SsSS. ...s... ...s...
road_11 = ..s.... ..s.... .SsSS.. .SHnS.. .SSsS.. ...s... ...s...
road_10.chance = -6
road_11.chance = -6


#
# Rounds
#


## connecting as round-about
# S S H S S . .
# S H H H S S .
# H H S s s s s
# S H s n S S .
# S S s S S . .
# . S s S . . .
# . . s . . . .
road_12 = SSHSS.. SHHHSS. HHSssss SHsnSS. SSsSS.. .SsS... ..s....
road_13 = ..SSHSS .SSHHHS ssssSHH .SSnsHS ..SSsSS ...SsS. ....s..
road_12.chance = -4
road_13.chance = -4

## continuing round-about
# S S H S S . .
# S H H H S S .
# s s S H H H H
# S s s n S S .
# S S s S S . .
# . S s S . . .
# . . s . . . .
# close to above, but higher chance
road_14 = SSHSS.. SHHHSS. ssSHHHH SssnSS. SSsSS.. .SsS... ..s....
road_15 = ..SSHSS .SSHHHS HHHHSss .SSnssS ..SSsSS ...SsS. ....s..
road_14.chance = -6
road_15.chance = -6


## completing round-about
# . . . H . . .
# . . S H S . .
# . S S H S S .
# S S s n s S S
# s s s S s s s
# S S s s s S S
# . S S s S S .
# definite chance
road_16 = ...H... ..SHS.. .SSHSS. SSsnsSS sssSsss SSsssSS .SSsSS.
road_16.chance = -7


## connecting off round-about
# . . . . . . .
# . . H H H . .
# . S S H S S .
# . S S n S S .
# S S s s s S S
# s s s S s s s
# S S s s s S S
road_17 = ....... ..HHH.. .SSHSS. .SSnSS. SSsssSS sssSsss SSsssSS
road_17.chance = -7


## Fail-safe straigh road
# . . . . .
# . . H . .
# . S n S .
# . S s S .
# . . s . .
# very low chance for fail-safe
# this is supposed to happen only when no other works
# but still may bork existing set
road_18 = ..... ..H.. .SnS. .SsS. ..s..
road_18.chance = 8


## Rounds
# These were the previous round logic
# supposed to be very specific with a step by step work
# has more chances of creating round abouts but still lots of fail

## starting round about
# S S H S S S H
# S H H H S S H
# H H S H H H H
# S H s n S S H
# S S s S S S H
# S S s S S S H
# H H s H H H H
#road_8 = SSHSSSH SHHHSSH HHSHHHH SHsnSSH SSsSSSH SSsSSSH HHsHHHH
#road_9 = HSSSHSS HSSHHHS HHHHSHH HSSnsHS HSSSsSS HSSSsSS HHHHsHH
#road_8.chance = -4
#road_9.chance = -4

## round about phase two
# S S H S S S H
# S S H S S S H
# S H H H S S H
# H H S n H H H
# S H s s S S H
# S S s S S S H
# S S s S S S H
#road_10 = SSHSSSH SSHSSSH SHHHSSH HHSnHHH SHssSSH SSsSSSH SSsSSSH
#road_11 = HSSSHSS HSSSHSS HSSHHHS HHHnSHH HSSssHS HSSSsSS HSSSsSS
#road_10.chance = -7
#road_11.chance = -7


## round about phase three
# H H H H H H H
# S S H S S S H
# S S H S S S H
# S H H n S S H
# H H S s H H H
# S H s s S S H
# S S s S S S H
#road_12 = HHHHHHH SSHSSSH SSHSSSH SHHnSSH HHSsHHH SHssSSH SSsSSSH
#road_13 = HHHHHHH HSSSHSS HSSSHSS HSSnHHS HHHsSHH HSSssHS HSSSsSS
#road_12.chance = -7
#road_13.chance = -7


## completing round about
# . H H H H H .
# S S S H S S S
# S S S H S S S
# S S s n s S S
# H H s S s H H
# S S s s s S S
# S S S s S S S
#road_14 = .HHHHH. SSSHSSS SSSHSSS SSsnsSS HHsSsHH SSsssSS SSSsSSS
#road_14.chance = -7

## forking out of round about
# S S s s s S S
# H H s S s H H
# S S s s s S S
# S S S n S S S
# S S S H S S S
# . H H H H H .
# . . . . . . .
#road_15 = SSsssSS HHsSsHH SSsssSS SSSnSSS SSSHSSS .HHHHH. .......
#road_15.chance = -4


## connecting to other blocks
# H H s S s H H
# S S s s s S S
# S S S s S S S
# S S S n S S S
# H H H H H H H
# . . . . . . .
# . . . . . . .
#road_16 = HHsSsHH SSsssSS SSSsSSS SSSnSSS HHHHHHH ....... .......
#road_16.chance = -4

## connecting round about with other blocks
# H S S s s s S
# H S S S s S S
# H S S S s S .
# H H H n s . .
# . S S S . . .
# . . . . . . .
# . . . . . . .
#road_17 = HSSsssS HSSSsSS HSSSsS. HHHns.. .SSS... ....... .......
#road_18 = SsssSSH SSsSSSH .SsSSSH ..snHHH ...SSS. ....... .......
#road_17.chance = -4
#road_18.chance = -4


## connecting to other blocks
# S S s s s S S
# S S S s S S S
# . S S s S S .
# . H H n H H .
# . S S H S S .
# . . S H S . .
# . . . . . . .


#
### End of file
#

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15819
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Alternative cityrules for better City growth
« Reply #1 on: February 06, 2014, 01:14:41 AM »
This is very interesting. Had you intended to create a grid system? Whilst grid systems are common in some parts of the world, such as the US, in the UK, a more haphazard layout is common - this is harder to model with the city rules, of course.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline gfurst

Re: Alternative cityrules for better City growth
« Reply #2 on: February 06, 2014, 01:31:18 AM »
Hey James, from a transport perspective its always good to have more or less organized cities.  At the very least, most of the streets have continuation, or some kind of distorted grid.
That's why I was attempting to create some sort of variation, like the round-square between blocks, or small diagonals connecting, just to break the uniformity.
The current city building system is really limited, you can't get blocks bigger than 3( 4x2 for example),. And very complicated to ensure blocks in such format requiring lots of rules.
I want to suggest a new type of city building, a revamp of the current system where instead of building individual road tiles, it would build entire blocks at once, this would also work well with buildings, allowing city buildings bigger than 1x1 and even fitting monuments better.
Where should I suggest this?

"and as always, thanks for watching"

Offline Sarlock

Re: Alternative cityrules for better City growth
« Reply #3 on: February 06, 2014, 02:51:49 AM »
Everyone has their preference :)  I like the haphazard roads, it has a more "organic" feel to me and presents more of a challenge when I want to bulldoze a right of way in to the city centre to put in a railroad (or a canal!).

Your experimenting with the cityrules.tab file is great, it shows how customizable the game is in many aspects.  While not a pure grid, you've come much closer with your configuration.  A pure grid might look a bit too artificial.  Variable terrain heights will also impact the city's ability to build in a grid format.
Current projects: Pak128 Trees, blender graphics

Offline gfurst

Re: Alternative cityrules for better City growth
« Reply #4 on: February 06, 2014, 03:03:20 AM »
Hey Sarlock, I understand. Straight up blocks are indeed boring.
When I play I try to make super organized streets, however I tend to vary between city formats, each one with a layout. Its like I have OCD for cities  :P

I've organized a lot of stuff and made some adjustments, its more or less working great, all its missing is some rules to connect some unexpected behavior.
The first pic was almost entirely natural, the second had only the intial layout and YEAH, the round about to the left was formed naturally.

Offline ӔO

  • Devotee
  • *
  • Posts: 2345
  • Total likes: 2
  • Helpful: 66
  • Hopefully helpful
  • Languages: en, jp
Re: Alternative cityrules for better City growth
« Reply #5 on: February 06, 2014, 03:13:36 AM »
3x3 grid should work better with 2x1 buildings, no?
the 2x1 building code is quite new, so there is yet to be a pak to demonstrate.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4856
  • Total likes: 200
  • Helpful: 108
  • Languages: EN, NO
Re: Alternative cityrules for better City growth
« Reply #6 on: February 06, 2014, 05:44:59 AM »
Everyone has their preference :)  I like the haphazard roads, it has a more "organic" feel to me and presents more of a challenge when I want to bulldoze a right of way in to the city centre to put in a railroad (or a canal!).

My biggest problem with Simutrans' random streets is that there often is 3-way junction after 3-way junction, and possibly a 3-way junction after that again, rather than 4-way junctions. Two 3-way junctions right after each other seems to cause more congestion than a single 4-way junction.

Offline kierongreen

Re: Alternative cityrules for better City growth
« Reply #7 on: February 06, 2014, 08:21:53 AM »
In real life having two 3 way junctions in a row tends to cause congestion as well, and does happen so I think this is quite realistic!

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4856
  • Total likes: 200
  • Helpful: 108
  • Languages: EN, NO
Re: Alternative cityrules for better City growth
« Reply #8 on: February 06, 2014, 04:30:47 PM »
In real life having two 3 way junctions in a row tends to cause congestion as well, and does happen so I think this is quite realistic!

My local government doesn't understand that, and decided to add another junction to an already congested road (the only way running through the city north-south). The good news is that now there's hardly any place left to add more junctions.

Offline gfurst

Re: Alternative cityrules for better City growth
« Reply #9 on: February 06, 2014, 08:06:20 PM »
LoLs, true, sometimes city planning are stupid, other times they work beautifully.
But seriously, sometimes simutrans cities look so ugly like slums, or "favelas" believe me, I'm brazillian...
For example this little piece here:

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15819
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Alternative cityrules for better City growth
« Reply #10 on: February 06, 2014, 09:31:02 PM »
Hmm - and like most towns in the UK, too...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4856
  • Total likes: 200
  • Helpful: 108
  • Languages: EN, NO
Re: Alternative cityrules for better City growth
« Reply #11 on: February 07, 2014, 05:42:56 AM »
It should be noted that it is the minor roads that look like cooked spaghetti. Simutrans only has one type of road, which probably corresponds to the major/medium roads. A visual block in Simutrans doesn't necessarily represent a real-life city block. I've never seen bus stops along a line spaced only four-five average sized buildings apart, but that's what you have to do in Simutrans to cover everything with the default catchment area size.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3952
  • Total likes: 145
  • Helpful: 71
  • Lost In Stupid Parenthesis
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Alternative cityrules for better City growth
« Reply #12 on: February 07, 2014, 05:27:57 PM »
LoLs, true, sometimes city planning are stupid, other times they work beautifully.
Please, don't confuse bad city planning with lack of city planning.  ;)

Also, just because a city structure doesn't look like a grid it doesn't mean that the city has a bad design or shape ("design" means it was planned beforehand). I'm rather for organic design than a Greek-rectangular plan. I think grid-like cities tend to be monotonous and confusing, have a bad traffic hierarchy and bad interface between natural topography and urban infrastructure.

Here in Brazil we have a good example of non-grid-like but rather organic design: Águas de São Pedro

On the other hand, I consider Palmas one of the cities with the most atrocious urban design, mostly for being land-wasteful and human- and nature-unfriendly.



Hmm - and like most towns in the UK, too...
The main reasons for the street plan shown in the gfurst's snapshot to look like broken spaghetti are the topography and non-formal land occupation: satellite image.

Offline gfurst

Re: Alternative cityrules for better City growth
« Reply #13 on: February 13, 2014, 06:39:06 PM »
Also, just because a city structure doesn't look like a grid it doesn't mean that the city has a bad design or shape ("design" means it was planned beforehand). I'm rather for organic design than a Greek-rectangular plan. I think grid-like cities tend to be monotonous and confusing, have a bad traffic hierarchy and bad interface between natural topography and urban infrastructure.
Hey Igor, sure good design doesn't mean rectangular grid.
I've never been to Palmas but that looks really well designed. It might look unfriendly, but will really be well organized when the city grows, it also reminds me a bit of Brasilia.
One example of good design is in Belo Horizonte, around Praça Raul Soares, a round road which forks into eight major avenues, the city has a grid like system but with a 45° degree to the major avenue. Looks really good but has an amazing complicated traffic.
Still its a good example of not all grid, planned city. Unlike the really ugly simutrans streets.