Roads of Daggerfall

Show off your mod creations or just a work in progress.
Post Reply
jedidia
Posts: 165
Joined: Sat Sep 15, 2018 9:49 am

Re: Roads of Daggerfall

Post by jedidia » Wed Jun 19, 2019 3:22 pm

Just simplify it, than it will work.
I agree that a KISS approach usually leads to tangible results the fastest. The problem is, though, we'd need an actual PoC first. I.e. the problem of how to actually display roads between two arbitrary points in the game, especially with different terrain generators.
Once somebody makes that, refining an algorithm that makes the roads make sense seems just a matter of gradual iteration from the simple to the complex. But as long as somebody doesn't solve the fundamental problem, the idea won't be getting anywhere.

Alexander DeLarge
Posts: 8
Joined: Thu Jun 28, 2018 12:51 pm

Re: Roads of Daggerfall

Post by Alexander DeLarge » Sat Jun 29, 2019 8:21 pm

meritamas wrote:
Tue Jun 18, 2019 7:26 pm
I'm all for making things simple. A thought occurred to me, though. 'Having no roads is simple. You don't have to do anything, it's already there.' For some reason, somebody would like to try and add roads anyway... saying 'simple' seems simple, but it's not that simple...

...the next question could be how much complexity and effort we are willing to put into a solution and what we would like that solution to look like. Like: how much complexity are we willing to allow for a certain addition to realism and immersion? We could then think a lot, look at the alternatives and the potential trade-offs and pick one (or several) route(s) forward. Considering the potential effort needed to do this and the fact that someone is already actively working on a solution, the most reasonable way forward I see is to wait and see how those things work out before beginning anything time-consuming that could potentially turn out to be redundant.
Honestly I'm less interested in the road system as an atmospheric addition to the game but more as a foundation to build further mods around. Having traveling merchants and tying random encounters such as brigand raids to the road system is what gets me excited. Hate to say it like this but the sooner we get this framework, the sooner it'll be a foundation for others to build on. Especially when interest is going to be at an all-time high next month with the all the major systems completely implemented.

meritamas
Posts: 58
Joined: Sun Apr 07, 2019 6:16 am
Location: Slovak Republic

Re: Roads of Daggerfall

Post by meritamas » Thu Jul 11, 2019 12:00 pm

Alexander DeLarge wrote:
Sat Jun 29, 2019 8:21 pm
Honestly I'm less interested in the road system as an atmospheric addition to the game but more as a foundation to build further mods around. Having traveling merchants and tying random encounters such as brigand raids to the road system is what gets me excited. Hate to say it like this but the sooner we get this framework, the sooner it'll be a foundation for others to build on. Especially when interest is going to be at an all-time high next month with the all the major systems completely implemented.
Yes, absolutely. And patrolling guards like in Oblivion etc. A lot could be gained with a road system.

However, it also seems that a lot of effort needs to be put in first.

On the one hand, I encouraged and supported jayhova to write more about how a realistic solution would look like because I think having a more realistic solution that works is better than having a less realistic solution that works. If there is just one bit of extra effort needed, then let's go that extra mile and produce a realistic solution. Before you can design and implement a realistic solution, you would first like to know what such a solution would look like - to know what you are aiming for. Hence, those walls of text are useful provided some of it turns out to be implementable later on.

On the other hand, I also agree that having a not-so-realistic solution that works is still better than having a realistic solution that does not work (i.e. to practically have no solution at all).

I plan to get back to this with time as I can manage. Hope I already find lots of progress done by then, but this is one of those things I might be willing to work on myself one day (but not too soon because of other engagements :) ).
At this point, I aim to improve DFU by formulating ideas and working out some details of how things could work better.

User avatar
mikeprichard
Posts: 712
Joined: Sun Feb 19, 2017 6:49 pm

Re: Roads of Daggerfall

Post by mikeprichard » Thu Jul 11, 2019 12:50 pm

I hope this comment isn't misinterpreted, but I'm really curious - is any concrete work (coding etc.) being done on this admittedly gigantic task, or is this still in the planning stages? I admit I haven't read through all the text here.

meritamas
Posts: 58
Joined: Sun Apr 07, 2019 6:16 am
Location: Slovak Republic

Re: Roads of Daggerfall

Post by meritamas » Fri Jul 12, 2019 6:02 am

