Jump to content

Tile system - Share me some knowledge about it


Poutre

Recommended Posts

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.

 

Link to comment
Share on other sites

To make a tile from scratch simply make a 150 x150 area  with the tile needing to be facing south.

 

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.

 

 

Edited by stallionsden (see edit history)
Link to comment
Share on other sites

On 12/9/2021 at 8:37 PM, stallionsden said:

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

24 minutes ago, Kam R. said:

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

Link to comment
Share on other sites

1 hour ago, stallionsden said:

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:]

 

Link to comment
Share on other sites

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.

 

Edited by Laz Man (see edit history)
Link to comment
Share on other sites

On 12/12/2021 at 7:46 PM, Kam R. said:

 

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.

Link to comment
Share on other sites

1 hour ago, arramus said:

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.

Link to comment
Share on other sites

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 )

Link to comment
Share on other sites

On 12/12/2021 at 10:41 PM, Laz Man said:

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...