PC Discussing custom tiles for making rivers

Riamus

Well-known member
Bringing this discussion over from the 1.x Dev Diary. 

@zztong

I'm on my phone, so not going to try and copy over the previous discussion.  I'll just respond to what you asked about. 

There were two options I suggested were possible currently with both RWG and Teragon.  First is a "town" that is nothing but tiles with terrain and rivers.  That "district" would be the only one in the town.  It could make for a random river.  Just make the rivers connect on the same edges that you normally connect roads.  The rivers are then basically the roads.  You could even make it similar to Venice if you wanted and still include POI without roads.  The downside is a lot of crossing rivers that may look odd, but if you keep the town size smaller, it could work.  Might need to try different seeds, though.  To be clear, this does not allow for rivers that cross the map since towns don't cross the map.  It would be limited to normal town generation but instead of roads, you have rivers and POI are optional.

The second option is to include rivers on regular tiles that also have roads and POI.  This would take more effort to get to work, but if you plan it out, it should be possible. 

Basically, you take one side of the road and place the river there.  The river connects on the same sides as the roads, so will always connect.  Rivers end at caps and gateways (you would need custom gateways).  The main issue here is that you will have rivers everywhere in town, which really wouldn't look great.  It would look more like ditches at the side of roads instead.  It isn't ideal by any means.  That is why I said it wouldn't work as well as if there was a way to tell RWG (or Teragon) to only connect to specific tiles.

 
Last edited by a moderator:
To add on to this, now that I'm home...

The ideal situation would be for RWG or Teragon (preferably both) to have the ability to mark tiles that are allowed to connect to one another.  This needs to be used carefully to prevent situations where a town cannot be created, of course.  I've mentioned this in the past with a suggestion in Pimp Dreams as well.  Basically, you set it so that a tile that has a river on it can only connect to another tile that has a river.  You'd need a full set of tiles for each district that would be used in the town type(s) that you want to include the river for it to work properly.  Then you would make it so a river can only connect to a tile that has a river and not to other tiles without rivers.  This prevents rivers ending abruptly and can help to limit rivers crossing all over the place in a larger town.

This same method would allow for other kinds of connection limitations, such as boulevards, train tracks, raised/elevated roads, subways or sewers, etc.  You'd use a full set of tiles so that they can properly connect in any randomly generated town, and in most cases you will probably also need a special transition tile that would transition from a normal tile that we currently have for towns and one that uses one of these other types of tiles.  For example, you don't want a regular road connecting to a boulevard without something that transitions between the two.  So you'd have a transition tile that would go between those two tile types.

It would probably be necessary to have multiple transition tiles that work with different tile types (corner, straight, etc.).  And you may need a variety of transition tiles in case you wanted to use multiple "road" styles.  For example, you might want to connect a 2-lane road to a 4-lane road or to a boulevard or to an elevated road, or any combination of those.  Having transitions for each style would allow for more options with the random generation.  Of course, most of these would only be used for the larger towns as you'd need enough size to make them work well.

But these are all unavailable at this time in both RWG and Teragon.  They are just options I'd love to see, though getting people to make full sets of tiles for these things might be difficult unless RWG is also updated to allow such connection controls.

 
River Tiles Through Settlements -- Running a river through a settlement.

Pinging @sillls so that they're aware of where we went with the conversation.

Pinging @faatal in case he was following along.

I don't fully understand the two options you propose, @Riamus. We might need a white board for me to get it.

If I can get through the rest of this week I'll have a Spring Break week. Then I could arrange to make some Tiles. I could make some River Tiles.

At present, I'm only capable of ASCII art as I am in full couch potato mode.

River Straight Tile / Road Straight Tile

+---R---+
|...R...|
VVVVRVVVV
|...R...|
+---R---+




