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

Tile system - Share me some knowledge about it

Poutre

New member
Hi people,

I've started my journey to make a custom district for citys.

My skills are still very limited with the level editor, and we're still in experimental so it's a bit early to think about this.

I still want to start doing some groundwork, and so i'm playing around with this tool.

It's very hard to find any information on this topic, i'm swimming around between old posts, youtube videos and dev streams to get a bigger picture of it.

There is something i'm having issues with, namely the new tile system. Any information regarding the way it works would be welcome.

I'm kinda stuck at the start as i can't understand how to spawn a POI Marker, which are those big colored boxes where POI are spawned randomly on the tiles.

Pressing K shows a menu but clicking POI marker has no effect.

When you load a vanilla tile, pressing K lets you edit a POI marker.

Does anyone know how to make a tile from scratch ? i could build starting from an existing one but  surely there's a way i'm not understanding.

As for some infos i gathered, it seems Tiles are 150x150, with roads always coming from the center, at the exact middle. 

I might edit this post if i find more crucial infos on the topic.

Thanks for any help you might have.

 
To make a tile from scratch simply make a 150 x150 area  with the tile needing to be facing south. Edit: as of a21 tile needs to face north

Roads need to be exiting and entering the tile exactly the middle area of the tiles borders.  

You have- 

Cap - 1 road in and same road to exit tile.

Corner - road in and exit is on side of tile 

Intersection -  4 way exits on each side of tile 

Straight - entry and exit directly opposite each other

T - entry in middle with coming to a t and exiting left and right of tile.

City Districts -

downtown 

commercial

industrial

residential
rural
---------------------------------
Town Districts -

commercial

industrial

residential
rural

---------------------
Country town settlement

countrytown 

Countryresidential

oldwest settlement

oldwest

Tile types - 

cap

corner

intersection

straight 

t

For the name - 

rwg_tile_(name you want)_(district you want the tile to spawn)_(type of tile)

To bring up the poi marker or part spawned look at spot you want roughly (you can move it later) press shift + enter then down bottom right press spawn marker.

Then escape and hit k

The same menu appears but for the marker you just spawned this time. Cycle thru the first row for road exit, part spawned and poi marker.

 
Last edited by a moderator:
To make a tile from scratch simply make a 150 x150 area  with the tile needing to be facing south.

(..)

For the name - 

rwg_tile_(name you want)_(district you want the tile to spawn)_(type of tile)

(..)


So I've been trying to figure the tiles/townships/districts thing out too...boatload of unclears for me here. Who knows more and can answer some questions? :]

I'm trying to set up a custom township with its own 2 districts.

It's basically supposed to form a 2x2 tile town with no trader gateway tile attached and no outskirts district.

As far as I can see most of that is set up in rwgmixer.

This is what I came up with so far, including some questions in comments:
 

<configs>
<append xpath="rwgmixer">
<world name="small">
<property class="lakeside">
<property name="few" value="1"/>
<property name="default" value="1"/>
<property name="many" value="1"/>

<property name="mintiles" value="4"/>
<property name="maxtiles" value="4"/>
</property>
</world>

<world name="medium">
<property class="lakeside">
<property name="few" value="1"/>
<property name="default" value="1"/>
<property name="many" value="1"/>

<property name="mintiles" value="4"/>
<property name="maxtiles" value="4"/>
</property>
</world>

<world name="large">
<property class="lakeside">
<property name="few" value="1"/>
<property name="default" value="1"/>
<property name="many" value="1"/>

<property name="mintiles" value="4"/>
<property name="maxtiles" value="4"/>
</property>
</world>
<!-- I Want the township always to spawn once and always have 4 tiles no matter what the player chosen settings are IS THIS DONE RIGHT?-->


<township name="lakeside">
<!-- <property name="spawn_trader" value="false"/> DON'T KNOW IF THIS NEEDS TO BE HERE OR NOT. IS THERE A WAY/PROPERTY TELLING THE GAME NOT TO USE the gateway district but a tile from the townships districts that has a road exit marker?"-->
</township>