mikeprichard wrote:
Thu Jul 11, 2019 12:50 pm
I hope this comment isn't misinterpreted, but I'm really curious - is any concrete work (coding etc.) being done on this admittedly gigantic task, or is this still in the planning stages?
No coding done on my part so far. All I was doing so far apart from writing and posting comments was research into what the most appropriate tools would be to create a high resolution heightmap with a graphical indication of the population centers. Then, a human could more easily determine where the main roads would be and perhaps some algorithms could be used for fine-tuning and drawing in inferior roads.

I also have the impression that hedgelord is seriously working on an algorithmic solution to draw in the roads. I am almost sure he has done some coding too and could now very well be in the process of fixing some problems.
At this point, I aim to improve DFU by formulating ideas and working out some details of how things could work better.

User avatar
mikeprichard
Posts: 712
Joined: Sun Feb 19, 2017 6:49 pm

Re: Roads of Daggerfall

Post by mikeprichard » Fri Jul 12, 2019 11:09 am

OK, thanks!

CHAPPJO
Posts: 38
Joined: Fri Sep 22, 2017 12:54 am

Re: Roads of Daggerfall

Post by CHAPPJO » Sat Jul 13, 2019 12:59 am

Some people here seem to be proposing some quite complicated ways to try and generate the basic layout of the roads. Trading routes? I'm not a programmer, but I know a bit about some of the stuff. So I thought I'd share my idea to generate the roads. (that probably sucks)

This is obviously an imperfect solution that would need huge refinement. Either way, to me at least, it seems achievable (maybe?). The basic road layouts would be generated in advance, and would likely need to be re-generated for mods that alter the heightmap. This would all use the A* algorithm, with each ~800x800m world chunk being a node.


The generation would start with large cities (>=32 blocks?), then go to smaller towns (>=16 blocks?), then down to the smallest (<16 chunks?). Any roads generated from this would be one of three qualities / sizes, this would be based of which of the previous categories of cities it would be.
After the cities it would move on to taverns, then farms, then houses, these would have even smaller and worse quality roads.

At each of the previous steps, it would look for the nearest 3(? maybe 1 or 2 for smaller locations?) locations of higher tier (or equal for the largest cities), and use the A* algorithm to try and link to each, starting with the furthest away first, assuming there wasn't already a road connecting them, remember, each ~800x800m "chuck" of the world would be a different node.

Difficulty to move to each different node would depend on several things;

1) Incline of slope (the higher the harder)

2) If the node is already a larger road (make it easier, intended to simulate the road joining up, then separating again), in other words, "meeting up" and temporarily joining with other larger only(?) roads. As can be seen in the following image, this smaller road from the farm joins with the larger one between the towns up to get to the destinations.
using_roads.png
3) If the node contains a location, e.g. a tavern or home, not dungeons(?) (makes it actually take away "movement points"(or whatever the technical term is). It makes sense to make a small deviation to a resting place for travellers, does it not?). This is helpful in situations such as the one below, where it's only a small detour from sentinel to the tavern.
sentinel_road.png
4) If it's water (making them impassible / making them bridges and very hard)


Issues (that I can think of):
-The big one: This is only for the vague layout, not anything at the actual game level, just the world. This could be addressed by increasing the "resolution" of nodes, e.g. having 4, 16, or even 64 in each "chunk". Even after that you would still have many issues, lining up the roads with the city gates for example.
-Making the roads avoid dungeons might be a tricky thing to do, and could make the shape of the roads very unnatural. However dungeons don't necessarily have to be avoided.
-In that one kingdom containing that "river", in reality a bridge would be built, this does not simulate this. You could make water chunks traversable to get around this, however you would have to limit in to large roads only, and somehow make a sectioned models of bridges to chuck together.
-Some chunks might have more height variation in them than others, this could produce strange results.
You do not have the required permissions to view the files attached to this post.

User avatar
ByteMixer
Posts: 94
Joined: Sun Mar 25, 2018 4:43 am
Location: Philadelphia, PA, USA
Contact:

Re: Roads of Daggerfall

Post by ByteMixer » Sun Jul 14, 2019 3:16 am

Looking at the big picture. The problem is more or less solved with regards to a flat map. Main roads connect large cities and large towns. Smaller but still paved roads branch off to connect to smaller, unwalled towns, If a Town is very close to the main road, it's possible the main road could simply divert to run through the town. Same with the idea with the inns. Then you have your crappy unpaved roads connecting to farms, and maybe some of the pre-marked tombs. And then you have almost-non-existant roads going to the dungeons or creature dens, etc. where it's little more than an animal trail. Rough terrain where the road is sparse and disappears for certain stretches.