The idea being that R's are a Road and V's are a River. If you start on the West Side of a Settlement and make a line of only that kind of Tile to the East Side of the Settlement, then you get a river running through town East to West and roads that cross it North to South. (Or, you could rotate so the river is North to South and the road crossings would be East to West.

Only one tile has to be made for the concept to work ( rwg_tile_river_straight ) ... but without RWG or Teragon being involved, only manual placement of Tiles will make it happen. RWG takes TFP; Teragon takes interest and a viable algorithm from the Teragon team.

Obviously, one Tile isn't much variety, so if it were viable and looked promising, I'd make several of those Tiles.

Now if a more advance algorithm is possible, or manual placement is so compelling, then I could see two other River Tiles...

River Corner Tile with no road interaction

+-------+
|.......|
|...VVVV|
|...V...|
+---V---+

River T Tile with no road interaction

+-------+
|.......|
|VVVVVVV|
|...V...|
+---V---+




That was my thinking.

Another point of integration for manual map makers with heightmaps, RWG, and/or Teragon is the width and depth of the river at the entry point to each Tile. That can't be flexible without code support, like RoadExits, so we'd have to pick something.

Oh, it just occurred to me I could make a River Cap Tile and just make the river go underground. So it enters and never leaves.

 
Last edited by a moderator:
River Tiles Through Settlements -- Running a river through. settlement.

Pinging @sillls so that they're aware of where we went with the conversation.

Pinging @faatal in case he was following along.

I don't fully understand the two options you propose, @Riamus. We might need a white board for me to get it.

If I can get through the rest of this week I'll have a Spring Break week. Then I could arrange to make some Tiles. I could make some River Tiles.

At present, I'm only capable of ASCII art as I am in full couch potato mode.

River Straight Tile / Road Straight Tile

+---R---+
|...R...|
VVVVRVVVV
|...R...|
+---R---+




The idea being that R's are a Road and V's are a River. If you start on the West Side of a Settlement and make a line of only that kind of Tile to the East Side of the Settlement, then you get a river running through town East to West and roads that cross it North to South. (Or, you could rotate so the river is North to South and the road crossings would be East to West.

Only one tile has to be made for the concept to work ( rwg_tile_river_straight ) ... but without RWG or Teragon being involved, only manual placement of Tiles will make it happen. RWG takes TFP; Teragon takes interest and a viable algorithm from the Teragon team.

Obviously, one Tile isn't much variety, so if it were viable and looked promising, I'd make several of those Tiles.

Now if a more advance algorithm is possible, or manual placement is so compelling, then I could see two other River Tiles...

River Corner Tile with no road interaction

+-------+
|.......|
|...VVVV|
|...V...|
+---V---+

River T Tile with no road interaction

+-------+
|.......|
|VVVVVVV|
|...V...|
+---V---+




That was my thinking.

Another point of integration for manual map makers with heightmaps, RWG, and/or Teragon is the width and depth of the river at the entry point to each Tile. That can't be flexible without code support, like RoadExits, so we'd have to pick something.

Oh, it just occurred to me I could make a River Cap Tile and just make the river go underground. So it enters and never leaves.
I think perhaps you're misunderstanding what I'm referring to.  What I was suggesting is not a way to get a river from outside a town to run through a town.  It would apply to a river that is made using tiles only.  It is not currently possible to do an outside river that runs through a town in RWG or Teragon.  And again, this is not perfect by any means, but is something that could be done without any changes made by TFP.  The "better" option I mentioned above in the second post that would require changes by TFP (and Pille) would allow for a much better outcome.

The first option is to have tiles that only have a river and terrain on them.  Optionally POI as well, though no roads.  You would have a single set (or more for variety) of tiles that include a river.  This includes each tile type.  See below.  This could be a potential "town" randomly generated, but where the tiles have rivers instead of roads.  You can see there are caps, corners, and Ts in this example, though it could include the others.  Technically, since you'd start a town with a gateway tile, one of those caps would be a gateway tile.  Unless it's possible to not use a gateway tile for a RWG town?  I'm not sure about that.

image.png

Now, of course, this example shows perfectly straight rivers and so looks odd.  But if those tiles had curving rivers on the tiles, it could look far more realistic.  Maybe not as realistic as a generated river could, but better than the current river stamps.  Of course, with Teragon, there are already generated rivers, so this wouldn't be much value there.  But it could be used there and can also be used in RWG by setting up a town type that is smaller (probably under 10 tiles) so that you don't get too much of a grid pattern in the rivers that would look really weird and by having only one district... a custom district that includes only the river tiles.  Because the tiles use the same connecting points for the river as what you'd use for roads, they'd connect just like roads do.

The second option is to have both roads and rivers.  I do need to retract this option as once I started drawing it out, I realized that without rivers on both sides of the road, it wouldn't connect properly.  In my head it seemed to work, but not when drawn.  Heh.  Still, the first option is a possibility, which was more of what we were talking about initially anyhow... having tiles create a random river.  I had though to make it possible for roads as well, but that seems to not be a good option without changes to RWG/Teragon like those I listed in my second post above.

Regarding my suggestion for controlling connections between tiles that I mentioned above, here is the original post that I made about it, providing additional details.  I think this would allow for some really great possibilities for tiles, but does require RWG to be updated to support it and/or Teragon to be updated to support it (preferably both).  It is actually on the list for Teragon at some point, but there isn't a great chance anyone would make the necessary tiles if they are only usable in Teragon or by manually placing them, so it would really be beneficial if RWG could do something like this as well.

 
Last edited by a moderator:
I think perhaps you're misunderstanding what I'm referring to.  What I was suggesting is not a way to get a river from outside a town to run through a town.  It would apply to a river that is made using tiles only.


Oh, I see. The goal of this approach is an alternative to how rivers are made. Instead of a stamp, you make a river using the settlement feature. This would basically be the MPLogue approach to making a swamp. The "PRO" is you get a few more combinations of rivers and maybe even a island. The "CON" is you can't make the settlement very big or you end up with a river grid. This approach also takes a settlement out of play so the map will have fewer POIs. That's not always a bad thing -- it depends on how many settlements you replace with river settlements.

The second option is to have both roads and rivers.  I do need to retract this option as once I started drawing it out, I realized that without rivers on both sides of the road, it wouldn't connect properly.  In my head it seemed to work, but not when drawn. 


If it is both river and road connections on the same side of the Tile, then you would have to define a standard for connecting them, like road on the right and river on the left. Then it will work if a T has both go the same direction. If you start making things like "the river is straight, but the road is a T" then you'll get a lot of Tile combinations. Without putting in any deep thinking, it might be 5^2=25 combinations, but that seems low. I mean, "road intersection, river cap" could have the river cap on any of the four sides, so it might be something approaching 100 Tile combinations.

 
I have not ever worked with the tiles so can you answer for me please.

Can tiles be associated with a specific height to render at, or a biome,

or are they just an and or nor config similar to electrical switches printed

in a 2d texture format?  What in rwg.xml regulates how they would be

configured.  Is it the random zones then they are filled in, the process confuses

me, like what are the process in order?

 
Can tiles be associated with a specific height to render at, or a biome, or are they just an and or nor config similar to electrical switches printed in a 2d texture format? 


For RWG, there is no height setting/control for Tiles or POIs that I recall. POIs can be restricted to one or more biomes, but not I'm not sure Tiles can be. Unless you're using the CompoPack, you generally don't want to mess with that as you don't have a lot a lot of Tiles to configure. You can starve your map of content.

I'm not sure what you mean by the electrical switches part. Tiles belong to a District. Districts belong to a Settlement. Settlements can be associated with a Biome. TFP doesn't have enough Tiles in the game for them to worry about making a Settlement specific to one biome with the possible exception of the Western Town and only because few people want more than one or two of those on a map.

What in rwg.xml regulates how they would be configured.  Is it the random zones then they are filled in, the process confuses me, like what are the process in order?


The rwgmixer.xml file allows you to control a min and max appearing and a density number.

RWG discovers Tiles by looking in the Prefabs/RWGTiles folder of both the game and all modlets. They do not have to be mentioned in the rwgmixer.xml file unless you want to change some default value. The names of the Tile files tell RWG about their configuration. Consider:

rwg_tile_commercial_intersection_zztong_01.xml

Is an "intersection" arrangement and the tile can be used in the "commercial" district.

Is that what you're asking? Or are you asking to know more about how RWG populates the world and how Tiles fit into that?

 
If it is both river and road connections on the same side of the Tile, then you would have to define a standard for connecting them, like road on the right and river on the left. Then it will work if a T has both go the same direction. If you start making things like "the river is straight, but the road is a T" then you'll get a lot of Tile combinations. Without putting in any deep thinking, it might be 5^2=25 combinations, but that seems low. I mean, "road intersection, river cap" could have the river cap on any of the four sides, so it might be something approaching 100 Tile combinations.
That was my initial thought.  But I realized that you won't know a rotation.  So, for example, if you have a straight tile with a road on one side and a river on the other, that tile might be rotated so the river is on the right on the road on the left and then placed next to another straight that is rotated so it's opposite.  I'm not sure that straight tiles ever get rotated 180 like that from one another, but it would also affect other tiles like Ts, which definitely can be rotated in all directions.  If the T is pointing north and another is pointing south, the rivers wouldn't line up.  And with random gen, you won't know how that will work.  You can, of course, place them manually in the correct rotations.

This is where having control over connections would make a huge difference.

 
Oh, I see. The goal of this approach is an alternative to how rivers are made. Instead of a stamp, you make a river using the settlement feature. This would basically be the MPLogue approach to making a swamp. The "PRO" is you get a few more combinations of rivers and maybe even a island. The "CON" is you can't make the settlement very big or you end up with a river grid. This approach also takes a settlement out of play so the map will have fewer POIs. That's not always a bad thing -- it depends on how many settlements you replace with river settlements.


Yep, this is what I was talking about in the devdiary thread. The entire "river" would be built into the tile set of a custom settlement.

Actual geographic rivers could then be very easily added by Teragon after 7DTD RWG does most of the work. Teragon allows you to create roads and rivers from point A to point B manually, so you'd be able to make it look like a river naturally flows into and out of your "river town" with a little bit of post-processing work.

So no, there's no way to get this to work 100% using only 7DTD RWG. It would basically be a 2-step process:

1) 7DTD generates the map and towns (as usual).

2) Import the RWG data into Teragon and manually create river from the entry and exit points of the town.