<district name="llentrance">
<property name="district_spawn_weight" value="0.5"/> <!-- HOW DO THESE WEIGHT VALUES WORK? WHAT DOES A VALUE OF 0 MEAN?-->
<property name="district_required_township" value="lakeside"/>
<property name="district_preview_color" value="1,0,1"/>

<!-- <property name="poi_required_tags_all" value="lakesidehotel"/> POI with the tag doesn't exist yet, neither a poi placement marker in the tiles-->
</district>

<district name="lllake">
<property name="district_spawn_weight" value="1"/>
<property name="district_required_township" value="lakeside"/>
<property name="district_preview_color" value="1,0,1"/>

<!-- <property name="poi_required_tags_all" value="lakesidecabins"/> POI with the tag doesn't exist yet, neither a poi placement marker in the tiles-->
</district>

</append>
</configs>






The only thing I wasn't sure about was how the game knows what tiles to put into a district. The tile xmls have nothing indicating the district they belong into the only TAG I came across for tiles is

<property name="Tags" value="gatewaytile" />

which I assume defines the tile as one that should connect to highways.

So I thought the actual file name is what is checked just as you describe it, however the vanilla tiles only have

rwg_tile_(district)_(type)

in their names.

So for the above example I have created 2 (placeholder) tiles called

rwg_tile_llentrance_corner

rwg_tile_lllake_corner

Tile data is put in the data/prefabs/RWGTiles folder

The "llentrance" tile has a road exit marker put exactly the same way the default "gateway" tile has it. (Though that one has 2 of them does it always need to have 2 connections to the highway system?) And I added the <property name="Tags" value="gatewaytile" /> to its xml.

RESULT:

Trying to create a world goes all the way to the creating towns part (up to 100%) but then ends with a null ref red line in console.

What am I missing/ doing wrong?

Any help appreciated!

 
I am on my phone atm so can't answer fully.

The rwg_tile at the start is required and the type a tile at the end  ```cap``` etc is required the rwg_tile part tells the game this is a tile not a poi etc.

The cap tells the game where to place it in the settlement.

Where do you have these 2 tile sets placed in the prefab folder

 
Tile data is put in the data/prefabs/RWGTiles folder.

Does the connection (to highways) tile of a town HAVE to be a "cap" type tile?

I looked at the default trader gateway tile that's put on every vanilla town entrance. It has "cap" at the end of the name, seems to function like a cap onto the town's actual road grid, but visually also has the 2 road connectors for the highways.

What I'm trying, is to only have "corner" type tiles available to put together the custom township, so with a dead set amount of 4 tiles it can only ever form a 2x2 tiles square.

One of the corners should then connect to the highways.

On the naming:

I understand your description as "it needs "rwg_tile" at the beginning to understand it's a tile" and "it needs to have "(districtname)_(tile type)" at the end to understand where to put it and what puzzle piece it is"

and "inbetween I could add a "_custom name_", for example to expand the number of tile variations of existing districts and have more of one type in it.

Correct?

 
Tile data is put in the data/prefabs/RWGTiles folder.

Does the connection (to highways) tile of a town HAVE to be a "cap" type tile?

I looked at the default trader gateway tile that's put on every vanilla town entrance. It has "cap" at the end of the name, seems to function like a cap onto the town's actual road grid, but visually also has the 2 road connectors for the highways.

What I'm trying, is to only have "corner" type tiles available to put together the custom township, so with a dead set amount of 4 tiles it can only ever form a 2x2 tiles square.

One of the corners should then connect to the highways.

On the naming:

I understand your description as "it needs "rwg_tile" at the beginning to understand it's a tile" and "it needs to have "(districtname)_(tile type)" at the end to understand where to put it and what puzzle piece it is"

and "inbetween I could add a "_custom name_", for example to expand the number of tile variations of existing districts and have more of one type in it.