Height map adds a new layer or tier of complexity, but with proper algorithms, should be solvable. There are two ways to do it, but I don't know of the 2nd idea is possible in daggerfall, or if editing the height map based on the road could be done.

The first way has been discussed a lot, talking about how to deal with the steepness of the terrain.

The 2nd way that I'm not sure if it's doable:

Roads, particularly the main roads that an army or any decent sized trade caravans will travel are going to be pretty damn flat. This means if there's an incline, or a hill in the way....chances are the imperial army is going to conscript locals to dig through the middle of the hill, and in some cases, tunnel through a larger hill or mountain. This is probably going to be the case for just about any paved road as it should be relatively smooth and wide. In the cases of dips or descents, they might regrade the incline to smooth it out for the road. er, if the descent isn't too far at least. For really steep drops, they'll more likely just follow the cliff line.

Lesser used gravel or dirt roads are more likely to go around a hill or steep incline than be dug through it, I think. At least that's how the logic works in my head. Is it historically accurate? Probably not. But in terms of game logic and immersion, it could make sense to just level the terrain.


So I wonder if we could create the road, have it follow the connective algorithm as desired, then do a 2nd pass to apply the height map. 3rd pass to redo the height maps on the road where it makes sense (cutting through a hill or filling in a dip, or smoothing out the grade of the inclination or declination)

Maybe do roads in a few passes. Main roads 1st, then apply height, then adjust height maps, and in some cases possibly divert. Next, do the smaller branching paved roads, do the same passes as done for the main roads. And so on, so forth. Gravel/dirt roads may have a rule change where the road goes around the hill rather than through it as it's probably locals doing unsupervised work. And of course the animal paths to dungeons or interesting places where there is hardly any road at all, well....it's a rough land with some rough terrain. :D

An aside thought:

In the game, Villages, Cities, Inns, etc. are flat in the cells that involve them. You don't have mountains or hills sprouting up in the middle of Somethingorother Masterston's farm afterall. Rig roads to behave in the same matter that a town cell or black behaves. Though I guess how the road "block" behaves is going to dependent on how the terrain around it behaves. I mean, Daggerfall is up on a fairly large incline when using the Distant Terrain mod. Or was it Wayrest?

Maybe trick daggerfall into thinking that roads are just a really weird shaped town or village? Er.....after the whole "connect the dots in complex and interesting ways to make roads" bit gets figured out at least.
"Whatever you do, make good art." - Neil Gaiman

Dalebvr
Posts: 30
Joined: Wed May 22, 2019 9:52 pm

Re: Roads of Daggerfall

Post by Dalebvr » Sun Jul 14, 2019 11:07 am

A point of correction; Unless you want to specify that magic was used in place of bulldozers, dynamite and back hoes, major roads went -around- mountains, or through mountain passes. The 'blow it up, tear it down, RAH RAH RAH!' style of construction we have now is barely 170 years old. Before that it was all man power, and the path of least resistance.

User avatar
jayhova
Posts: 628
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: Roads of Daggerfall

Post by jayhova » Tue Jul 16, 2019 3:36 am

roads.jpg
Assuming the green points are settlements and the red dot is a farm or home etc. both the first and second examples do not work as roads. Why? Because roads are built to go somewhere. Not just anywhere. Somewhere specific. Where? The closest place that will provide you a means of living. In the first/bottommost example our homestead is connected to two settlements. This ignores the fact that roads are created one at a time. There is little incentive to create a very long and expensive road to a settlement when you already have one. So no, the first example would not make sense.

Let's look at the second example where the homestead builds the shortest possible road to connect it with a population center. This ignores the idea that people build roads to provide a living for the themselves. The route pictured to the closest settlement is 60% longer than a direct route. For 40% more road they have a direct path to the settlement they will be going to 90% of the time. It's pretty simple if there are two settlements near you and one is twice as far as the other you will be spending most of your time going to the closer one.

In the third example is how it is likely a set of roads would evolve. The homestead builds a road 40% longer to save 60% time on 90% of their trips. Later they spend half as much again to create a third road segment that shortens the trip to the second settlement significantly. This road set does not increase the travel time to the second settlement by a significant percentage but does reduce the travel time to the closest settlement significantly. In this way the roads do what they are built to do, pay for themselves as quickly as possible.

EDIT: The road to the second settlement is less than 10% longer than the second example
You do not have the required permissions to view the files attached to this post.
Remember always 'What would Julian Do?'.
Windows 10 Pro 64 bit. DFU Ver. Alpha 0.10.7

Post Reply