You could also use Teragon to draw the highway connections to/from your river town, if necessary or desirable.

 
You hit it right. I was referencing the way they are used reminds me of and or nor gates. But it's

a lot more, So hierarchy  is district, settlement , biome.

So is it possible without using a lot of additional tiles, to create a district, to a settlement and associate

them with water onlywater or underwater biome.

It confuses me because two regulators that i see for water are fillupto, and it has since been removed in rwg was

the waterlevel.  My example I rebuilt the poilist for nitrogen, and use it with my maps. Water only forms in my

waste, because it is at the bottom of the map. The only water in my mountains is poi specific.

 
Teragon allows you to create roads and rivers from point A to point B manually, so you'd be able to make it look like a river naturally flows into and out of your "river town" with a little bit of post-processing work.
Teragon does not allow creating rivers from point A to point B.  You can do roads, but not rivers.

 
@Riamus this may sound stupid but if you create a road from point a to be in Terragon

and then paint the road to 4 on grayscale would it not automatically fill with water on first

load up?

 
Teragon does not allow creating rivers from point A to point B.  You can do roads, but not rivers.


I could have sworn it did! It's been awhile (over a year), but I have indeed added rivers to maps manually before. I suppose it's possible that I used a another heightmap editor and then flooded out the area using Teragon in order to generate the Splat (which it can definitely do).

 
@Riamus this may sound stupid but if you create a road from point a to be in Terragon