Correct?
a cap is placed at the end of the settlement. (gateway tile is the other end. 

from what i recall of kinyajuu convo in dev diary each tile set is required. so a cap, corner, intersection, straight and t. not 100% sure on only using one tile 4 times to make a settlement

 
a cap is placed at the end of the settlement. (gateway tile is the other end. 

from what i recall of kinyajuu convo in dev diary each tile set is required. so a cap, corner, intersection, straight and t. not 100% sure on only using one tile 4 times to make a settlement
 Thanks for replying again.

Hm, I don't get what you mean by "end of the settlement".

When I look at vanilla towns, they always seem to be a closed circuit with one exit.

The edges of the town are all types of tiles, actually rarely saw the cap type on the edge so far.

It seems like there probably won't be much possibility to utilize the tile system for specific formations as there seems to be no way of determining how they spawn or rotate, especially if we can't even try force a formation by only providing certain tile types (corners only like in my example, or straights only to get one long town etc.)

I didn't want to do this specific project as one large wilderness POI, since those always are on the gravel roads and I wanted a proper road to go to it.

But let's say I do this as wilderness POI, how large can a single wilderness POI be in A20 to still spawn in?

Regardless of this specific case, still a bunch of open questions, I hope we can get the answers to, regarding custom township setup:

Can someone please check if I set up the custom township correctly in the modlet I posted above? Just to see if that would work, given the right set of tiles are present.

How exactly are the

"district_spawn_weight" values interpreted?   I assume they determine how much of that district is spawned somehow, but how exactly?

Can I assign a custom gateway tile to a custom township and only that township? Does a gateway tile HAVE to be in the "gateway" district group?

Does a gateway tile NEED 2 road exit markers?

In the vanilla gateway tile the road exit markers are set up weird and idk why. One faces inward the other is at a 90° angle. Why? How do they work? :D

I would have expected the triangle to face outward, towards the random gen road it wants to connect to?

Is the gateway tile counted towards the number of tiles used in the settlement? (I'm thinking no, as it's its own special district type called "gateway", similar to "rural" being used for outskirts..)

Could there be townships with NO connection to a highway? (Like secret, overgrown hidden towns that are cut off the grid and you have to stumble across exploring the wilderness instead)

I'm just throwing all of these questions here for now. I might try putting them up in some of the modder/mapper discords later, but I don't want to spam text walls there :D

I really want to get into the tile and custom towns stuff, imma try something different until more of the inner workings is clear to me:]

 
I haven't done a ton of custom tile work yet but suggest a good starting point if you want to create your own settlement is to use the oldwest settlement as a template.

1) Copy > Rename all entries within the rwgmixer.xml that mention oldwest with the new name of your custom settlement.

    For Example:

Small World:
<property class="lazman">
<property name="few" value="2"/>
<property name="default" value="2"/>
<property name="many" value="3"/>

<property name="mintiles" value="2"/>
<property name="maxtiles" value="3"/>
</property>
Medium World:
<property class="lazman">
<property name="few" value="2"/>
<property name="default" value="3"/>
<property name="many" value="4"/>

<property name="mintiles" value="1"/>
<property name="maxtiles" value="2"/>
</property>
Large World:

<property class="lazman">
<property name="few" value="3"/>
<property name="default" value="4"/>
<property name="many" value="5"/>

<property name="mintiles" value="2"/>
<property name="maxtiles" value="3"/>
</property>

<township name="lazman">
<property name="spawn_trader" value="false"/>
</township>

<district name="lazman">
<property name="district_spawn_weight" value="1"/>
<property name="district_required_township" value="lazman"/>
<property name="district_preview_color" value="0.5,0.5,0.1"/>

<property name="poi_required_tags_all" value="oldwest"/>
</district>




2) Copy > Rename oldwest tile set files as a placeholder for your custom tile set.

rwg_tile_lazman_cap
rwg_tile_lazman_t

rwg_tile_lazman_intersection

