• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

cell rules, hub rules and prefab rules don't really match up

TheSurvivior01

New member
I can't wrap my head around at which step of random world generation the prefab rules are set.

First we have cell rules

Code:
<cell_rules>
	<cell_rule name="default">
		<cave_count value="4,8"/>
		<path_material value="asphalt" />
		<path_radius value="10" />

		<hub_rule name="townSmall" prob="0.3"/>
		<hub_rule name="townLarge" prob="0.3"/>
		<hub_rule name="citySmall" prob="0.1"/>
		<hub_rule name="cityLarge" prob="0.1"/>
		<hub_rule name="rural" prob="0.3"/>

		<wilderness_rule name="wildernessDefault"/>
	</cell_rule>
Then we have hub rules

Code:
<hub_rule name="citySmall">
		<hub_type value="city"/>
		<width value="600, 800" />
		<height value="600, 800" />
		<path_material value="asphalt" />
		<path_radius value="10" />

		<prefab_rule name="default"/>

		<street_gen level="20" length_multiplier="4">
			<axiom value="[FFCT][-FFT][+FFI][--FFN][+FFT][-FFI][++FN][F-FF+FF[-T]FF+FF+FFFF-FF-FF[+I]FF[+N]"/>

			<rule char="T" replace_with="F-FF+FF[-T**]FF+FF+FFFF-FF-FF[+I**]FF-F[+N*K]"/>
			<rule char="I" replace_with="F-FF+FF[-T**]FF+FF+FFFF-FF-FF[+I**]FF-F[+N*K]"/>
			<rule char="N" replace_with="F-FF+FF[-T**]FF+FF+FFFF-FF-FF[+I**]FF-F[+N*K]"/>
			<rule char="K" replace_with="[FFCT][-FFT][+FFI][--FFN][+FFT][-FFI][++FN]"/>
			<alt_commands chars="T,I,N,K"/>
		</street_gen>
	</hub_rule>
And of course prefab rules

Code:
<prefab_rule name="default">
		<prefab rule="residentialOldGroup"/>
		<prefab rule="residentialNewGroup"/>
		<prefab rule="commercialGroup"/>
		<prefab rule="downtownGroup"/>
		<prefab rule="industrialGroup"/>
		<prefab rule="ruralGroup"/>
		<prefab rule="detailFillerGroup"/>
	</prefab_rule>
I just can't find the "switch" that makes the engine decide to create an industrial group or commercial group or downtown group etc.

Maybe every town and city creates several of those groups within its area but then I still don't see a way to influence it.

Not to mention that I have also no idea how the engine decides to build a ruralSmall and/or ruralLarge hub when there is only a single rural hub rule <hub_rule name="rural" prob="0.3"/> that applies to both.

Is there anything hardcoded outside the rwgmixer.xml that manages these things?

 
I had the same problem. Since alpha16 the mixer has a group-oriented structure. This means that all towns/Cities look the same (same prefabs) if u dont specify the content prefabs to spawn in different Biomes.

The ruralSmallHub and RuralLargeHub are kinda broken since alpha16 - so they dont work probably and destroying the whole map !!!

(not to mention the CustomRuralHub becasue this is totally broken)

If u want to have full control and add new Townships u have to completly rewrite the mixer-structure (remove the Vanilla-groups) like I did in COMPOPACK.

check out my rwgmixer.xml :

https://7daystodie.com/forums/showthread.php?28057-Compo-Pack-for-Random-Gen

here u can study how I solved the Issues with the new group-oriented mixer-structure. I simply removed it and made my own system. It was a hard work, but with my structure I have full control of the Township's content. I added some new Townships like Asiatown (a town with assorted Asian-looklike-Prefabs u will just find in this Town) or modernTown and OldTown ...

U also have to check out the prefabs xml's and define in which BIOME, TOWNSHIP and ZONE each Prefab is allowed to spawn !!!

There is more to say about world-creation and prefabspawning, but i stop here for now.

Overall its a overture of rights and rules - and also a balancing-thing to get a nice world with good variety.

btw:

We dont have control of the Zone-splitting in a Township atm (except the downtown-amount in City) !!! This is hardcoded.

i hope i could help

cheers

 
Last edited by a moderator:
Thanks a lot, that cleared up at least some of my confusion.

We dont have control of the Zone-splitting in a Township atm (except the downtown-amount in City) !!! This is hardcoded.
I was afraid so but at least I know now for sure.
I will look into your rwgmixer system, hopefully I can achive what I want.

Thanks again!

 
Back
Top