and then paint the road to 4 on grayscale would it not automatically fill with water on first

load up?
Not really.  First, roads don't have elevation as far as I know.  They are solid red or green in the splat file and are just placed over the top of whatever terrain is there.  So you can't really change the elevations other than by editing the heightmap.  But I don't edit roads manually, so I may not be entirely correct about that.  But in any case, water only fills a low area if that area is connected to water that is higher than the low area.  Roads wouldn't normally be connected to any water, so there'd be no water to fill them.  And even if they could fill, low areas only fill in a loaded chunk and it's a slow process that will quickly tank your FPS if you have too much filling going on.

I could have sworn it did! It's been awhile (over a year), but I have indeed added rivers to maps manually before. I suppose it's possible that I used a another heightmap editor and then flooded out the area using Teragon in order to generate the Splat (which it can definitely do).
Yes, you can flood areas that you either manually made or that are generated with Teragon.  But you can't control start and stop locations of rivers from Teragon.

 
Not really.  First, roads don't have elevation as far as I know.  They are solid red or green in the splat file and are just placed over the top of whatever terrain is there.  So you can't really change the elevations other than by editing the heightmap.  But I don't edit roads manually, so I may not be entirely correct about that.  But in any case, water only fills a low area if that area is connected to water that is higher than the low area.  Roads wouldn't normally be connected to any water, so there'd be no water to fill them.  And even if they could fill, low areas only fill in a loaded chunk and it's a slow process that will quickly tank your FPS if you have too much filling going on.