rwg_tile_lazman_straight

rwg_tile_lazman_corner

3) Edit each tile the way you want it.

 
Last edited by a moderator:
RESULT:

Trying to create a world goes all the way to the creating towns part (up to 100%) but then ends with a null ref red line in console.
It seems you were able to get past the Null Ref error in the last stage of town creation. Would you mind sharing your workaround as I've applied a variety of the instructions that have been kindly shared/suggested and am also stuck at this Null Ref stage.

 
It seems you were able to get past the Null Ref error in the last stage of town creation. Would you mind sharing your workaround as I've applied a variety of the instructions that have been kindly shared/suggested and am also stuck at this Null Ref stage.
I think the null ref came from not having all tile types available to build the town. See above why I tried only having corners - It doesn't work :D

As soon as I created a whole set (T, intersection, corner, straight, cap) for the districts the error was gone.

I messed up the modlet for the rwgmixer though and went to just manually add my township to the core rwgmixer and it works for me now.

 
@Kam R. Thank you. My issue must relate to something else since all tile types are available.

Ah yes, the append. Kamooti kindly offered some advice on that in the CP to ensure it doesn't override root actions for the whole xml.

 
The only other thing I removed was my attempt to create my own gateway tile (road exit marker). I'm going with the vanilla one for now.

Maybe post your rwgmixer here and we can figure it out? Null ref should just be something the game is looking for missing somewhere...

Could be simple @%$# like typo in file names of the tiles too (Had that as well :D )

 
I haven't done a ton of custom tile work yet but suggest a good starting point if you want to create your own settlement is to use the oldwest settlement as a template.

1) Copy > Rename all entries within the rwgmixer.xml that mention oldwest with the new name of your custom settlement.

    For Example:

Small World:
<property class="lazman">
<property name="few" value="2"/>
<property name="default" value="2"/>
<property name="many" value="3"/>

<property name="mintiles" value="2"/>
<property name="maxtiles" value="3"/>
</property>
Medium World:
<property class="lazman">
<property name="few" value="2"/>
<property name="default" value="3"/>
<property name="many" value="4"/>

<property name="mintiles" value="1"/>
<property name="maxtiles" value="2"/>
</property>
Large World:

<property class="lazman">
<property name="few" value="3"/>
<property name="default" value="4"/>
<property name="many" value="5"/>

<property name="mintiles" value="2"/>
<property name="maxtiles" value="3"/>
</property>

<township name="lazman">
<property name="spawn_trader" value="false"/>
</township>

<district name="lazman">
<property name="district_spawn_weight" value="1"/>
<property name="district_required_township" value="lazman"/>
<property name="district_preview_color" value="0.5,0.5,0.1"/>

<property name="poi_required_tags_all" value="oldwest"/>
</district>




2) Copy > Rename oldwest tile set files as a placeholder for your custom tile set.

rwg_tile_lazman_cap
rwg_tile_lazman_t

rwg_tile_lazman_intersection

rwg_tile_lazman_straight

rwg_tile_lazman_corner

3) Edit each tile the way you want it.




I'll add my working sample modlet version code to that:

<configs>

<!-- first 3 appends to set up how often the town appears and how large it is under each of the vanilla settings-->
<append xpath="/rwgmixer/world[@name='small']">

<property class="newtown">
<property name="few" value="1"/>
<property name="default" value="1"/>
<property name="many" value="1"/>

<property name="mintiles" value="10"/>
<property name="maxtiles" value="12"/>
</property>
</append>

<append xpath="/rwgmixer/world[@name='medium']">

<property class="newtown">
<property name="few" value="1"/>
<property name="default" value="2"/>
<property name="many" value="2"/>

<property name="mintiles" value="10"/>
<property name="maxtiles" value="12"/>
</property>
</append>

<append xpath="/rwgmixer/world[@name='large']">

<property class="newtown">
<property name="few" value="1"/>
<property name="default" value="2"/>
<property name="many" value="3"/>

