Jump to content

Hub street layout adn what the commands mean.


Tin

Recommended Posts

i use this code for cross rurals:

 

 

            <hub_rule name="ruralCross">
		<hub_type value="rural"/>
		<width value="400, 400" />
		<height value="400, 400" />
		<path_material value="gravel" />
		<path_radius value="3" />
		<prefab_rule name="prefabs_Rural_Cross"/>
		<street_gen level="1" length_multiplier="8">
			<axiom value="[FF]+[FF]+[FF]+[FF]"/>	
		</street_gen>			
	</hub_rule>

Link to comment
Share on other sites

Thanks for sharing all this!

 

I'm trying to create some teeny tiny 'towns', that would frequently be just one intersection, like the rural hubs in older alphas. I think I've got a handle on the street generation for hubs, but what about the roads that connect hubs? How does it choose where to connect to the city roads? Will it only connect to '*'s in the rules as connection points, for example?

 

What I'd like to do is have a library of basic intersections - I, L, T, and + shapes - and then the game makes a number of hub-connecting roads based on the type of intersection it's using, or vice versa. But it kind of looks like we don't control when and where these hub-connecting roads appear. At best, I'm getting results like this, where the intersection is sometimes offset so as to make extra roads.

 

66625D6BD43C78F88B87800BDF32D3EC79C49AE3

 

Does anybody understand why the north-south road in this image is connecting to the east end of the town instead of using the north and south ends? Or am I not even looking at this correctly?

 

Here's the generator I'm using.

 

	<hub_rule name="ruralCrossroads">

		<hub_type value="town"/>
		<width value="200, 400" />
		<height value="200, 400" />
		<path_material value="gravel" />
		<path_radius value="6" />

		<prefab_rule name="crossroadsPois"/>

		<street_gen level="1" length_multiplier="6">
			<axiom value="F*F"/>

			<rule char="A" replace_with="FF"/> <!-- 	straight -->
			<rule char="B" replace_with="[-FF*]"/> <!-- T intersection to the left -->
			<rule char="C" replace_with="[+FF*]"/> <!-- T intersection to the right -->
			<rule char="D" replace_with="[-F*]F[+F*]"/> <!-- offset crossroads A -->
			<rule char="E" replace_with="[+F*]F[-F*]"/> <!-- offset crossroads B-->
			<rule char="G" replace_with="F+F*"/> <!-- turn right -->
			<rule char="H" replace_with="F-F*"/> <!-- turn left -->
			<rule char="I" replace_with="[-FF*][+FF*]"/> <!-- 4-way intersection -->
			<rule char="J" replace_with="[-F*][+F*]++"/> <!-- T intersection end -->
			<alt_commands chars="A,B,C,D,E,G,H,I,J"/>
		</street_gen>

 

Pretty sure (not positive), The main roads that join the hubs are random on how they attach so it's mostly hit or miss.

 

What I use for cross streets is :

[-FFT][-FFT][-FFT]-FF

and what n2n1 works as well.

*Don't mind the "T" in those as I use that to attach the <rule char=/> and use those to build off of as well aside from the axiom.

 

my full deal I use:

<street_gen level="20" length_multiplier="3">	<!-- street_gen= How many time the rules will get run through. length_multiplier= Each street sections length. -->

	<axiom value="[-FFT][-FFT][-FFT]-FF[+FFT][-FFT][-FFT]"/>   <!-- Main rule used for streets before using the rules -->



	<rule char="T" replace_with="[+FFF*][-FFF*][-FFF*]-FFF[+FFF*][-FFF*][-FFF*]"/>
	<rule char="I" replace_with="[-FF*][-FF*][-FF*]-FF[+FF*][-FF*][-FF*]"/>
	<rule char="N" replace_with="[FF*][-FF*][+FF*][--FF*][+FF*][-FF*][++FF*]"/> 						
	<rule char="A" replace_with="[-FFFI][-FFFI][-FFFI]-FFF[+FFFI][-FFFI][-FFFI]"/> 					
	<rule char="B" replace_with="[FFFF*][-FFFF*][+FFFF*][--FFFF*][+FFFF*][-FFFF*][++FFFF*]"/>
	<rule char="C" replace_with="[FF+FF*][-FF+FF*][+FF+FF*][--FF+FF*][+FF+FF*][-FF+FF*][++FF+FF*]"/>
	<rule char="D" replace_with="[FF-FF*][-FF-FF*][+FF-FF*][--FF-FF*][+FF-FF*][-FF-FF*][++FF-FF*]"/>
	<rule char="E" replace_with="[FFF+F*][-FFF+F*][+FFF+F*][--FFF+F*][+FFF+F*][-FFF+F*][++FFF+F*]"/>
	<rule char="G" replace_with="[FFF-F*][-FFF-F*][+FFF-F*][--FFF-F*][+FFF-F*][-FFF-F*][++FFF-F*]"/>

	<alt_commands chars="T,I,N,A,B,C,D,E,G"/>

</street_gen>

 

Builds some nice sectioned off areas and works well for smaller hubs as well as larger ones.

Link to comment
Share on other sites

So I adapted my rules to be more like n2n1's rule, and got somewhat better results. Specifically, the inter-hub roads seem to connect to the ends of my intersections more often, instead of the intersection being a shape that's just bolted on to the roads, and they are a more even mix of north-south and east-west roads, instead of most of them being diagonal. Thank you all. Updated code for anyone wanting something similar:

<hub_rule name="ruralCrossroads">

<hub_type value="rural"/>
<width value="240, 300" />
<height value="240, 300" />
<path_material value="asphalt" />
<path_radius value="6" />

<prefab_rule name="crossroadsPois"/>

<street_gen level="1" length_multiplier="4">
	<axiom value="*"/>

	<rule char="A" replace_with="FFF"/> <!-- 	straight -->
	<rule char="B" replace_with="[FF]+[FF]+[FF]"/> <!-- T intersection to the left -->
	<rule char="C" replace_with="[FF]-[FF]-[FF]"/> <!-- T intersection to the right -->
	<rule char="D" replace_with="F[-FF]F[+FF]F"/> <!-- offset crossroads A -->
	<rule char="E" replace_with="F[+FF]F[-FF]F"/> <!-- offset crossroads B-->
	<rule char="G" replace_with="[FF]+[FF]"/> <!-- turn right -->
	<rule char="H" replace_with="[FF]-[FF]"/> <!-- turn left -->
	<rule char="I" replace_with="[FF]+[FF]+[FF]+[FF]"/> <!-- 4-way intersection -->
	<rule char="J" replace_with="[FF]-[FF]++[FF]"/> <!-- T intersection end -->
	<alt_commands chars="A,B,C,D,E,G,H,I,J"/>
</street_gen>
</hub_rule>

Link to comment
Share on other sites

  • 6 months later...

I tried a world full of this:

 

<axiom value="[FFC][-FF.][+FF_][--FF ]"/>

 

Now, some towns were connected by roads are spurious places, but this town had no connecting roads:

 

Jitifeville.jpg.1b4be3c51737416c9229d133932ed6ee.jpg

 

So it seems to me that "C", or, perhaps, anything that is unknown, is simply a stop.

Link to comment
Share on other sites

I tried a world full of this:

 

<axiom value="[FFC][-FF.][+FF_][--FF ]"/>

 

Now, some towns were connected by roads are spurious places, but this town had no connecting roads:

 

[ATTACH=CONFIG]24765[/ATTACH]

 

So it seems to me that "C", or, perhaps, anything that is unknown, is simply a stop.

 

*bingo* You can also use this or any non set [char] to dead end streets or properly connect to adjoining streets so you don't get a terrain line where it ends.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...