Yes, you can flood areas that you either manually made or that are generated with Teragon.  But you can't control start and stop locations of rivers from Teragon.


Yep. The heightmap is modified at creation time to accommodate the roads on the Splat, but the Splat itself doesn't do anything except determine where the textures are laid down.

As for how roads are handled in Teragon, I can't remember if CreateRoad modifies the heightmap or just adds a simple line to the Splat. I think it does actually modify the heightmap, if necessary. But just like in regular road generation, you have no control over what elevation changes are made.

 
Last edited by a moderator:
Thats what I meant if you draw the road to use it as a guide for how you wanted the river to run.

Then edit the height map, because water is regulated by height on my height maps water base

is always 3 or 4 and only comes up to my wasteland, with out touching it, populated islands, and

pois along a shore are created on their own.   It adds on step but its basically painting tracing

over a line creating the river at what ever diameter you want.

With roads since I hand paint and adjust mine, you are right they normally follow the top of the terrain

But i use gradients, in order to make roads and paths that either follow terrain or cut through it with

cliffs on the side

 
Last edited by a moderator:
Yep. The heightmap is modified at creation time to accommodate the roads on the Splat, but the Splat itself doesn't do anything except determine where the textures are laid down.

As for how roads are handled in Teragon, I can't remember if CreateRoad modifies the heightmap or just adds a simple line to the Splat. I think it does actually modify the heightmap, if necessary. But just like in regular road generation, you have no control over what elevation changes are made.
Yes, it modifies the heightmap, but you can't set an elevation.

Thats what I meant if you draw the road to use it as a guide for how you wanted the river to run.

Then edit the height map, because water is regulated by height on my height maps water base

is always 3 or 4 and only comes up to my wasteland, with out touching it, populated islands, and

pois along a shore are created on their own.   It adds on step but its basically painting tracing

over a line creating the river at what ever diameter you want.
Ok, yeah... if you are editing the heightmap where the roads are, you could lower it and make it a river.  But that isn't something most people are going to be able to do (or be willing to do) as heightmap editing isn't a simple matter if you want things to look good afterwards.  Once someone knows what they are doing, it's not that hard, though it's time consuming.  But for someone just making maps with RWG or Teragon, jumping into editing heightmaps isn't something most would do.

But water isn't a set elevation.  If you add water after making changes to the heightmap, then it will fill in elevations lower than that water level.  But any changes to the heightmap after the fact are not affected and loading a map into the game will not fill those areas except in the way I mentioned above.  You could import a heightmap into Teragon and then create the water map, but it will not just automatically fill based on a water level.

 
Just a stray thought here, but if you COULD influence min/max elevation in Teragon when using CreateRoad, then you could basically plop down a low-elevation road between two points (as usual), which would create a sort of low "valley" road. Then manually erase the road from the Splat using a paint program. Reimport the new modified Splat and heightmap into Teragon, and then use FloodArea in Teragon.

I mean, Teragon doesn't allow control over elevation currently. But it would be awesome if it did. You could basically repurpose CreateRoad to lay down rivers.

 
The reason i asked and am confused about height regulation because this is my main testing map. its 3d, all of the water on here is in the

wasteland at the lowest altitude of the map. The biomes follow terrain height. I guess I need to test a lot. But thank you for point the way.

pc.png

pp.png

 
The reason i asked and am confused about height regulation because this is my main testing map. its 3d, all of the water on here is in the

wasteland at the lowest altitude of the map. The biomes follow terrain height. I guess I need to test a lot. But thank you for point the way.
The game doesn't have a water table (a set water level where all lower areas will be filled in).  If it did, you could dig a mine and it would have water in it if deep enough.  Water is placed only when making a water map.  Any changes to terrain afterwards doesn't change where water is, though if you lower terrain adjacent to water, it will flood into that area when that chunk is loaded in the game.  But it will be a slow flood that will tank FPS if it's too much flooding.  This is why when you make crevices after making the water map, the crevices are not filled with water.  Normally you are finishing your heightmap before creating a water map, which is why the water is everywhere that is low on the heightmap.  But changing the heightmap after making a water map will not automatically fill in the new lower areas and will also not remove water from a new higher area.  As a side note, Teragon can flood depressions in higher elevations like mountains if you want.

 
Back
Top