<property name="mintiles" value="10"/>
<property name="maxtiles" value="12"/>
</property>
</append>

<append xpath="/rwgmixer">
<township name="newtown">
<property name="spawn_trader" value="false"/> <!-- remove this if you want trader at town entrance-->
</township>

<district name="newdistrict1">
<property name="district_spawn_weight" value="1"/>
<property name="district_required_township" value="newtown"/> <!--connects district to township, can be several towns-->
<property name="district_preview_color" value="1,0,1"/>

<property name="poi_required_tags_all" value="industrial"/> <!-- Which POIs appear in a district. These tags are in every POIs own xml-->
</district>

<district name="newdistrict2">
<property name="district_spawn_weight" value="0.1"/>
<property name="district_required_township" value="newtown"/>
<property name="district_preview_color" value="1,0,1"/>

<property name="poi_required_tags_all" value="newpoitag"/>
</district>

</append>
</configs>






Also I recommend creating your own placeholder tiles from scratch, unless you want to copy an existing road layout.

I had some problems when i first used copied vanilla tiles because i couldn't get their markers removed properly.

 
This is a fix for b231 update, and if it doesn't resolve the NRE I was experiencing I will let out a zombie scream.

'NRE when generating 2 worlds without closing the client'


 
It seems like there probably won't be much possibility to utilize the tile system for specific formations as there seems to be no way of determining how they spawn or rotate, especially if we can't even try force a formation by only providing certain tile types (corners only like in my example, or straights only to get one long town etc.)
So there is a way, to force a tile to spawn and limit its number (globally for the world). For me this is useful, since I only want one instance of the city/village and I build it so that the formation and rotation does not matter.

As for naming convention of the files I quote @stallionsden from Discord:

as long as you have rwg_tile_district type what you add after that is upto you i would tho try to keep it to a certain size as windows (yay windows) has a path to long crap
these are fine for example: rwg_tile_sometile_straight, rwg_tile_sometile_straight_01, rwg_tile_sometile_straight3a

There is also a great, but a bit outdated guide that might be interesting in this topic:





This is what is working for me:

Code:
<configs>
    <!-- Add a new custom city based on "oldwest" -->
    <append xpath="/rwgmixer/world[@name='tiny']">
        <property class="olympic_village">
            <property name="count" value="1, 1, 1"/>
            <property name="tiles" value="4, 6"/>
        </property>
    </append>

    <append xpath="/rwgmixer/world[@name='small']">
        <property class="olympic_village">
            <property name="count" value="1, 1, 1"/>
            <property name="tiles" value="4, 6"/>
        </property>
    </append>

    <append xpath="/rwgmixer/world[@name='medium']">
        <property class="olympic_village">
            <property name="count" value="1, 1, 1"/>
            <property name="tiles" value="4, 6"/>
        </property>
    </append>

    <append xpath="/rwgmixer/world[@name='large']">
        <property class="olympic_village">
            <property name="count" value="1, 1, 1"/>
            <property name="tiles" value="4, 6"/>
        </property>
    </append>

    <!-- Define the new township -->
    <append xpath="/rwgmixer">
        <township name="olympic_village">
            <property name="spawn_trader" value="false"/>
            <property name="spawn_gateway" value="false"/>
            <property name="biomes" value="desert,forest"/>
        </township>

        <!-- Add districts associated with the olympic_village -->
		<district name="olympic_village">
			<property name="spawn_weight" value="1"/>
			<property name="required_township" value="olympic_village"/>
			<property name="preview_color" value="0.5, 0.3, 0.7"/>
		</district>
		
		<!-- Force the tiles generation worldwide (mintiles) and limit it to no duplicates (maxtiles)-->
		<streettile name="rwg_tile_olympic_village_straight">
			<property name="mintiles" value="1"/>
			<property name="maxtiles" value="1"/>
		</streettile>
		<streettile name="rwg_tile_olympic_village_corner">
			<property name="mintiles" value="1"/>
			<property name="maxtiles" value="1"/>
		</streettile>
		<streettile name="rwg_tile_olympic_village_cap">
			<property name="mintiles" value="1"/>
			<property name="maxtiles" value="1"/>
		</streettile>
    </append>
</configs>
 
Last edited by a moderator:
So there is a way, to force a tile to spawn and limit its number (globally for the world). For me this is useful, since I only want one instance of the city/village and I build it so that the formation and rotation does not matter.


You may find those limits work up until RWG has no choice but to ignore them. For instance, if you starve RWG of T tiles and it needs a T tile, then it will probably use a T tile anyways rather than try to cobble together something with intersections and corners. The vanilla settlements don't tend to limit the number of their base tiles, but instead limit the number of special tiles.

Experiment with the Western Town by changing its size and building a bunch of worlds. I think vanilla has it capped at 2 or 3 tiles and it tends to make a line with straight and cap tiles. I like to run it up to around 5 tiles and then it seems to like to make a plus sign with an intersection, some straight and some caps. (It's been a while since I tried this, so what I'm telling you is from memory.)

If you give your settlement a wrapping district, be prepared for lots of T and corner tiles.

 
You may find those limits work up until RWG has no choice but to ignore them. For instance, if you starve RWG of T tiles and it needs a T tile, then it will probably use a T tile anyways rather than try to cobble together something with intersections and corners. The vanilla settlements don't tend to limit the number of their base tiles, but instead limit the number of special tiles.

Experiment with the Western Town by changing its size and building a bunch of worlds. I think vanilla has it capped at 2 or 3 tiles and it tends to make a line with straight and cap tiles. I like to run it up to around 5 tiles and then it seems to like to make a plus sign with an intersection, some straight and some caps. (It's been a while since I tried this, so what I'm telling you is from memory.)

If you give your settlement a wrapping district, be prepared for lots of T and corner tiles.
Thank you. Giving 10-12 in most cases starts to build a grid-like city. Without having a gateway tile (havent come arount to understand using it) it always starts with a straight tile off of the street connection.

I discussed this with @stallionsden and did some tests. What he told me was this:

You give the rwg the "default" tiles like:
rwg_tile_custom_tileset_cap, rwg_tile_custom_tileset_corner, rwg_tile_custom_tileset_intersection, rwg_tile_custom_tileset_straight, rwg_tile_custom_tileset_t
 

Then you add in your additional tiles and limit its usage like this:

<streettile name="rwg_tile_custom_tileset_cap_myuniquetile">
<property name="mintiles" value="1"/>
<property name="maxtiles" value="1"/>
</streettile>




Applying <streettile> tags with min/maxtiles to the default variants will throw up errors.

This way starving the rwg can be avoided right? It seems to work in the few tests I did.

 
Last edited by a moderator:
Applying <streettile> tags with min/maxtiles to the default variants will throw up errors.

This way starving the rwg can be avoided right?


Yes, it means you can't limit the base tiles so RWG will always have an option. That's something probably only Stallionsden has encountered as the CP has a vast amount of POIs. He encounters things that TFP hasn't at the CP scale.

It is more common when working with Tiles to starve RWG of POIs. That is, you might run out of POIs that fit the available spots. If you have 10 POIs for your district of size 25x25 and your settlement picks Tiles that ultimately ask for 50 25x25 POIs to be placed you might get lots of repeated POIs depending on the minimum placement distance of those POIs, or you might get empty spots (unfilled POI markers) on your Tiles.

This is one reason why I've not made any custom districts. Even with 200 POIs in my pack, I don't have enough POIs for any one district to fill out the content, and I don't want to make a whole bunch of "filler" POIs. Pretty much only the CompoPack has had enough to do big districts. Vanilla districts like Western and maybe Industrial can't be made much bigger without getting duplicate POIs nearby in the same settlement.

I'm curious to see what you make.

 
Back
Top